[corlib] Add missing api
authorMarek Safar <marek.safar@gmail.com>
Thu, 27 Feb 2014 19:21:37 +0000 (20:21 +0100)
committerMarek Safar <marek.safar@gmail.com>
Thu, 27 Feb 2014 19:22:12 +0000 (20:22 +0100)
mcs/class/corlib/System.Diagnostics.Contracts/ContractOptionAttribute.cs
mcs/class/corlib/System.Diagnostics.Tracing/EventCommandEventArgs.cs [new file with mode: 0644]
mcs/class/corlib/System.Diagnostics.Tracing/EventSource.cs [new file with mode: 0644]
mcs/class/corlib/System.Threading/CancellationTokenSource.cs
mcs/class/corlib/corlib.dll.sources

index b060838289258b31d4e6d22158339c18a84617d4..62c757e720ff81dbce3b6ef3d5092d6e72de569b 100644 (file)
@@ -28,7 +28,7 @@ namespace System.Diagnostics.Contracts {
 
        [AttributeUsageAttribute(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
        [ConditionalAttribute("CONTRACTS_FULL")]
-       public class ContractOptionAttribute : Attribute {
+       public sealed class ContractOptionAttribute : Attribute {
                public ContractOptionAttribute (string category, string setting, bool enabled)
                {
                        Category = category;
diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventCommandEventArgs.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventCommandEventArgs.cs
new file mode 100644 (file)
index 0000000..b64e522
--- /dev/null
@@ -0,0 +1,41 @@
+//
+// EventCommandEventArgs.cs.cs
+//
+// Authors:
+//     Marek Safar  <marek.safar@gmail.com>
+//
+// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_4_5
+
+namespace System.Diagnostics.Tracing
+{
+       public class EventCommandEventArgs : EventArgs
+       {
+               private EventCommandEventArgs ()
+               {                       
+               }
+       }
+}
+
+#endif
diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventSource.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventSource.cs
new file mode 100644 (file)
index 0000000..aaf65a2
--- /dev/null
@@ -0,0 +1,63 @@
+//
+// EventSource.cs
+//
+// Authors:
+//     Marek Safar  <marek.safar@gmail.com>
+//
+// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_4_5
+
+namespace System.Diagnostics.Tracing
+{
+       public class EventSource : IDisposable
+       {
+               protected EventSource ()
+               {
+               }
+
+               protected EventSource (bool throwOnEventWriteErrors)
+               {
+               }
+
+               public bool IsEnabled ()
+               {
+                       return false;
+               }
+
+               public void Dispose ()
+               {
+                       Dispose (true);
+               }
+
+               protected virtual void Dispose (bool disposing)
+               {                       
+               }
+
+               protected void WriteEvent (int eventId, int arg1, int arg2, int arg3)
+               {
+               }
+       }
+}
+
+#endif
index c5557f0446e69b7808e73a295b08c7c244d4e469..f92eba8f58894e735bc8132eb467a561f4d6f773 100644 (file)
@@ -125,7 +125,7 @@ namespace System.Threading
                // Don't throw ObjectDisposedException if the callback
                // is called concurrently with a Dispose
                //
-               public void CancelSafe ()
+               void CancelSafe ()
                {
                        if (!disposed)
                                Cancellation (true);
index 3bab3edb7f8d9495a371fcf13a5b0ae8bb1ef975..53e6e76d7aed5af2219c418a26606ab3c74d75e9 100644 (file)
@@ -360,6 +360,8 @@ System.Diagnostics.Contracts/ContractShouldAssertException.cs
 System.Diagnostics.Contracts/ContractVerificationAttribute.cs
 System.Diagnostics.Contracts/PureAttribute.cs
 System.Diagnostics.Contracts.Internal/ContractHelper.cs
+System.Diagnostics.Tracing/EventSource.cs
+System.Diagnostics.Tracing/EventCommandEventArgs.cs
 System.Diagnostics.SymbolStore/ISymbolBinder.cs
 System.Diagnostics.SymbolStore/ISymbolBinder1.cs
 System.Diagnostics.SymbolStore/ISymbolDocument.cs