Reconcile the "easy" System\Reflection .cs files with their CoreRT versions. (#10387)
authorAtsushi Kanamori <AtsushiKan@users.noreply.github.com>
Wed, 22 Mar 2017 17:51:46 +0000 (10:51 -0700)
committerGitHub <noreply@github.com>
Wed, 22 Mar 2017 17:51:46 +0000 (10:51 -0700)
Files to be moved the shared partition (after CoreRT side is in)

AmbiguousMatchException.cs
AssemblyAttributes.cs
AssemblyContentType.cs
AssemblyNameFlags.cs
Binder.cs
BindingFlags.cs
CallingConventions.cs
CustomAttributeFormatException.cs
DefaultMemberAttribute.cs
EventAttributes.cs
ExceptionHandlingClauseOptions.cs
FieldAttributes.cs
GenericParameterAttributes.cs
ICustomAttributeProvider.cs
ImageFileMachine.cs
InterfaceMapping.cs
IntrospectionExtensions.cs
InvalidFilterCriteriaException.cs
IReflectableType.cs
ManifestResourceInfo.cs
MemberFilter.cs
MemberTypes.cs
MethodAttributes.cs
MethodImplAttributes.cs
Missing.cs
ModuleResolveEventHandler.cs
ParameterAttributes.cs
ParameterModifier.cs
PortableExecutableKinds.cs
ProcessorArchitecture.cs
PropertyAttributes.cs
ReflectionContext.cs
ReflectionTypeLoadException.cs
ResourceAttributes.cs
ResourceLocation.cs
StrongNameKeyPair.cs
TargetException.cs
TargetInvocationException.cs
TargetParameterCountException.cs
TypeAttributes.cs
TypeFilter.cs

45 files changed:
src/mscorlib/System.Private.CoreLib.csproj
src/mscorlib/src/System/Reflection/AmbiguousMatchException.cs
src/mscorlib/src/System/Reflection/AssemblyAttributes.cs
src/mscorlib/src/System/Reflection/AssemblyContentType.cs [new file with mode: 0644]
src/mscorlib/src/System/Reflection/AssemblyNameFlags.cs
src/mscorlib/src/System/Reflection/Binder.cs
src/mscorlib/src/System/Reflection/BindingFlags.cs
src/mscorlib/src/System/Reflection/CallingConventions.cs
src/mscorlib/src/System/Reflection/CustomAttributeFormatException.cs
src/mscorlib/src/System/Reflection/DefaultMemberAttribute.cs
src/mscorlib/src/System/Reflection/EventAttributes.cs
src/mscorlib/src/System/Reflection/ExceptionHandlingClause.cs [new file with mode: 0644]
src/mscorlib/src/System/Reflection/ExceptionHandlingClauseOptions.cs [new file with mode: 0644]
src/mscorlib/src/System/Reflection/FieldAttributes.cs
src/mscorlib/src/System/Reflection/GenericParameterAttributes.cs
src/mscorlib/src/System/Reflection/ICustomAttributeProvider.cs
src/mscorlib/src/System/Reflection/IReflectableType.cs
src/mscorlib/src/System/Reflection/ImageFileMachine.cs
src/mscorlib/src/System/Reflection/InterfaceMapping.cs
src/mscorlib/src/System/Reflection/IntrospectionExtensions.cs
src/mscorlib/src/System/Reflection/InvalidFilterCriteriaException.cs
src/mscorlib/src/System/Reflection/LocalVariableInfo.cs [new file with mode: 0644]
src/mscorlib/src/System/Reflection/ManifestResourceInfo.cs
src/mscorlib/src/System/Reflection/MemberFilter.cs
src/mscorlib/src/System/Reflection/MemberTypes.cs
src/mscorlib/src/System/Reflection/MethodAttributes.cs
src/mscorlib/src/System/Reflection/MethodBody.cs
src/mscorlib/src/System/Reflection/MethodImplAttributes.cs
src/mscorlib/src/System/Reflection/Missing.cs
src/mscorlib/src/System/Reflection/ModuleResolveEventHandler.cs
src/mscorlib/src/System/Reflection/ParameterAttributes.cs
src/mscorlib/src/System/Reflection/ParameterModifier.cs
src/mscorlib/src/System/Reflection/PortableExecutableKinds.cs
src/mscorlib/src/System/Reflection/ProcessorArchitecture.cs [new file with mode: 0644]
src/mscorlib/src/System/Reflection/PropertyAttributes.cs
src/mscorlib/src/System/Reflection/ReflectionContext.cs
src/mscorlib/src/System/Reflection/ReflectionTypeLoadException.cs
src/mscorlib/src/System/Reflection/ResourceAttributes.cs
src/mscorlib/src/System/Reflection/ResourceLocation.cs [new file with mode: 0644]
src/mscorlib/src/System/Reflection/StrongNameKeyPair.cs
src/mscorlib/src/System/Reflection/TargetException.cs
src/mscorlib/src/System/Reflection/TargetInvocationException.cs
src/mscorlib/src/System/Reflection/TargetParameterCountException.cs
src/mscorlib/src/System/Reflection/TypeAttributes.cs
src/mscorlib/src/System/Reflection/TypeFilter.cs

index d72dd0b..9ca26e5 100644 (file)
     <Compile Include="$(BclSourcesRoot)\System\Reflection\AmbiguousMatchException.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\Assembly.CoreCLR.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\AssemblyAttributes.cs" />
+    <Compile Include="$(BclSourcesRoot)\System\Reflection\AssemblyContentType.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\AssemblyName.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\AssemblyNameFlags.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\Associates.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\CustomAttribute.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\DefaultMemberAttribute.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\EventAttributes.cs" />
+    <Compile Include="$(BclSourcesRoot)\System\Reflection\ExceptionHandlingClause.cs" />
+    <Compile Include="$(BclSourcesRoot)\System\Reflection\ExceptionHandlingClauseOptions.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\FieldAttributes.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\FieldInfo.CoreCLR.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\GenericParameterAttributes.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\INVOCATION_FLAGS.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\IReflect.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\LoaderAllocator.cs" />
+    <Compile Include="$(BclSourcesRoot)\System\Reflection\LocalVariableInfo.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\ManifestResourceInfo.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\MdConstant.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\MdFieldInfo.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\ParameterModifier.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\Pointer.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\PortableExecutableKinds.cs" />
+    <Compile Include="$(BclSourcesRoot)\System\Reflection\ProcessorArchitecture.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\PropertyAttributes.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\ReflectionContext.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\ReflectionTypeLoadException.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\ResourceAttributes.cs" />
+    <Compile Include="$(BclSourcesRoot)\System\Reflection\ResourceLocation.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\RtFieldInfo.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\RuntimeAssembly.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Reflection\RuntimeConstructorInfo.cs" />
index 11abf8d..07b2323 100644 (file)
@@ -2,40 +2,26 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// AmbiguousMatchException is thrown when binding to a method results in more
-// 
-//    than one method matching the binding criteria.  This exception is thrown in
-//    general when something is Ambiguous.
-//
-//  
-//  
-//
+using System.Runtime.Serialization;
 
 namespace System.Reflection
 {
-    using System;
-    using SystemException = System.SystemException;
-    using System.Runtime.Serialization;
     [Serializable]
     public sealed class AmbiguousMatchException : SystemException
     {
-        public AmbiguousMatchException()
-            : base(SR.RFLCT_Ambiguous)
+        public AmbiguousMatchException() : base(SR.RFLCT_Ambiguous)
         {
-            SetErrorCode(__HResults.COR_E_AMBIGUOUSMATCH);
+            HResult = __HResults.COR_E_AMBIGUOUSMATCH;
         }
 
-        public AmbiguousMatchException(String message) : base(message)
+        public AmbiguousMatchException(string message) : base(message)
         {
-            SetErrorCode(__HResults.COR_E_AMBIGUOUSMATCH);
+            HResult = __HResults.COR_E_AMBIGUOUSMATCH;
         }
 
-        public AmbiguousMatchException(String message, Exception inner) : base(message, inner)
+        public AmbiguousMatchException(string message, Exception inner) : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_AMBIGUOUSMATCH);
+            HResult = __HResults.COR_E_AMBIGUOUSMATCH;
         }
 
         internal AmbiguousMatchException(SerializationInfo info, StreamingContext context) : base(info, context)
index fc1d025..1554403 100644 (file)
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-/*=============================================================================
-**
-** 
-** 
-**
-**
-** Purpose: For Assembly-related custom attributes.
-**
-**
-=============================================================================*/
-
-
-using System;
 using System.Configuration.Assemblies;
-using System.Diagnostics.Contracts;
 
 namespace System.Reflection
 {
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public sealed class AssemblyCopyrightAttribute : Attribute
     {
-        private String m_copyright;
-
-        public AssemblyCopyrightAttribute(String copyright)
+        public AssemblyCopyrightAttribute(string copyright)
         {
-            m_copyright = copyright;
+            Copyright = copyright;
         }
 
-        public String Copyright
-        {
-            get { return m_copyright; }
-        }
+        public string Copyright { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public sealed class AssemblyTrademarkAttribute : Attribute
     {
-        private String m_trademark;
-
-        public AssemblyTrademarkAttribute(String trademark)
+        public AssemblyTrademarkAttribute(string trademark)
         {
-            m_trademark = trademark;
+            Trademark = trademark;
         }
 
-        public String Trademark
-        {
-            get { return m_trademark; }
-        }
+        public string Trademark { get; }
     }
 
 
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public sealed class AssemblyProductAttribute : Attribute
     {
-        private String m_product;
-
-        public AssemblyProductAttribute(String product)
+        public AssemblyProductAttribute(string product)
         {
-            m_product = product;
+            Product = product;
         }
 
-        public String Product
-        {
-            get { return m_product; }
-        }
+        public string Product { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public sealed class AssemblyCompanyAttribute : Attribute
     {
-        private String m_company;
-
-        public AssemblyCompanyAttribute(String company)
+        public AssemblyCompanyAttribute(string company)
         {
-            m_company = company;
+            Company = company;
         }
 
-        public String Company
-        {
-            get { return m_company; }
-        }
+        public string Company { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public sealed class AssemblyDescriptionAttribute : Attribute
     {
-        private String m_description;
-
-        public AssemblyDescriptionAttribute(String description)
+        public AssemblyDescriptionAttribute(string description)
         {
-            m_description = description;
+            Description = description;
         }
 
-        public String Description
-        {
-            get { return m_description; }
-        }
+        public string Description { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public sealed class AssemblyTitleAttribute : Attribute
     {
-        private String m_title;
-
-        public AssemblyTitleAttribute(String title)
+        public AssemblyTitleAttribute(string title)
         {
-            m_title = title;
+            Title = title;
         }
 
-        public String Title
-        {
-            get { return m_title; }
-        }
+        public string Title { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public sealed class AssemblyConfigurationAttribute : Attribute
     {
-        private String m_configuration;
-
-        public AssemblyConfigurationAttribute(String configuration)
+        public AssemblyConfigurationAttribute(string configuration)
         {
-            m_configuration = configuration;
+            Configuration = configuration;
         }
 
-        public String Configuration
-        {
-            get { return m_configuration; }
-        }
+        public string Configuration { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public sealed class AssemblyDefaultAliasAttribute : Attribute
     {
-        private String m_defaultAlias;
-
-        public AssemblyDefaultAliasAttribute(String defaultAlias)
+        public AssemblyDefaultAliasAttribute(string defaultAlias)
         {
-            m_defaultAlias = defaultAlias;
+            DefaultAlias = defaultAlias;
         }
 
-        public String DefaultAlias
-        {
-            get { return m_defaultAlias; }
-        }
+        public string DefaultAlias { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public sealed class AssemblyInformationalVersionAttribute : Attribute
     {
-        private String m_informationalVersion;
-
-        public AssemblyInformationalVersionAttribute(String informationalVersion)
+        public AssemblyInformationalVersionAttribute(string informationalVersion)
         {
-            m_informationalVersion = informationalVersion;
+            InformationalVersion = informationalVersion;
         }
 
-        public String InformationalVersion
-        {
-            get { return m_informationalVersion; }
-        }
+        public string InformationalVersion { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public sealed class AssemblyFileVersionAttribute : Attribute
     {
-        private String _version;
-
-        public AssemblyFileVersionAttribute(String version)
+        public AssemblyFileVersionAttribute(string version)
         {
             if (version == null)
                 throw new ArgumentNullException(nameof(version));
-            Contract.EndContractBlock();
-            _version = version;
+            Version = version;
         }
 
-        public String Version
-        {
-            get { return _version; }
-        }
+        public string Version { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public unsafe sealed class AssemblyCultureAttribute : Attribute
     {
-        private String m_culture;
-
-        public AssemblyCultureAttribute(String culture)
+        public AssemblyCultureAttribute(string culture)
         {
-            m_culture = culture;
+            Culture = culture;
         }
 
-        public String Culture
-        {
-            get { return m_culture; }
-        }
+        public string Culture { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public unsafe sealed class AssemblyVersionAttribute : Attribute
     {
-        private String m_version;
-
-        public AssemblyVersionAttribute(String version)
+        public AssemblyVersionAttribute(string version)
         {
-            m_version = version;
+            Version = version;
         }
 
-        public String Version
-        {
-            get { return m_version; }
-        }
+        public string Version { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public sealed class AssemblyKeyFileAttribute : Attribute
     {
-        private String m_keyFile;
-
-        public AssemblyKeyFileAttribute(String keyFile)
+        public AssemblyKeyFileAttribute(string keyFile)
         {
-            m_keyFile = keyFile;
+            KeyFile = keyFile;
         }
 
-        public String KeyFile
-        {
-            get { return m_keyFile; }
-        }
+        public string KeyFile { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public sealed class AssemblyDelaySignAttribute : Attribute
     {
-        private bool m_delaySign;
-
         public AssemblyDelaySignAttribute(bool delaySign)
         {
-            m_delaySign = delaySign;
+            DelaySign = delaySign;
         }
 
-        public bool DelaySign
-        {
-            get
-            { return m_delaySign; }
-        }
+        public bool DelaySign { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public unsafe sealed class AssemblyAlgorithmIdAttribute : Attribute
     {
-        private uint m_algId;
-
         public AssemblyAlgorithmIdAttribute(AssemblyHashAlgorithm algorithmId)
         {
-            m_algId = (uint)algorithmId;
+            AlgorithmId = (uint)algorithmId;
         }
 
         [CLSCompliant(false)]
         public AssemblyAlgorithmIdAttribute(uint algorithmId)
         {
-            m_algId = algorithmId;
+            AlgorithmId = algorithmId;
         }
 
         [CLSCompliant(false)]
-        public uint AlgorithmId
-        {
-            get { return m_algId; }
-        }
+        public uint AlgorithmId { get; }
     }
 
-
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public unsafe sealed class AssemblyFlagsAttribute : Attribute
     {
-        private AssemblyNameFlags m_flags;
+        private AssemblyNameFlags _flags;
 
         [Obsolete("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")]
         [CLSCompliant(false)]
         public AssemblyFlagsAttribute(uint flags)
         {
-            m_flags = (AssemblyNameFlags)flags;
+            _flags = (AssemblyNameFlags)flags;
         }
 
         [Obsolete("This property has been deprecated. Please use AssemblyFlags instead. http://go.microsoft.com/fwlink/?linkid=14202")]
         [CLSCompliant(false)]
         public uint Flags
         {
-            get { return (uint)m_flags; }
+            get { return (uint)_flags; }
         }
 
-        // This, of course, should be typed as AssemblyNameFlags.  The compat police don't allow such changes.
         public int AssemblyFlags
         {
-            get { return (int)m_flags; }
+            get { return (int)_flags; }
         }
 
         [Obsolete("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")]
         public AssemblyFlagsAttribute(int assemblyFlags)
         {
-            m_flags = (AssemblyNameFlags)assemblyFlags;
+            _flags = (AssemblyNameFlags)assemblyFlags;
         }
 
-
         public AssemblyFlagsAttribute(AssemblyNameFlags assemblyFlags)
         {
-            m_flags = assemblyFlags;
+            _flags = assemblyFlags;
         }
     }
 
     [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)]
     public sealed class AssemblyMetadataAttribute : Attribute
     {
-        private String m_key;
-        private String m_value;
-
         public AssemblyMetadataAttribute(string key, string value)
         {
-            m_key = key;
-            m_value = value;
+            Key = key;
+            Value = value;
         }
 
-        public string Key
-        {
-            get { return m_key; }
-        }
+        public string Key { get; }
 
-        public string Value
-        {
-            get { return m_value; }
-        }
+        public string Value { get; }
     }
 
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)]
     public sealed class AssemblySignatureKeyAttribute : Attribute
     {
-        private String _publicKey;
-        private String _countersignature;
-
-        public AssemblySignatureKeyAttribute(String publicKey, String countersignature)
+        public AssemblySignatureKeyAttribute(string publicKey, string countersignature)
         {
-            _publicKey = publicKey;
-            _countersignature = countersignature;
+            PublicKey = publicKey;
+            Countersignature = countersignature;
         }
 
-        public String PublicKey
-        {
-            get { return _publicKey; }
-        }
+        public string PublicKey { get; }
 
-        public String Countersignature
-        {
-            get { return _countersignature; }
-        }
+        public string Countersignature { get; }
     }
 
     [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]
     public sealed class AssemblyKeyNameAttribute : Attribute
     {
-        private String m_keyName;
-
-        public AssemblyKeyNameAttribute(String keyName)
+        public AssemblyKeyNameAttribute(string keyName)
         {
-            m_keyName = keyName;
+            KeyName = keyName;
         }
 
-        public String KeyName
-        {
-            get { return m_keyName; }
-        }
+        public string KeyName { get; }
     }
 }
 
diff --git a/src/mscorlib/src/System/Reflection/AssemblyContentType.cs b/src/mscorlib/src/System/Reflection/AssemblyContentType.cs
new file mode 100644 (file)
index 0000000..2ee1a00
--- /dev/null
@@ -0,0 +1,13 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Reflection
+{
+    public enum AssemblyContentType
+    {
+        Default = 0,
+        WindowsRuntime = 1,
+    }
+}
+
index dd4fc4b..d321032 100644 (file)
@@ -2,25 +2,9 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-/*============================================================
-**
-** 
-** 
-** 
-**
-**
-** Purpose: Flags controlling how an AssemblyName is used
-**          during binding
-**
-**
-===========================================================*/
-
-using System;
-
 namespace System.Reflection
 {
-    [Serializable]
-    [FlagsAttribute()]
+    [Flags]
     public enum AssemblyNameFlags
     {
         None = 0x0000,
@@ -34,22 +18,4 @@ namespace System.Reflection
         Retargetable = 0x0100,
         //ContentType             = 0x0E00, // Bits describing the ContentType are accessible via AssemblyName.ContentType
     }
-
-    [Serializable]
-    public enum AssemblyContentType
-    {
-        Default = 0x0000,
-        WindowsRuntime = 0x0001
-    }
-
-    [Serializable]
-    public enum ProcessorArchitecture
-    {
-        None = 0x0000,
-        MSIL = 0x0001,
-        X86 = 0x0002,
-        IA64 = 0x0003,
-        Amd64 = 0x0004,
-        Arm = 0x0005
-    }
 }
index 002e9e1..3dc5665 100644 (file)
@@ -2,50 +2,18 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-//
-// 
-// This interface defines a set of methods which interact with reflection
-//    during the binding process.  This control allows systems to apply language
-//    specific semantics to the binding and invocation process.
-//
-//
+using System.Globalization;
 
 namespace System.Reflection
 {
-    using System;
-    using System.Runtime.InteropServices;
-    using CultureInfo = System.Globalization.CultureInfo;
-
-    [Serializable]
     public abstract class Binder
     {
-        // Given a set of methods that match the basic criteria, select a method to
-        // invoke.  When this method is finished, we should have 
-        public abstract MethodBase BindToMethod(BindingFlags bindingAttr, MethodBase[] match, ref Object[] args,
-            ParameterModifier[] modifiers, CultureInfo culture, String[] names, out Object state);
-
-        // Given a set of methods that match the basic criteria, select a method to
-        // invoke.  When this method is finished, we should have 
-        public abstract FieldInfo BindToField(BindingFlags bindingAttr, FieldInfo[] match,
-            Object value, CultureInfo culture);
-
-        // Given a set of methods that match the base criteria, select a method based
-        // upon an array of types.  This method should return null if no method matchs
-        // the criteria.
-        public abstract MethodBase SelectMethod(BindingFlags bindingAttr, MethodBase[] match,
-            Type[] types, ParameterModifier[] modifiers);
-
-
-        // Given a set of propreties that match the base criteria, select one.
-        public abstract PropertyInfo SelectProperty(BindingFlags bindingAttr, PropertyInfo[] match,
-            Type returnType, Type[] indexes, ParameterModifier[] modifiers);
-
-        // ChangeType
-        // This method will convert the value into the property type.
-        //    It throws a cast exception if this fails.
-        public abstract Object ChangeType(Object value, Type type, CultureInfo culture);
-
-        public abstract void ReorderArgumentArray(ref Object[] args, Object state);
+        protected Binder() { }
+        public abstract FieldInfo BindToField(BindingFlags bindingAttr, FieldInfo[] match, object value, CultureInfo culture);
+        public abstract MethodBase BindToMethod(BindingFlags bindingAttr, MethodBase[] match, ref object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] names, out object state);
+        public abstract object ChangeType(object value, Type type, CultureInfo culture);
+        public abstract void ReorderArgumentArray(ref object[] args, object state);
+        public abstract MethodBase SelectMethod(BindingFlags bindingAttr, MethodBase[] match, Type[] types, ParameterModifier[] modifiers);
+        public abstract PropertyInfo SelectProperty(BindingFlags bindingAttr, PropertyInfo[] match, Type returnType, Type[] indexes, ParameterModifier[] modifiers);
     }
 }
index 45f7f66..26c875d 100644 (file)
@@ -2,22 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// BindingFlags are a set of flags that control the binding and invocation process
-// 
-//    in Reflection.  There are two processes.  The first is selection of a Member which
-//    is the binding phase.  The second, is invocation.  These flags control how this
-//    process works.
-//
-//
-
-using System;
-
 namespace System.Reflection
 {
-    [Serializable]
     [Flags]
     public enum BindingFlags
     {
@@ -28,13 +14,13 @@ namespace System.Reflection
         Default = 0x00,
 
         // These flags indicate what to search for when binding
-        IgnoreCase = 0x01,        // Ignore the case of Names while searching
+        IgnoreCase = 0x01,          // Ignore the case of Names while searching
         DeclaredOnly = 0x02,        // Only look at the members declared on the Type
-        Instance = 0x04,        // Include Instance members in search
-        Static = 0x08,        // Include Static members in search
-        Public = 0x10,        // Include Public members in search
-        NonPublic = 0x20,        // Include Non-Public members in search
-        FlattenHierarchy = 0x40,        // Rollup the statics into the class.
+        Instance = 0x04,            // Include Instance members in search
+        Static = 0x08,              // Include Static members in search
+        Public = 0x10,              // Include Public members in search
+        NonPublic = 0x20,           // Include Non-Public members in search
+        FlattenHierarchy = 0x40,    // Rollup the statics into the class.
 
         // These flags are used by InvokeMember to determine
         // what type of member we are trying to Invoke.
@@ -51,7 +37,7 @@ namespace System.Reflection
         PutDispProperty = 0x4000,
         PutRefDispProperty = 0x8000,
 
-        ExactBinding = 0x010000,        // Bind with Exact Type matching, No Change type
+        ExactBinding = 0x010000,    // Bind with Exact Type matching, No Change type
         SuppressChangeType = 0x020000,
 
         // DefaultValueBinding will return the set of methods having ArgCount or 
@@ -59,6 +45,6 @@ namespace System.Reflection
         OptionalParamBinding = 0x040000,
 
         // These are a couple of misc attributes used
-        IgnoreReturn = 0x01000000,    // This is used in COM Interop
+        IgnoreReturn = 0x01000000,  // This is used in COM Interop
     }
 }
index 2fbf2f3..bb6d6cd 100644 (file)
@@ -2,21 +2,10 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// CallingConventions is a set of Bits representing the calling conventions
-// 
-//    in the system.
-//
-//
-
-using System.Runtime.InteropServices;
-using System;
+// CallingConventions is a set of Bits representing the calling conventions in the system.
 
 namespace System.Reflection
 {
-    [Serializable]
     [Flags]
     public enum CallingConventions
     {
index 7f88e0c..47752af 100644 (file)
@@ -2,41 +2,29 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// CustomAttributeFormatException is thrown when the binary format of a 
-// 
-//    custom attribute is invalid.
-//
-//
+using System.Runtime.Serialization;
 
 namespace System.Reflection
 {
-    using System;
-    using ApplicationException = System.ApplicationException;
-    using System.Runtime.Serialization;
     [Serializable]
     public class CustomAttributeFormatException : FormatException
     {
         public CustomAttributeFormatException()
-            : base(SR.Arg_CustomAttributeFormatException)
+            : this(SR.Arg_CustomAttributeFormatException)
         {
-            SetErrorCode(__HResults.COR_E_CUSTOMATTRIBUTEFORMAT);
         }
 
-        public CustomAttributeFormatException(String message) : base(message)
+        public CustomAttributeFormatException(string message)
+            : this(message, null)
         {
-            SetErrorCode(__HResults.COR_E_CUSTOMATTRIBUTEFORMAT);
         }
 
-        public CustomAttributeFormatException(String message, Exception inner) : base(message, inner)
+        public CustomAttributeFormatException(string message, Exception inner)
+            : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_CUSTOMATTRIBUTEFORMAT);
+            HResult = __HResults.COR_E_CUSTOMATTRIBUTEFORMAT;
         }
 
-        protected CustomAttributeFormatException(SerializationInfo info, StreamingContext context) : base(info, context)
-        {
-        }
+        protected CustomAttributeFormatException(SerializationInfo info, StreamingContext context) : base(info, context) { }
     }
 }
index 3a0fdbf..3511433 100644 (file)
@@ -2,41 +2,21 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// DefaultMemberAttribute is defines the Member of a Type that is the "default"
-// 
-//    member used by Type.InvokeMember.  The default member is simply a name given
-//    to a type.
-//
-// 
-// 
-//
-
-using System;
-
 namespace System.Reflection
 {
     [Serializable]
     [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface)]
     public sealed class DefaultMemberAttribute : Attribute
     {
-        // The name of the member
-        private String m_memberName;
-
         // You must provide the name of the member, this is required
-        public DefaultMemberAttribute(String memberName)
+        public DefaultMemberAttribute(string memberName)
         {
-            m_memberName = memberName;
+            MemberName = memberName;
         }
 
         // A get accessor to return the name from the attribute.
         // NOTE: There is no setter because the name must be provided
         //    to the constructor.  The name is not optional.
-        public String MemberName
-        {
-            get { return m_memberName; }
-        }
+        public string MemberName { get; }
     }
 }
index fcf1478..fbc2972 100644 (file)
@@ -2,21 +2,11 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// EventAttributes are an enum defining the attributes associated with
-// 
-//    and Event.  These are defined in CorHdr.h and are a combination of
-//    bits and enums.
-//
-//
-
-using System;
+// EventAttributes are an enum defining the attributes associated with and Event.
+// These are defined in CorHdr.h and are a combination of bits and enums.
 
 namespace System.Reflection
 {
-    [Serializable]
     [Flags]
     public enum EventAttributes
     {
@@ -25,8 +15,8 @@ namespace System.Reflection
         // This Enum matchs the CorEventAttr defined in CorHdr.h
         SpecialName = 0x0200,     // event is special.  Name describes how.
 
-        // Reserved flags for Runtime use only.
-        ReservedMask = 0x0400,
         RTSpecialName = 0x0400,     // Runtime(metadata internal APIs) should check name encoding.
+
+        ReservedMask = 0x0400,
     }
 }
diff --git a/src/mscorlib/src/System/Reflection/ExceptionHandlingClause.cs b/src/mscorlib/src/System/Reflection/ExceptionHandlingClause.cs
new file mode 100644 (file)
index 0000000..9bb45ae
--- /dev/null
@@ -0,0 +1,93 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Globalization;
+using System.Diagnostics.Contracts;
+
+namespace System.Reflection
+{
+    public class ExceptionHandlingClause
+    {
+        #region costructor
+        // This class can only be created from inside the EE.
+        protected ExceptionHandlingClause() { }
+        #endregion
+
+        #region Private Data Members
+        private MethodBody m_methodBody;
+        [ContractPublicPropertyName("Flags")]
+        private ExceptionHandlingClauseOptions m_flags;
+        private int m_tryOffset;
+        private int m_tryLength;
+        private int m_handlerOffset;
+        private int m_handlerLength;
+        private int m_catchMetadataToken;
+        private int m_filterOffset;
+        #endregion
+
+        #region Public Members
+        public virtual ExceptionHandlingClauseOptions Flags { get { return m_flags; } }
+        public virtual int TryOffset { get { return m_tryOffset; } }
+        public virtual int TryLength { get { return m_tryLength; } }
+        public virtual int HandlerOffset { get { return m_handlerOffset; } }
+        public virtual int HandlerLength { get { return m_handlerLength; } }
+
+        public virtual int FilterOffset
+        {
+            get
+            {
+                if (m_flags != ExceptionHandlingClauseOptions.Filter)
+                    throw new InvalidOperationException(SR.Arg_EHClauseNotFilter);
+
+                return m_filterOffset;
+            }
+        }
+
+        public virtual Type CatchType
+        {
+            get
+            {
+                if (m_flags != ExceptionHandlingClauseOptions.Clause)
+                    throw new InvalidOperationException(SR.Arg_EHClauseNotClause);
+
+                Type type = null;
+
+                if (!MetadataToken.IsNullToken(m_catchMetadataToken))
+                {
+                    Type declaringType = m_methodBody.m_methodBase.DeclaringType;
+                    Module module = (declaringType == null) ? m_methodBody.m_methodBase.Module : declaringType.Module;
+                    type = module.ResolveType(m_catchMetadataToken, (declaringType == null) ? null : declaringType.GetGenericArguments(),
+                        m_methodBody.m_methodBase is MethodInfo ? m_methodBody.m_methodBase.GetGenericArguments() : null);
+                }
+
+                return type;
+            }
+        }
+        #endregion
+
+        #region Object Overrides
+        public override string ToString()
+        {
+            if (Flags == ExceptionHandlingClauseOptions.Clause)
+            {
+                return String.Format(CultureInfo.CurrentUICulture,
+                    "Flags={0}, TryOffset={1}, TryLength={2}, HandlerOffset={3}, HandlerLength={4}, CatchType={5}",
+                    Flags, TryOffset, TryLength, HandlerOffset, HandlerLength, CatchType);
+            }
+
+            if (Flags == ExceptionHandlingClauseOptions.Filter)
+            {
+                return String.Format(CultureInfo.CurrentUICulture,
+                    "Flags={0}, TryOffset={1}, TryLength={2}, HandlerOffset={3}, HandlerLength={4}, FilterOffset={5}",
+                    Flags, TryOffset, TryLength, HandlerOffset, HandlerLength, FilterOffset);
+            }
+
+            return String.Format(CultureInfo.CurrentUICulture,
+                "Flags={0}, TryOffset={1}, TryLength={2}, HandlerOffset={3}, HandlerLength={4}",
+                Flags, TryOffset, TryLength, HandlerOffset, HandlerLength);
+        }
+        #endregion
+    }
+}
+
diff --git a/src/mscorlib/src/System/Reflection/ExceptionHandlingClauseOptions.cs b/src/mscorlib/src/System/Reflection/ExceptionHandlingClauseOptions.cs
new file mode 100644 (file)
index 0000000..22c141b
--- /dev/null
@@ -0,0 +1,16 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Reflection
+{
+    [Flags()]
+    public enum ExceptionHandlingClauseOptions : int
+    {
+        Clause = 0x0,
+        Filter = 0x1,
+        Finally = 0x2,
+        Fault = 0x4,
+    }
+}
+
index 02bfbec..048d0e7 100644 (file)
@@ -2,13 +2,10 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-using System;
-
 namespace System.Reflection
 {
     // This Enum matchs the CorFieldAttr defined in CorHdr.h
-    [Serializable]
-    [Flags()]
+    [Flags]
     public enum FieldAttributes
     {
         // member access mask - Use this mask to retrieve accessibility information.
@@ -33,11 +30,11 @@ namespace System.Reflection
         // interop attributes
         PinvokeImpl = 0x2000,        // Implementation is forwarded through pinvoke.
 
-        // Reserved flags for runtime use only.
-        ReservedMask = 0x9500,
         RTSpecialName = 0x0400,     // Runtime(metadata internal APIs) should check name encoding.
         HasFieldMarshal = 0x1000,     // Field has marshalling information.
         HasDefault = 0x8000,     // Field has default.
         HasFieldRVA = 0x0100,     // Field has RVA.
+
+        ReservedMask = 0x9500,
     }
 }
index 0dfc4b6..4b579d2 100644 (file)
@@ -2,11 +2,9 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-// 
-
 namespace System.Reflection
 {
-    [Flags()]
+    [Flags]
     public enum GenericParameterAttributes
     {
         None = 0x0000,
index 1e3f675..3cae295 100644 (file)
@@ -2,31 +2,12 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// ICustomAttributeProvider is an interface that is implemented by reflection
-// 
-//    objects which support custom attributes.
-//
-//
-
-using System;
-
 namespace System.Reflection
 {
-    // Interface does not need to be marked with the serializable attribute
     public interface ICustomAttributeProvider
     {
-        // Return an array of custom attributes identified by Type
-        Object[] GetCustomAttributes(Type attributeType, bool inherit);
-
-
-        // Return an array of all of the custom attributes (named attributes are not included)
-        Object[] GetCustomAttributes(bool inherit);
-
-
-        // Returns true if one or more instance of attributeType is defined on this member. 
+        object[] GetCustomAttributes(bool inherit);
+        object[] GetCustomAttributes(Type attributeType, bool inherit);
         bool IsDefined(Type attributeType, bool inherit);
     }
-}
+}
\ No newline at end of file
index 72b1b87..5e2c0ed 100644 (file)
@@ -2,17 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// IReflectableType is an interface that is implemented by a Type produced 
-// by a ReflectionContext
-// 
-
-//
-
-using System;
-
 namespace System.Reflection
 {
     public interface IReflectableType
@@ -20,3 +9,4 @@ namespace System.Reflection
         TypeInfo GetTypeInfo();
     }
 }
+
index 5e3deac..230bc95 100644 (file)
@@ -4,7 +4,6 @@
 
 namespace System.Reflection
 {
-    [Serializable]
     public enum ImageFileMachine
     {
         I386 = 0x014c,
@@ -13,3 +12,4 @@ namespace System.Reflection
         ARM = 0x01c4,
     }
 }
+
index a1fdbde..2e0c0d8 100644 (file)
@@ -2,24 +2,13 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// 
-// Interface Map.  This struct returns the mapping of an interface into the actual methods on a class
-//    that implement that interface.
-//
-//
-
-using System;
-
 namespace System.Reflection
 {
     public struct InterfaceMapping
     {
-        public Type TargetType;            // The type implementing the interface
-        public Type InterfaceType;        // The type representing the interface
-        public MethodInfo[] TargetMethods;        // The methods implementing the interface
-        public MethodInfo[] InterfaceMethods;    // The methods defined on the interface
+        public Type TargetType;               // The type implementing the interface
+        public Type InterfaceType;            // The type representing the interface
+        public MethodInfo[] TargetMethods;    // The methods implementing the interface
+        public MethodInfo[] InterfaceMethods; // The methods defined on the interface
     }
 }
index 79316bc..3329360 100644 (file)
@@ -2,16 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-/*=============================================================================
-**
-**
-** 
-**
-**
-** Purpose: Get the underlying TypeInfo from a Type
-**
-**
-=============================================================================*/
+using System.Diagnostics;
 
 namespace System.Reflection
 {
@@ -19,11 +10,19 @@ namespace System.Reflection
     {
         public static TypeInfo GetTypeInfo(this Type type)
         {
+            IReflectableType reflectableType = type as IReflectableType;
+            if (reflectableType != null)
+                return reflectableType.GetTypeInfo();
+
             if (type == null)
                 throw new ArgumentNullException(nameof(type));
 
-            var rcType = (IReflectableType)type;
-            return rcType.GetTypeInfo();
+            // This is bizarre but compatible with the desktop which casts "type" to IReflectableType without checking and
+            // thus, throws an InvalidCastException.
+            object ignore = (IReflectableType)type;
+            Debug.Fail("Did not expect to get here.");
+            throw new InvalidOperationException();
         }
     }
 }
+
index dc1d19b..19738ec 100644 (file)
@@ -2,43 +2,29 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// InvalidFilterCriteriaException is thrown in FindMembers when the
-// 
-//    filter criteria is not valid for the type of filter being used. 
-//
-// 
-//  
-//
+using System.Runtime.Serialization;
 
 namespace System.Reflection
 {
-    using System;
-    using System.Runtime.Serialization;
-    using ApplicationException = System.ApplicationException;
     [Serializable]
     public class InvalidFilterCriteriaException : ApplicationException
     {
         public InvalidFilterCriteriaException()
-            : base(SR.Arg_InvalidFilterCriteriaException)
+            : this(SR.Arg_InvalidFilterCriteriaException)
         {
-            SetErrorCode(__HResults.COR_E_INVALIDFILTERCRITERIA);
         }
 
-        public InvalidFilterCriteriaException(String message) : base(message)
+        public InvalidFilterCriteriaException(string message)
+            : this(message, null)
         {
-            SetErrorCode(__HResults.COR_E_INVALIDFILTERCRITERIA);
         }
 
-        public InvalidFilterCriteriaException(String message, Exception inner) : base(message, inner)
+        public InvalidFilterCriteriaException(string message, Exception inner)
+            : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_INVALIDFILTERCRITERIA);
+            HResult = __HResults.COR_E_INVALIDFILTERCRITERIA;
         }
 
-        protected InvalidFilterCriteriaException(SerializationInfo info, StreamingContext context) : base(info, context)
-        {
-        }
+        protected InvalidFilterCriteriaException(SerializationInfo info, StreamingContext context) : base(info, context) { }
     }
 }
diff --git a/src/mscorlib/src/System/Reflection/LocalVariableInfo.cs b/src/mscorlib/src/System/Reflection/LocalVariableInfo.cs
new file mode 100644 (file)
index 0000000..41d7477
--- /dev/null
@@ -0,0 +1,38 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Reflection
+{
+    public class LocalVariableInfo
+    {
+        #region Private Data Members
+        private RuntimeType m_type;
+        private int m_isPinned;
+        private int m_localIndex;
+        #endregion
+
+        #region Constructor
+        protected LocalVariableInfo() { }
+        #endregion
+
+        #region Object Overrides
+        public override string ToString()
+        {
+            string toString = LocalType.ToString() + " (" + LocalIndex + ")";
+
+            if (IsPinned)
+                toString += " (pinned)";
+
+            return toString;
+        }
+        #endregion
+
+        #region Public Members
+        public virtual Type LocalType { get { Debug.Assert(m_type != null, "type must be set!"); return m_type; } }
+        public virtual bool IsPinned { get { return m_isPinned != 0; } }
+        public virtual int LocalIndex { get { return m_localIndex; } }
+        #endregion
+    }
+}
+
index 792d054..b9c56ab 100644 (file)
@@ -2,69 +2,22 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-/*=============================================================================
-**
-** 
-** 
-**
-**
-** Purpose: For info regarding a manifest resource's topology.
-**
-**
-=============================================================================*/
-
-using System;
-
 namespace System.Reflection
 {
     public class ManifestResourceInfo
     {
-        private Assembly _containingAssembly;
-        private String _containingFileName;
-        private ResourceLocation _resourceLocation;
-
         public ManifestResourceInfo(Assembly containingAssembly,
-                                      String containingFileName,
+                                      string containingFileName,
                                       ResourceLocation resourceLocation)
         {
-            _containingAssembly = containingAssembly;
-            _containingFileName = containingFileName;
-            _resourceLocation = resourceLocation;
-        }
-
-        public virtual Assembly ReferencedAssembly
-        {
-            get
-            {
-                return _containingAssembly;
-            }
+            ReferencedAssembly = containingAssembly;
+            FileName = containingFileName;
+            ResourceLocation = resourceLocation;
         }
 
-        public virtual String FileName
-        {
-            get
-            {
-                return _containingFileName;
-            }
-        }
-
-        public virtual ResourceLocation ResourceLocation
-        {
-            get
-            {
-                return _resourceLocation;
-            }
-        }
-    }
-
-    // The ResourceLocation is a combination of these flags, set or not.
-    // Linked means not Embedded.
-    [Serializable]
-    [Flags]
-    public enum ResourceLocation
-    {
-        Embedded = 0x1,
-        ContainedInAnotherAssembly = 0x2,
-        ContainedInManifestFile = 0x4
+        public virtual Assembly ReferencedAssembly { get; }
+        public virtual string FileName { get; }
+        public virtual ResourceLocation ResourceLocation { get; }
     }
 }
+
index 707ce9b..bb1b157 100644 (file)
@@ -2,18 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// MemberFilter is a delegate used to filter Members.  This delegate is used
-// 
-//    as a callback from Type.FindMembers.
-//
-//
-
 namespace System.Reflection
 {
-    // Define the delegate
-    [Serializable]
-    public delegate bool MemberFilter(MemberInfo m, Object filterCriteria);
-}
+    public delegate bool MemberFilter(MemberInfo m, object filterCriteria);
+}
\ No newline at end of file
index aac59ec..57072dc 100644 (file)
@@ -2,26 +2,11 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// MemberTypes is an bit mask marking each type of Member that is defined as
-// 
-//    a subclass of MemberInfo.  These are returned by MemberInfo.MemberType and 
-//    are useful in switch statements.
-//
-//
-
-using System;
-
 namespace System.Reflection
 {
-    // This Enum matchs the CorTypeAttr defined in CorHdr.h
-    [Serializable]
-    [Flags()]
+    [Flags]
     public enum MemberTypes
     {
-        // The following are the known classes which extend MemberInfo
         Constructor = 0x01,
         Event = 0x02,
         Field = 0x04,
@@ -32,4 +17,4 @@ namespace System.Reflection
         NestedType = 0x80,
         All = Constructor | Event | Field | Method | Property | TypeInfo | NestedType,
     }
-}
+}
\ No newline at end of file
index 38b35ff..1a7c7bf 100644 (file)
@@ -2,14 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-// 
-
-using System;
-
 namespace System.Reflection
 {
-    [Serializable]
     [Flags]
     public enum MethodAttributes
     {
@@ -48,9 +42,9 @@ namespace System.Reflection
         UnmanagedExport = 0x0008,     // Managed method exported via thunk to unmanaged code.
         RTSpecialName = 0x1000,     // Runtime should check name encoding.
 
-        // Reserved flags for runtime use only.
-        ReservedMask = 0xd000,
         HasSecurity = 0x4000,     // Method has security associate with it.
         RequireSecObject = 0x8000,     // Method calls another method containing security code.
+
+        ReservedMask = 0xd000,
     }
 }
index 275e4f8..4335177 100644 (file)
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-// 
-
-using System;
-using System.Globalization;
 using System.Collections.Generic;
-using System.Diagnostics;
-using System.Diagnostics.Contracts;
 
 namespace System.Reflection
 {
-    [Flags()]
-    public enum ExceptionHandlingClauseOptions : int
-    {
-        Clause = 0x0,
-        Filter = 0x1,
-        Finally = 0x2,
-        Fault = 0x4,
-    }
-
-    public class ExceptionHandlingClause
-    {
-        #region costructor
-        // This class can only be created from inside the EE.
-        protected ExceptionHandlingClause() { }
-        #endregion
-
-        #region Private Data Members
-        private MethodBody m_methodBody;
-        [ContractPublicPropertyName("Flags")]
-        private ExceptionHandlingClauseOptions m_flags;
-        private int m_tryOffset;
-        private int m_tryLength;
-        private int m_handlerOffset;
-        private int m_handlerLength;
-        private int m_catchMetadataToken;
-        private int m_filterOffset;
-        #endregion
-
-        #region Public Members
-        public virtual ExceptionHandlingClauseOptions Flags { get { return m_flags; } }
-        public virtual int TryOffset { get { return m_tryOffset; } }
-        public virtual int TryLength { get { return m_tryLength; } }
-        public virtual int HandlerOffset { get { return m_handlerOffset; } }
-        public virtual int HandlerLength { get { return m_handlerLength; } }
-
-        public virtual int FilterOffset
-        {
-            get
-            {
-                if (m_flags != ExceptionHandlingClauseOptions.Filter)
-                    throw new InvalidOperationException(SR.Arg_EHClauseNotFilter);
-
-                return m_filterOffset;
-            }
-        }
-
-        public virtual Type CatchType
-        {
-            get
-            {
-                if (m_flags != ExceptionHandlingClauseOptions.Clause)
-                    throw new InvalidOperationException(SR.Arg_EHClauseNotClause);
-
-                Type type = null;
-
-                if (!MetadataToken.IsNullToken(m_catchMetadataToken))
-                {
-                    Type declaringType = m_methodBody.m_methodBase.DeclaringType;
-                    Module module = (declaringType == null) ? m_methodBody.m_methodBase.Module : declaringType.Module;
-                    type = module.ResolveType(m_catchMetadataToken, (declaringType == null) ? null : declaringType.GetGenericArguments(),
-                        m_methodBody.m_methodBase is MethodInfo ? m_methodBody.m_methodBase.GetGenericArguments() : null);
-                }
-
-                return type;
-            }
-        }
-        #endregion
-
-        #region Object Overrides
-        public override string ToString()
-        {
-            if (Flags == ExceptionHandlingClauseOptions.Clause)
-            {
-                return String.Format(CultureInfo.CurrentUICulture,
-                    "Flags={0}, TryOffset={1}, TryLength={2}, HandlerOffset={3}, HandlerLength={4}, CatchType={5}",
-                    Flags, TryOffset, TryLength, HandlerOffset, HandlerLength, CatchType);
-            }
-
-            if (Flags == ExceptionHandlingClauseOptions.Filter)
-            {
-                return String.Format(CultureInfo.CurrentUICulture,
-                    "Flags={0}, TryOffset={1}, TryLength={2}, HandlerOffset={3}, HandlerLength={4}, FilterOffset={5}",
-                    Flags, TryOffset, TryLength, HandlerOffset, HandlerLength, FilterOffset);
-            }
-
-            return String.Format(CultureInfo.CurrentUICulture,
-                "Flags={0}, TryOffset={1}, TryLength={2}, HandlerOffset={3}, HandlerLength={4}",
-                Flags, TryOffset, TryLength, HandlerOffset, HandlerLength);
-        }
-        #endregion
-    }
-
     public class MethodBody
     {
         #region costructor
@@ -130,36 +32,5 @@ namespace System.Reflection
         public virtual IList<ExceptionHandlingClause> ExceptionHandlingClauses { get { return Array.AsReadOnly(m_exceptionHandlingClauses); } }
         #endregion
     }
-
-    public class LocalVariableInfo
-    {
-        #region Private Data Members
-        private RuntimeType m_type;
-        private int m_isPinned;
-        private int m_localIndex;
-        #endregion
-
-        #region Constructor
-        protected LocalVariableInfo() { }
-        #endregion
-
-        #region Object Overrides
-        public override string ToString()
-        {
-            string toString = LocalType.ToString() + " (" + LocalIndex + ")";
-
-            if (IsPinned)
-                toString += " (pinned)";
-
-            return toString;
-        }
-        #endregion
-
-        #region Public Members
-        public virtual Type LocalType { get { Debug.Assert(m_type != null, "type must be set!"); return m_type; } }
-        public virtual bool IsPinned { get { return m_isPinned != 0; } }
-        public virtual int LocalIndex { get { return m_localIndex; } }
-        #endregion
-    }
 }
 
index a227357..0a67e2c 100644 (file)
@@ -2,15 +2,9 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-// 
-
-
-using System;
-
 namespace System.Reflection
 {
     // This Enum matchs the CorMethodImpl defined in CorHdr.h
-    [Serializable]
     public enum MethodImplAttributes
     {
         // code impl mask
@@ -39,6 +33,6 @@ namespace System.Reflection
         AggressiveInlining = 0x0100,   // Method should be inlined if possible.
         NoOptimization = 0x0040,   // Method may not be optimized.
 
-        MaxMethodImplVal = 0xFFFF,   // Range check value
+        MaxMethodImplVal = 0xffff,
     }
 }
index 1a8a641..fa32d43 100644 (file)
@@ -2,34 +2,23 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-// 
-
-using System;
-using System.Runtime.Remoting;
 using System.Runtime.Serialization;
-using System.Diagnostics.Contracts;
 
 namespace System.Reflection
 {
-    // This is not serializable because it is a reflection command.
     [Serializable]
     public sealed class Missing : ISerializable
     {
         public static readonly Missing Value = new Missing();
 
-        #region Constructor
         private Missing() { }
-        #endregion
 
-        #region ISerializable
         void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
         {
             if (info == null)
                 throw new ArgumentNullException(nameof(info));
-            Contract.EndContractBlock();
 
             UnitySerializationHolder.GetUnitySerializationInfo(info, this);
         }
-        #endregion
     }
 }
index 31cc799..eb8926b 100644 (file)
@@ -4,6 +4,6 @@
 
 namespace System.Reflection
 {
-    [Serializable]
-    public delegate Module ModuleResolveEventHandler(Object sender, ResolveEventArgs e);
+    public delegate Module ModuleResolveEventHandler(object sender, ResolveEventArgs e);
 }
+
index e4f3476..ce19589 100644 (file)
@@ -2,21 +2,12 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
 // ParameterAttributes is an enum defining the attributes that may be 
-// 
-//    associated with a Parameter.  These are defined in CorHdr.h.
-//
-//
-
-using System;
+// associated with a Parameter.  These are defined in CorHdr.h.
 
 namespace System.Reflection
 {
     // This Enum matchs the CorParamAttr defined in CorHdr.h
-    [Serializable]
     [Flags]
     public enum ParameterAttributes
     {
@@ -24,14 +15,15 @@ namespace System.Reflection
         In = 0x0001,     // Param is [In]    
         Out = 0x0002,     // Param is [Out]   
         Lcid = 0x0004,     // Param is [lcid]  
-        Retval = 0x0008,     // Param is [Retval]    
+
+        Retval = 0x0008,     // Param is [Retval]
         Optional = 0x0010,     // Param is optional 
 
-        // Reserved flags for Runtime use only.
-        ReservedMask = 0xf000,
         HasDefault = 0x1000,     // Param has default value.
         HasFieldMarshal = 0x2000,     // Param has FieldMarshal.
-        Reserved3 = 0x4000,     // reserved bit
-        Reserved4 = 0x8000      // reserved bit 
+
+        Reserved3 = 0x4000,
+        Reserved4 = 0x8000,
+        ReservedMask = 0xf000,
     }
 }
index 70abf75..cdd25da 100644 (file)
@@ -2,45 +2,31 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-using System.Diagnostics.Contracts;
-using System;
-
 namespace System.Reflection
 {
     [Serializable]
     public struct ParameterModifier
     {
-        #region Private Data Members
-        private bool[] _byRef;
-        #endregion
-
-        #region Constructor
         public ParameterModifier(int parameterCount)
         {
             if (parameterCount <= 0)
                 throw new ArgumentException(SR.Arg_ParmArraySize);
-            Contract.EndContractBlock();
 
-            _byRef = new bool[parameterCount];
+            IsByRefArray = new bool[parameterCount];
         }
-        #endregion
 
-        #region Internal Members
-        internal bool[] IsByRefArray { get { return _byRef; } }
-        #endregion
-
-        #region Public Members
         public bool this[int index]
         {
             get
             {
-                return _byRef[index];
+                return IsByRefArray[index];
             }
             set
             {
-                _byRef[index] = value;
+                IsByRefArray[index] = value;
             }
         }
-        #endregion
+
+        internal bool[] IsByRefArray { get; }
     }
 }
index 4c38c02..79be338 100644 (file)
@@ -5,7 +5,6 @@
 namespace System.Reflection
 {
     [Flags]
-    [Serializable]
     public enum PortableExecutableKinds
     {
         NotAPortableExecutableImage = 0x0,
@@ -16,3 +15,4 @@ namespace System.Reflection
         Preferred32Bit = 0x10,
     }
 }
+
diff --git a/src/mscorlib/src/System/Reflection/ProcessorArchitecture.cs b/src/mscorlib/src/System/Reflection/ProcessorArchitecture.cs
new file mode 100644 (file)
index 0000000..becb346
--- /dev/null
@@ -0,0 +1,16 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Reflection
+{
+    public enum ProcessorArchitecture
+    {
+        None = 0x0000,
+        MSIL = 0x0001,
+        X86 = 0x0002,
+        IA64 = 0x0003,
+        Amd64 = 0x0004,
+        Arm = 0x0005
+    }
+}
index 188bc0e..31e7a65 100644 (file)
@@ -2,33 +2,24 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
 // PropertyAttributes is an enum which defines the attributes that may be associated
-// 
-//    with a property.  The values here are defined in Corhdr.h.
-//
-//
-
-using System;
+// with a property.  The values here are defined in Corhdr.h.
 
 namespace System.Reflection
 {
     // This Enum matchs the CorPropertyAttr defined in CorHdr.h
-    [Serializable]
     [Flags]
     public enum PropertyAttributes
     {
         None = 0x0000,
         SpecialName = 0x0200,     // property is special.  Name describes how.
 
-        // Reserved flags for Runtime use only.
-        ReservedMask = 0xf400,
         RTSpecialName = 0x0400,     // Runtime(metadata internal APIs) should check name encoding.
         HasDefault = 0x1000,     // Property has default 
-        Reserved2 = 0x2000,     // reserved bit
-        Reserved3 = 0x4000,     // reserved bit 
-        Reserved4 = 0x8000      // reserved bit 
+
+        Reserved2 = 0x2000,
+        Reserved3 = 0x4000,
+        Reserved4 = 0x8000,
+        ReservedMask = 0xf400,
     }
 }
index e11480d..e9e93da 100644 (file)
@@ -2,19 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-/*=============================================================================
-**
-**
-** 
-**
-**
-** Purpose: For Assembly-related stuff.
-**
-**
-=============================================================================*/
-
-using System;
-
 namespace System.Reflection
 {
     public abstract class ReflectionContext
@@ -34,3 +21,4 @@ namespace System.Reflection
         }
     }
 }
+
index 4dca8de..4bfd985 100644 (file)
@@ -2,79 +2,42 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// ReflectionTypeLoadException is thrown when multiple TypeLoadExceptions may occur.  
-// 
-//  Specifically, when you call Module.GetTypes() this causes multiple class loads to occur.
-//  If there are failures, we continue to load classes and build an array of the successfully
-//  loaded classes.  We also build an array of the errors that occur.  Then we throw this exception
-//  which exposes both the array of classes and the array of TypeLoadExceptions. 
-//
-// 
-// 
-//
-
-using System;
 using System.Runtime.Serialization;
-using System.Diagnostics.Contracts;
 
 namespace System.Reflection
 {
     [Serializable]
     public sealed class ReflectionTypeLoadException : SystemException, ISerializable
     {
-        private Type[] _classes;
-        private Exception[] _exceptions;
-
-        // private constructor.  This is not called.
-        private ReflectionTypeLoadException()
-            : base(SR.ReflectionTypeLoad_LoadFailed)
-        {
-            SetErrorCode(__HResults.COR_E_REFLECTIONTYPELOAD);
-        }
-
         public ReflectionTypeLoadException(Type[] classes, Exception[] exceptions) : base(null)
         {
-            _classes = classes;
-            _exceptions = exceptions;
-            SetErrorCode(__HResults.COR_E_REFLECTIONTYPELOAD);
+            Types = classes;
+            LoaderExceptions = exceptions;
+            HResult = __HResults.COR_E_REFLECTIONTYPELOAD;
         }
 
-        public ReflectionTypeLoadException(Type[] classes, Exception[] exceptions, String message) : base(message)
+        public ReflectionTypeLoadException(Type[] classes, Exception[] exceptions, string message) : base(message)
         {
-            _classes = classes;
-            _exceptions = exceptions;
-            SetErrorCode(__HResults.COR_E_REFLECTIONTYPELOAD);
+            Types = classes;
+            LoaderExceptions = exceptions;
+            HResult = __HResults.COR_E_REFLECTIONTYPELOAD;
         }
 
         internal ReflectionTypeLoadException(SerializationInfo info, StreamingContext context) : base(info, context)
         {
-            _classes = (Type[])(info.GetValue("Types", typeof(Type[])));
-            _exceptions = (Exception[])(info.GetValue("Exceptions", typeof(Exception[])));
-        }
-
-        public Type[] Types
-        {
-            get { return _classes; }
-        }
-
-        public Exception[] LoaderExceptions
-        {
-            get { return _exceptions; }
+            Types = (Type[])(info.GetValue("Types", typeof(Type[])));
+            LoaderExceptions = (Exception[])(info.GetValue("Exceptions", typeof(Exception[])));
         }
 
         public override void GetObjectData(SerializationInfo info, StreamingContext context)
         {
-            if (info == null)
-            {
-                throw new ArgumentNullException(nameof(info));
-            }
-            Contract.EndContractBlock();
             base.GetObjectData(info, context);
-            info.AddValue("Types", _classes, typeof(Type[]));
-            info.AddValue("Exceptions", _exceptions, typeof(Exception[]));
+            info.AddValue("Types", Types, typeof(Type[]));
+            info.AddValue("Exceptions", LoaderExceptions, typeof(Exception[]));
         }
+
+        public Type[] Types { get; }
+
+        public Exception[] LoaderExceptions { get; }
     }
 }
index d751a54..2d03f42 100644 (file)
@@ -2,20 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// ResourceAttributes is an enum which defines the attributes that may be associated
-// 
-//  with a manifest resource.  The values here are defined in Corhdr.h.
-//
-//
-
-using System;
-
 namespace System.Reflection
 {
-    [Serializable]
     [Flags]
     public enum ResourceAttributes
     {
@@ -23,3 +11,4 @@ namespace System.Reflection
         Private = 0x0002,
     }
 }
+
diff --git a/src/mscorlib/src/System/Reflection/ResourceLocation.cs b/src/mscorlib/src/System/Reflection/ResourceLocation.cs
new file mode 100644 (file)
index 0000000..4902333
--- /dev/null
@@ -0,0 +1,15 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace System.Reflection
+{
+    [Flags]
+    public enum ResourceLocation
+    {
+        ContainedInAnotherAssembly = 2,
+        ContainedInManifestFile = 4,
+        Embedded = 1,
+    }
+}
+
index 280e1c0..8d2bf1f 100644 (file)
@@ -2,28 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-/*============================================================
-**
-**
-** 
-**
-**
-** Purpose: Encapsulate access to a public/private key pair
-**          used to sign strong name assemblies.
-**
-**
-===========================================================*/
-
-using System;
 using System.IO;
-using System.Runtime.CompilerServices;
-using System.Runtime.ConstrainedExecution;
-using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
-using System.Security;
-using System.Runtime.Versioning;
-using Microsoft.Win32;
-using System.Diagnostics.Contracts;
 
 namespace System.Reflection
 {
@@ -32,7 +12,7 @@ namespace System.Reflection
     {
         private bool _keyPairExported;
         private byte[] _keyPairArray;
-        private String _keyPairContainer;
+        private string _keyPairContainer;
         private byte[] _publicKey;
 
         // Build key pair from file.
@@ -40,7 +20,6 @@ namespace System.Reflection
         {
             if (keyPairFile == null)
                 throw new ArgumentNullException(nameof(keyPairFile));
-            Contract.EndContractBlock();
 
             int length = (int)keyPairFile.Length;
             _keyPairArray = new byte[length];
@@ -54,7 +33,6 @@ namespace System.Reflection
         {
             if (keyPairArray == null)
                 throw new ArgumentNullException(nameof(keyPairArray));
-            Contract.EndContractBlock();
 
             _keyPairArray = new byte[keyPairArray.Length];
             Array.Copy(keyPairArray, _keyPairArray, keyPairArray.Length);
@@ -70,7 +48,7 @@ namespace System.Reflection
             _publicKey = (byte[])info.GetValue("_publicKey", typeof(byte[]));
         }
 
-        public StrongNameKeyPair(String keyPairContainer)
+        public StrongNameKeyPair(string keyPairContainer)
         {
             throw new PlatformNotSupportedException();
         }
@@ -83,7 +61,6 @@ namespace System.Reflection
             }
         }
 
-        /// <internalonly/>
         void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
         {
             info.AddValue("_keyPairExported", _keyPairExported);
@@ -92,7 +69,6 @@ namespace System.Reflection
             info.AddValue("_publicKey", _publicKey);
         }
 
-        /// <internalonly/>
-        void IDeserializationCallback.OnDeserialization(Object sender) { }
+        void IDeserializationCallback.OnDeserialization(object sender) { }
     }
 }
index 537d168..0f1aa71 100644 (file)
@@ -2,19 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// TargetException is thrown when the target to an Invoke is invalid.  This may
-// 
-//    occur because the caller doesn't have access to the member, or the target doesn't
-//    define the member, etc.
-//
-// 
-//  
-//
-
-using System;
 using System.Runtime.Serialization;
 
 namespace System.Reflection
@@ -22,23 +9,21 @@ namespace System.Reflection
     [Serializable]
     public class TargetException : ApplicationException
     {
-        public TargetException() : base()
+        public TargetException()
+            : this(null)
         {
-            SetErrorCode(__HResults.COR_E_TARGET);
         }
 
-        public TargetException(String message) : base(message)
+        public TargetException(string message)
+            : this(message, null)
         {
-            SetErrorCode(__HResults.COR_E_TARGET);
         }
 
-        public TargetException(String message, Exception inner) : base(message, inner)
+        public TargetException(string message, Exception inner) : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_TARGET);
+            HResult = __HResults.COR_E_TARGET;
         }
 
-        protected TargetException(SerializationInfo info, StreamingContext context) : base(info, context)
-        {
-        }
+        protected TargetException(SerializationInfo info, StreamingContext context) : base(info, context) { }
     }
 }
index 38c5b7d..aa9a5b1 100644 (file)
@@ -2,19 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// TargetInvocationException is used to report an exception that was thrown
-// 
-//    by the target of an invocation.
-//
-// 
-// 
-//
-
-
-using System;
 using System.Runtime.Serialization;
 
 namespace System.Reflection
@@ -22,33 +9,18 @@ namespace System.Reflection
     [Serializable]
     public sealed class TargetInvocationException : ApplicationException
     {
-        // This exception is not creatable without specifying the
-        //    inner exception.
-        private TargetInvocationException()
-            : base(SR.Arg_TargetInvocationException)
-        {
-            SetErrorCode(__HResults.COR_E_TARGETINVOCATION);
-        }
-
-        // This is called from within the runtime.
-        private TargetInvocationException(String message) : base(message)
-        {
-            SetErrorCode(__HResults.COR_E_TARGETINVOCATION);
-        }
-
-        public TargetInvocationException(System.Exception inner)
+        public TargetInvocationException(Exception inner)
             : base(SR.Arg_TargetInvocationException, inner)
         {
-            SetErrorCode(__HResults.COR_E_TARGETINVOCATION);
+            HResult = __HResults.COR_E_TARGETINVOCATION;
         }
 
-        public TargetInvocationException(String message, Exception inner) : base(message, inner)
+        public TargetInvocationException(string message, Exception inner)
+            : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_TARGETINVOCATION);
+            HResult = __HResults.COR_E_TARGETINVOCATION;
         }
 
-        internal TargetInvocationException(SerializationInfo info, StreamingContext context) : base(info, context)
-        {
-        }
+        internal TargetInvocationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
     }
 }
index 5e315f9..19c4b2c 100644 (file)
@@ -2,45 +2,31 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// TargetParameterCountException is thrown when the number of parameter to an
-// 
-//    invocation doesn't match the number expected.
-//
-// 
-// 
-//
+using System.Runtime.Serialization;
 
 namespace System.Reflection
 {
-    using System;
-    using SystemException = System.SystemException;
-    using System.Runtime.Serialization;
     [Serializable]
     public sealed class TargetParameterCountException : ApplicationException
     {
         public TargetParameterCountException()
             : base(SR.Arg_TargetParameterCountException)
         {
-            SetErrorCode(__HResults.COR_E_TARGETPARAMCOUNT);
+            HResult = __HResults.COR_E_TARGETPARAMCOUNT;
         }
 
-        public TargetParameterCountException(String message)
+        public TargetParameterCountException(string message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_TARGETPARAMCOUNT);
+            HResult = __HResults.COR_E_TARGETPARAMCOUNT;
         }
 
-        public TargetParameterCountException(String message, Exception inner)
+        public TargetParameterCountException(string message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_TARGETPARAMCOUNT);
+            HResult = __HResults.COR_E_TARGETPARAMCOUNT;
         }
 
-        internal TargetParameterCountException(SerializationInfo info, StreamingContext context) : base(info, context)
-        {
-        }
+        internal TargetParameterCountException(SerializationInfo info, StreamingContext context) : base(info, context) { }
     }
 }
index ad7d29d..aa30331 100644 (file)
@@ -3,12 +3,10 @@
 // See the LICENSE file in the project root for more information.
 
 using System.Runtime.InteropServices;
-using System;
 
 namespace System.Reflection
 {
     // This Enum matchs the CorTypeAttr defined in CorHdr.h
-    [Serializable]
     [Flags]
     public enum TypeAttributes
     {
@@ -43,7 +41,6 @@ namespace System.Reflection
         // Implementation attributes.
         Import = 0x00001000,     // Class / interface is imported
         Serializable = 0x00002000,     // The class is Serializable.
-
         WindowsRuntime = 0x00004000,     // Type is a Windows Runtime type.
 
         // Use tdStringFormatMask to retrieve string information for native interop
@@ -58,9 +55,9 @@ namespace System.Reflection
 
         BeforeFieldInit = 0x00100000,     // Initialize the class any time before first static field access.
 
-        // Flags reserved for runtime use.
-        ReservedMask = 0x00040800,
         RTSpecialName = 0x00000800,     // Runtime should check name encoding.
         HasSecurity = 0x00040000,     // Class has security associate with it.
+
+        ReservedMask = 0x00040800,
     }
 }
index 97a0899..eb049f8 100644 (file)
@@ -2,18 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-////////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//
-// TypeFilter defines a delegate that is as a callback function for filtering
-// 
-//    a list of Types.
-//
-//
-
 namespace System.Reflection
 {
-    // Define the delegate
-    [Serializable]
-    public delegate bool TypeFilter(Type m, Object filterCriteria);
+    public delegate bool TypeFilter(Type m, object filterCriteria);
 }