[bcl] Base type update to match netstandard apis
authorMarek Safar <marek.safar@gmail.com>
Fri, 23 Sep 2016 10:10:11 +0000 (12:10 +0200)
committerMarek Safar <marek.safar@gmail.com>
Fri, 23 Sep 2016 10:10:11 +0000 (12:10 +0200)
14 files changed:
mcs/class/System.Core/Microsoft.Win32.SafeHandles/SafeNCryptHandle.cs
mcs/class/System/Microsoft.Win32.SafeHandles/SafeX509ChainHandle.cs
mcs/class/System/System.IO/FileSystemWatcher_mobile.cs
mcs/class/corlib/System.Reflection/Assembly.cs
mcs/class/corlib/System.Reflection/TargetException.cs [deleted file]
mcs/class/corlib/System.Reflection/TargetInvocationException.cs [deleted file]
mcs/class/corlib/System.Reflection/TargetParameterCountException.cs [deleted file]
mcs/class/corlib/corlib.dll.sources
mcs/class/referencesource/mscorlib/system/contextboundobject.cs
mcs/class/referencesource/mscorlib/system/io/filesysteminfo.cs
mcs/class/referencesource/mscorlib/system/io/stream.cs
mcs/class/referencesource/mscorlib/system/io/textreader.cs
mcs/class/referencesource/mscorlib/system/io/textwriter.cs
mcs/class/referencesource/mscorlib/system/runtime/serialization/formatters/binary/binaryformatter.cs

index 873ce5782aa4d48a2f32f86ee01e91746d8b9f9e..cbf1491612fcb12ef9a378c26e6cf214b0d30835 100644 (file)
@@ -30,10 +30,10 @@ using System;
 
 namespace Microsoft.Win32.SafeHandles
 {
-       public abstract class SafeNCryptHandle : System.Runtime.InteropServices.SafeHandle
+       public abstract class SafeNCryptHandle : SafeHandleZeroOrMinusOneIsInvalid
        {
                protected SafeNCryptHandle ()
-                       : base (IntPtr.Zero, true)
+                       : base (true)
                {
                }
 
index f3091aa38bc1de43829a03ffeb0b886659949df0..9bad4ea25dd9ae03b4f64426bdfec98f006228fa 100644 (file)
@@ -34,25 +34,16 @@ using System.Security;
 
 namespace Microsoft.Win32.SafeHandles
 {
-       public sealed class SafeX509ChainHandle : SafeHandle
+       public sealed class SafeX509ChainHandle : SafeHandleZeroOrMinusOneIsInvalid
        {
-               [MonoTODO]
-               public override bool IsInvalid
-               {
-                       get
-                       {
-                               throw new NotImplementedException ();
-                       }
-               }
-
-               [MonoTODO]
-               internal SafeX509ChainHandle() : base ((IntPtr)0, false)
+               internal SafeX509ChainHandle (IntPtr handle)
+                       : base (true)
                {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               protected override bool ReleaseHandle()
+               protected override bool ReleaseHandle ()
                {
                        throw new NotImplementedException ();
                }
index 3b274e0599e3bb53e849adfb400d0b3904118e18..aec72c7914e0e09fc39b1610f0312edf4f654a62 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+using System.ComponentModel;
+
 namespace System.IO
 {
-    public class FileSystemWatcher : IDisposable
+    public class FileSystemWatcher : Component, IDisposable
     {
         public FileSystemWatcher () { throw new NotImplementedException (); }
         public FileSystemWatcher (string path) { throw new NotImplementedException (); }
index bce2832992eea36e25b13b86a689a62fa512fdb5..e436c8dbc385a2ac902ffcbc115e0f618629ed95 100644 (file)
@@ -53,11 +53,12 @@ namespace System.Reflection {
        [ClassInterface(ClassInterfaceType.None)]
        [StructLayout (LayoutKind.Sequential)]
 #if MOBILE
-       public partial class Assembly : ICustomAttributeProvider {
+       public partial class Assembly : ICustomAttributeProvider, ISerializable
 #else
-       public abstract class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable {
+       public abstract class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable
 #endif
-               internal class ResolveEventHolder {
+       {
+               internal class ResolveEventHolder {     
 #pragma warning disable 67
                        public event ModuleResolveEventHandler ModuleResolve;
 #pragma warning restore
diff --git a/mcs/class/corlib/System.Reflection/TargetException.cs b/mcs/class/corlib/System.Reflection/TargetException.cs
deleted file mode 100644 (file)
index 5c5c69e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// System.Reflection.TargetException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.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.
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection
-{
-       [ComVisible (true)]
-       [Serializable]
-#if MOBILE
-       public class TargetException : Exception {
-#else
-       public class TargetException : ApplicationException {
-#endif
-               public TargetException ()
-                       : base (Locale.GetText ("Unable to invoke an invalid target."))
-               {
-               }
-
-               public TargetException (string message)
-                       : base (message)
-               {
-               }
-
-               public TargetException (string message, Exception inner)
-                       : base (message, inner)
-               {
-               }
-
-               protected TargetException (SerializationInfo info, StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
diff --git a/mcs/class/corlib/System.Reflection/TargetInvocationException.cs b/mcs/class/corlib/System.Reflection/TargetInvocationException.cs
deleted file mode 100644 (file)
index 5f56432..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-//
-// System.Reflection.TargetInvocationException
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Duncan Mak  (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.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.
-//
-
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection
-{
-       [ComVisible (true)]
-       [Serializable]
-#if MOBILE
-       public sealed class TargetInvocationException : Exception {
-#else
-       public sealed class TargetInvocationException : ApplicationException {
-#endif
-               public TargetInvocationException (Exception inner)
-                       : base ("Exception has been thrown by the target of an invocation.", inner)
-               {                       
-               }
-
-               public TargetInvocationException (string message, Exception inner)
-                       : base (message, inner)
-               {
-               }               
-
-               internal TargetInvocationException (SerializationInfo info, StreamingContext sc)
-                       : base (info, sc)
-               {
-               }
-       }       
-}
diff --git a/mcs/class/corlib/System.Reflection/TargetParameterCountException.cs b/mcs/class/corlib/System.Reflection/TargetParameterCountException.cs
deleted file mode 100644 (file)
index 8b6c2b2..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// System.Reflection.TargetParameterCountException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.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.
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection
-{
-       [ComVisible (true)]
-       [Serializable]
-#if MOBILE
-       public sealed class TargetParameterCountException : Exception {
-#else
-       public sealed class TargetParameterCountException : ApplicationException {
-#endif
-               public TargetParameterCountException ()
-                       : base (Locale.GetText ("Number of parameter does not match expected count."))
-               {
-               }
-
-               public TargetParameterCountException (string message)
-                       : base (message)
-               {
-               }
-
-               public TargetParameterCountException (string message, Exception inner)
-                       : base (message, inner)
-               {
-               }
-
-               internal TargetParameterCountException (SerializationInfo info,
-                                                      StreamingContext context)
-                       : base (info, context)
-               {
-               }
-       }
-}
index 3808a5985572150b5f06eabd3f67149a42bc9401..712c2cc98db8f103cf4fd938d3872a08e09b8f3f 100644 (file)
@@ -259,9 +259,6 @@ System.Reflection/PortableExecutableKinds.cs
 System.Reflection/PropertyInfo.cs
 System.Reflection/ReflectionTypeLoadException.cs
 System.Reflection/StrongNameKeyPair.cs
-System.Reflection/TargetException.cs
-System.Reflection/TargetInvocationException.cs
-System.Reflection/TargetParameterCountException.cs
 System.Reflection.Emit/AssemblyBuilder.cs
 System.Reflection.Emit/AssemblyBuilderAccess.cs
 System.Reflection.Emit/ConstructorBuilder.cs
@@ -1255,6 +1252,9 @@ ReferenceSources/BinaryCompatibility.cs
 ../referencesource/mscorlib/system/reflection/reflectioncontext.cs
 ../referencesource/mscorlib/system/reflection/resourceattributes.cs
 ../referencesource/mscorlib/system/reflection/RuntimeReflectionExtensions.cs
+../referencesource/mscorlib/system/reflection/targetexception.cs
+../referencesource/mscorlib/system/reflection/targetinvocationexception.cs
+../referencesource/mscorlib/system/reflection/targetparametercountexception.cs
 ../referencesource/mscorlib/system/reflection/typeattributes.cs
 ../referencesource/mscorlib/system/reflection/typedelegator.cs
 ../referencesource/mscorlib/system/reflection/typefilter.cs
index b0290241aa4f877917c8b3bb88c20e8ec9aaba3f..f7298b8d117d32e6ffc08d38a4682c28d71efcd4 100644 (file)
@@ -20,7 +20,7 @@ namespace System {
     using System.Security.Permissions;
     [Serializable]
     [System.Runtime.InteropServices.ComVisible(true)]
-#if FEATURE_REMOTING
+#if FEATURE_REMOTING || MONO
     public abstract class ContextBoundObject : MarshalByRefObject {
 #else // FEATURE_REMOTING
     public abstract class ContextBoundObject {
index aab4fe9497568f6ad79cd7d0ceb1a50f9d4f01e1..2db4c807d8797f45a97f136996d363d3b6b47ef1 100644 (file)
@@ -34,7 +34,7 @@ namespace System.IO {
     [FileIOPermissionAttribute(SecurityAction.InheritanceDemand,Unrestricted=true)]
 #endif
     [ComVisible(true)]
-#if FEATURE_REMOTING        
+#if FEATURE_REMOTING || MONO
     public abstract class FileSystemInfo : MarshalByRefObject, ISerializable {
 #else // FEATURE_REMOTING
     public abstract class FileSystemInfo : ISerializable {   
index 007745c7ab57d6979632e580b69c75f901908af5..fa022e96e5d8fc29a94d34b28c2212e6eadd28f1 100644 (file)
@@ -39,7 +39,7 @@ namespace System.IO {
 #if CONTRACTS_FULL
     [ContractClass(typeof(StreamContract))]
 #endif
-#if FEATURE_REMOTING
+#if FEATURE_REMOTING || MONO
     public abstract class Stream : MarshalByRefObject, IDisposable {
 #else // FEATURE_REMOTING
     public abstract class Stream : IDisposable {
index 5f8e7b98a7d8240203fc1deb2db8526bd4299c58..9023902cbfc3403426645684534b05089e24115c 100644 (file)
@@ -39,7 +39,7 @@ namespace System.IO {
     // There are methods on the Stream class for reading bytes. 
     [Serializable]
     [ComVisible(true)]
-#if FEATURE_REMOTING
+#if FEATURE_REMOTING || MONO
     public abstract class TextReader : MarshalByRefObject, IDisposable {
 #else // FEATURE_REMOTING
     public abstract class TextReader : IDisposable {
index 2afe3a6cbfae4d9751a6ceb27ad2343f4fb54259..3f484ffaddb1d5ebea09a176058b4b04274ff4f4 100644 (file)
@@ -39,7 +39,7 @@ namespace System.IO {
     // There are methods on the Stream class for writing bytes. 
     [Serializable]
     [ComVisible(true)]
-#if FEATURE_REMOTING
+#if FEATURE_REMOTING || MONO
     public abstract class TextWriter : MarshalByRefObject, IDisposable {
 #else // FEATURE_REMOTING
     public abstract class TextWriter : IDisposable {
index 0e7bfafaf9e7bec12929f3349b607f1211c53ddc..b82294c787ba14115fb78a1ba897b19c3dd738a2 100644 (file)
@@ -34,7 +34,7 @@ namespace System.Runtime.Serialization.Formatters.Binary {
     
     [System.Runtime.InteropServices.ComVisible(true)]
     sealed public class BinaryFormatter :
-#if !FEATURE_REMOTING
+#if !FEATURE_REMOTING && !MONO
         IFormatter
 #else
         IRemotingFormatter