We need you! We're working hard on the next version of Developer Fusion -
Let us know what you think we should be up to!
-
Expand
Microsoft.Win32
-
Expand
Microsoft.Win32.SafeHandles
-
Expand
System
-
Expand
System.Runtime.Hosting
-
Expand
System.Runtime.InteropServices
-
Expand
System.Runtime.CompilerServices
-
Expand
System.Collections
-
Expand
System.Collections.Generic
-
Expand
System.Collections.ObjectModel
-
Expand
System.Configuration.Assemblies
-
Expand
System.Diagnostics
-
Expand
System.Diagnostics.CodeAnalysis
-
Expand
System.Diagnostics.SymbolStore
-
Expand
System.Globalization
-
Expand
System.IO
-
Expand
System.IO.IsolatedStorage
-
Expand
System.Reflection
-
Expand
System.Reflection.Cache
-
Expand
System.Reflection.Emit
-
Expand
__ExceptionInfo
-
Expand
__ExceptionInstance
-
Expand
__FixupData
-
Expand
AssemblyBuilder
-
Expand
AssemblyBuilderAccess
-
Expand
AssemblyBuilderData
-
Expand
ConstructorBuilder
-
Expand
ConstructorOnTypeBuilderInstantiation
-
Expand
CustAttr
-
Expand
CustomAttributeBuilder
-
Expand
DestroyScout
-
Expand
DynamicILGenerator
-
Expand
DynamicILInfo
-
Expand
DynamicMethod
-
Expand
DynamicResolver
-
Expand
DynamicScope
-
Expand
EmptyCAHolder
-
Expand
Entry
-
Expand
EnumBuilder
-
Expand
EventBuilder
-
Expand
EventToken
-
Expand
FieldBuilder
-
Expand
FieldOnTypeBuilderInstantiation
-
Expand
FieldToken
-
Expand
FlowControl
-
Expand
Format
-
Expand
GenericMethodInfo
-
Expand
GenericTypeParameterBuilder
-
Expand
ILGenerator
-
Expand
Label
-
Expand
LineNumberInfo
-
Expand
LocalBuilder
-
Expand
LocalSymInfo
-
Expand
MethodBuilder
-
Expand
MethodBuilderInstantiation
-
Expand
MethodOnTypeBuilderInstantiation
-
Expand
MethodRental
-
Expand
MethodToken
-
Expand
ModuleBuilder
-
Expand
ModuleBuilderData
-
Expand
OpCode
-
Expand
OpCodes
-
Expand
OpCodeType
-
Expand
OperandType
-
Expand
PackingSize
-
Expand
ParameterBuilder
-
Expand
ParameterToken
-
Expand
PEFileKinds
-
Expand
PropertyBuilder
-
Expand
PropertyToken
-
Expand
REDocument
-
Expand
ResWriterData
-
Expand
RTDynamicMethod
-
Expand
ScopeAction
-
Expand
ScopeTree
-
Expand
SecurityControlFlags
-
Expand
SignatureHelper
-
Expand
SignatureToken
-
Expand
StackBehaviour
-
Expand
StringToken
-
Expand
SymbolMethod
-
Expand
SymbolType
-
Expand
SymCustomAttr
-
Expand
TypeBuilder
-
AddDeclarativeSecurity(SecurityAction, PermissionSet)
-
AddDeclarativeSecurityNoLock(SecurityAction, PermissionSet)
-
AddInterfaceImplementation(Type)
-
Assembly()
-
AssemblyQualifiedName()
-
BaseType()
-
CheckContext(Type)
-
CheckContext(Type)
-
CreateType()
-
CreateTypeNoLock()
-
DeclaringMethod()
-
DeclaringType()
-
DefineConstructor(MethodAttributes, CallingConventions, Type)
-
DefineConstructor(MethodAttributes, CallingConventions, Type, Type, Type)
-
DefineConstructorNoLock(MethodAttributes, CallingConventions, Type, Type, Type)
-
DefineDataHelper(string, byte, int, FieldAttributes)
-
DefineDefaultConstructor(MethodAttributes)
-
DefineDefaultConstructorNoLock(MethodAttributes)
-
DefineEvent(string, EventAttributes, Type)
-
DefineEventNoLock(string, EventAttributes, Type)
-
DefineField(string, Type, FieldAttributes)
-
DefineField(string, Type, Type, Type, FieldAttributes)
-
DefineFieldNoLock(string, Type, Type, Type, FieldAttributes)
-
DefineGenericParameters(string)
-
DefineInitializedData(string, byte, FieldAttributes)
-
DefineInitializedDataNoLock(string, byte, FieldAttributes)
-
DefineMethod(string, MethodAttributes)
-
DefineMethod(string, MethodAttributes, CallingConventions)
-
DefineMethod(string, MethodAttributes, CallingConventions, Type, Type)
-
DefineMethod(string, MethodAttributes, CallingConventions, Type, Type, Type, Type, Type, Type)
-
DefineMethod(string, MethodAttributes, Type, Type)
-
DefineMethodNoLock(string, MethodAttributes, CallingConventions, Type, Type, Type, Type, Type, Type)
-
DefineMethodOverride(MethodInfo, MethodInfo)
-
DefineMethodOverrideNoLock(MethodInfo, MethodInfo)
-
DefineNestedType(string)
-
DefineNestedType(string, TypeAttributes)
-
DefineNestedType(string, TypeAttributes, Type)
-
DefineNestedType(string, TypeAttributes, Type, int)
-
DefineNestedType(string, TypeAttributes, Type, PackingSize)
-
DefineNestedType(string, TypeAttributes, Type, Type)
-
DefineNestedTypeNoLock(string)
-
DefineNestedTypeNoLock(string, TypeAttributes)
-
DefineNestedTypeNoLock(string, TypeAttributes, Type)
-
DefineNestedTypeNoLock(string, TypeAttributes, Type, int)
-
DefineNestedTypeNoLock(string, TypeAttributes, Type, PackingSize)
-
DefineNestedTypeNoLock(string, TypeAttributes, Type, Type)
-
DefinePInvokeMethod(string, string, MethodAttributes, CallingConventions, Type, Type, CallingConvention, CharSet)
-
DefinePInvokeMethod(string, string, string, MethodAttributes, CallingConventions, Type, Type, CallingConvention, CharSet)
-
DefinePInvokeMethod(string, string, string, MethodAttributes, CallingConventions, Type, Type, Type, Type, Type, Type, CallingConvention, CharSet)
-
DefinePInvokeMethodHelper(string, string, string, MethodAttributes, CallingConventions, Type, Type, Type, Type, Type, Type, CallingConvention, CharSet)
-
DefinePInvokeMethodHelperNoLock(string, string, string, MethodAttributes, CallingConventions, Type, Type, Type, Type, Type, Type, CallingConvention, CharSet)
-
DefineProperty(string, PropertyAttributes, Type, Type)
-
DefineProperty(string, PropertyAttributes, Type, Type, Type, Type, Type, Type)
-
DefinePropertyNoLock(string, PropertyAttributes, Type, Type, Type, Type, Type, Type)
-
DefineTypeInitializer()
-
DefineTypeInitializerNoLock()
-
DefineUninitializedData(string, int, FieldAttributes)
-
DefineUninitializedDataNoLock(string, int, FieldAttributes)
-
FullName()
-
GenericParameterAttributes()
-
GenericParameterPosition()
-
GetAttributeFlagsImpl()
-
GetConstructor(Type, ConstructorInfo)
-
GetConstructorImpl(BindingFlags, Binder, CallingConventions, Type, ParameterModifier)
-
GetConstructors(BindingFlags)
-
GetCustomAttributes(bool)
-
GetCustomAttributes(Type, bool)
-
GetElementType()
-
GetEvent(string, BindingFlags)
-
GetEvents()
-
GetEvents(BindingFlags)
-
GetField(string, BindingFlags)
-
GetField(Type, FieldInfo)
-
GetFields(BindingFlags)
-
GetGenericArguments()
-
GetGenericTypeDefinition()
-
GetIDsOfNames(Guid, IntPtr, uint, uint, IntPtr)
-
GetInterface(string, bool)
-
GetInterfaceMap(Type)
-
GetInterfaces()
-
GetMember(string, MemberTypes, BindingFlags)
-
GetMembers(BindingFlags)
-
GetMethod(Type, MethodInfo)
-
GetMethodImpl(string, BindingFlags, Binder, CallingConventions, Type, ParameterModifier)
-
GetMethods(BindingFlags)
-
GetNestedType(string, BindingFlags)
-
GetNestedTypes(BindingFlags)
-
GetProperties(BindingFlags)
-
GetPropertyImpl(string, BindingFlags, Binder, Type, Type, ParameterModifier)
-
GetTypeInfo(uint, uint, IntPtr)
-
GetTypeInfoCount(uint)
-
GUID()
-
HasElementTypeImpl()
-
Init(string, TypeAttributes, Type, Type, Module, PackingSize, int, TypeBuilder)
-
InitAsGenericParam(string, int)
-
InternalAddDeclarativeSecurity(Module, int, SecurityAction, byte)
-
InternalAddInterfaceImpl(int, int, Module)
-
InternalCreateCustomAttribute(int, int, byte, Module, bool)
-
InternalCreateCustomAttribute(int, int, byte, Module, bool, bool)
-
InternalDefineClass(string, int, int, TypeAttributes, Module, Guid, int, int)
-
InternalDefineEvent(Module, int, string, int, int)
-
InternalDefineField(int, string, byte, int, FieldAttributes, Module)
-
InternalDefineGenParam(string, int, int, int, int, Module, int)
-
InternalDefineMethod(int, string, byte, int, MethodAttributes, Module)
-
InternalDefineMethodImpl(ModuleBuilder, int, int, int)
-
InternalDefineMethodSemantics(Module, int, MethodSemanticsAttributes, int)
-
InternalDefineMethodSpec(int, byte, int, Module)
-
InternalDefineProperty(Module, int, string, int, byte, int, int, int)
-
InternalGetTokenFromSig(Module, byte, int)
-
InternalSetClassLayout(Module, int, PackingSize, int)
-
InternalSetConstantValue(Module, int, Variant)
-
InternalSetFieldOffset(Module, int, int)
-
InternalSetMarshalInfo(Module, int, byte, int)
-
InternalSetMethodIL(int, bool, byte, byte, int, int, int, __ExceptionInstance, int, int, Module)
-
InternalSetMethodImpl(Module, int, MethodImplAttributes)
-
InternalSetParamInfo(Module, int, int, ParameterAttributes, string)
-
InternalSetParentType(int, int, Module)
-
InternalSetPInvokeData(Module, string, string, int, int, int)
-
Invoke(uint, Guid, uint, short, IntPtr, IntPtr, IntPtr, IntPtr)
-
InvokeMember(string, BindingFlags, Binder, object, object, ParameterModifier, CultureInfo, string)
-
IsArrayImpl()
-
IsAssignableFrom(Type)
-
IsByRefImpl()
-
IsCOMObjectImpl()
-
IsCreated()
-
IsDefined(Type, bool)
-
IsGenericParameter()
-
IsGenericType()
-
IsGenericTypeDefinition()
-
IsPointerImpl()
-
IsPrimitiveImpl()
-
IsPublicComType(Type)
-
IsSubclassOf(Type)
-
IsTypeEqual(Type, Type)
-
MakeArrayType()
-
MakeArrayType(int)
-
MakeByRefType()
-
MakeGenericType(Type)
-
MakePointerType()
-
MetadataTokenInternal()
-
Module()
-
Name()
-
Namespace()
-
PackingSize()
-
ReflectedType()
-
SetConstantValue(Module, int, Type, object)
-
SetCustomAttribute(ConstructorInfo, byte)
-
SetCustomAttribute(CustomAttributeBuilder)
-
SetInterfaces(Type)
-
SetParent(Type)
-
Size()
-
TermCreateClass(int, Module)
-
ThrowIfCreated()
-
ThrowIfGeneric()
-
ToString()
-
TypeBuilder(ModuleBuilder)
-
TypeBuilder(string, int, MethodBuilder)
-
TypeBuilder(string, int, TypeBuilder)
-
TypeBuilder(string, TypeAttributes, Type, Module, PackingSize, int, TypeBuilder)
-
TypeBuilder(string, TypeAttributes, Type, Type, Module, PackingSize, TypeBuilder)
-
TypeBuilder(TypeBuilder, GenericTypeParameterBuilder)
-
TypeHandle()
-
TypeToken()
-
UnderlyingSystemType()
-
VerifyTypeAttributes(TypeAttributes)
-
Expand
TypeBuilderInstantiation
-
Expand
TypeKind
-
Expand
TypeNameBuilder
-
Expand
TypeToken
-
Expand
UnmanagedMarshal
-
Expand
VarArgMethod
-
Expand
System.Resources
-
Expand
System.Runtime
-
Expand
System.Runtime.InteropServices.Expando
-
Expand
System.Runtime.ConstrainedExecution
-
Expand
System.Runtime.Remoting.Activation
-
Expand
System.Runtime.Remoting.Messaging
-
Expand
System.Runtime.Remoting.Channels
-
Expand
System.Runtime.Remoting.Lifetime
-
Expand
System.Runtime.Remoting
-
Expand
System.Runtime.Remoting.Contexts
-
Expand
System.Runtime.Remoting.Proxies
-
Expand
System.Runtime.Remoting.Metadata
-
Expand
System.Runtime.Remoting.Metadata.W3cXsd2001
-
Expand
System.Runtime.Remoting.Services
-
Expand
System.Runtime.Serialization
-
Expand
System.Runtime.Serialization.Formatters
-
Expand
System.Runtime.Serialization.Formatters.Binary
-
Expand
System.Runtime.Versioning
-
Expand
System.Security
-
Expand
System.Security.Cryptography
-
Expand
System.Security.Cryptography.X509Certificates
-
Expand
System.Security.Permissions
-
Expand
System.Security.Policy
-
Expand
System.Security.Principal
-
Expand
System.Security.Util
-
Expand
System.Text
-
Expand
System.Threading
-
Expand
System.Runtime.Remoting.Channels.Http
-
Expand
System.Runtime.Remoting.Channels.Tcp
-
Expand
System.Runtime.Remoting.MetadataServices
-
Expand
System.Runtime.Serialization.Formatters.Soap.Xml
-
Expand
System.Runtime.Serialization.Formatters.Soap
-
Expand
Microsoft.Tools.Caspol
-
Expand
Microsoft.Tools.Build
-
Expand
Microsoft.CSharp
-
Expand
System.CodeDom
-
Expand
System.CodeDom.Compiler
-
Expand
System.Collections.Specialized
-
Expand
System.ComponentModel
-
Expand
System.ComponentModel.Design
-
Expand
System.ComponentModel.Design.Serialization
-
Expand
System.Configuration
-
Expand
System.Web
-
Expand
System.Configuration.Provider
-
Expand
System.Configuration.Internal
-
Expand
System.Internal
-
Expand
System.Windows.Forms
-
Expand
System.Net
-
Expand
System.Net.Sockets
-
Expand
System.Net.NetworkInformation
-
Expand
System.Net.ComImports
-
Expand
System.Net.Security
-
Expand
System.Net.Cache
-
Expand
System.Net.Configuration
-
Expand
System.Text.RegularExpressions
-
Expand
System.Tools
-
Expand
System.IO.Compression
-
Expand
System.IO.Ports
-
Expand
System.Security.AccessControl
-
Expand
System.Xml
-
Expand
System.Xml.XPath.DataBinding
-
Expand
System.Xml.Schema
-
Expand
System.Xml.Serialization
-
Expand
System.Xml.Serialization.Advanced
-
Expand
System.Xml.Serialization.Configuration
-
Expand
System.Xml.XPath
-
Expand
System.Xml.Xsl
-
Expand
System.Xml.Xsl.IlGen
-
Expand
System.Xml.Xsl.Qil
-
Expand
System.Xml.Xsl.Runtime
-
Expand
System.Xml.Xsl.XPath
-
Expand
System.Xml.Xsl.Xslt
-
Expand
System.Xml.Xsl.XsltOld
-
Expand
System.Xml.Xsl.XsltOld.Debugger
-
Expand
Microsoft.JScript
-
Expand
Microsoft.Vsa
-
Expand
Microsoft.JScript.Vsa
- namespace System.Reflection.Emit
- {
-
- using System;
- using System.Runtime.Remoting.Activation;
- using System.Reflection;
- using System.Security;
- using System.Security.Permissions;
- using System.Diagnostics;
- using System.Runtime.InteropServices;
- using System.Runtime.CompilerServices;
- using ArrayList = System.Collections.ArrayList;
- using CultureInfo = System.Globalization.CultureInfo;
- using System.Threading;
-
-
- [Serializable()]
- [System.Runtime.InteropServices.ComVisible(true)]
- public enum PackingSize
- {
- Unspecified = 0,
- Size1 = 1,
- Size2 = 2,
- Size4 = 4,
- Size8 = 8,
- Size16 = 16,
- Size32 = 32,
- Size64 = 64,
- Size128 = 128
- }
-
-
- [HostProtection(MayLeakOnAbort = true)]
- [ClassInterface(ClassInterfaceType.None)]
- [ComDefaultInterface(typeof(_TypeBuilder))]
- [System.Runtime.InteropServices.ComVisible(true)]
- public sealed class TypeBuilder : Type, _TypeBuilder
- {
- #region Declarations
- internal class CustAttr
- {
- private ConstructorInfo m_con;
- private byte[] m_binaryAttribute;
- private CustomAttributeBuilder m_customBuilder;
-
- public CustAttr(ConstructorInfo con, byte[] binaryAttribute)
- {
- if (con == null)
- throw new ArgumentNullException("con");
-
- if (binaryAttribute == null)
- throw new ArgumentNullException("binaryAttribute");
-
- m_con = con;
- m_binaryAttribute = binaryAttribute;
- }
-
- public CustAttr(CustomAttributeBuilder customBuilder)
- {
- if (customBuilder == null)
- throw new ArgumentNullException("customBuilder");
-
- m_customBuilder = customBuilder;
- }
-
- public void Bake(ModuleBuilder module, int token)
- {
- if (m_customBuilder == null) {
- TypeBuilder.InternalCreateCustomAttribute(token, module.GetConstructorToken(m_con).Token, m_binaryAttribute, module, false);
- }
- else {
- m_customBuilder.CreateCustomAttribute(module, token);
- }
- }
- }
- #endregion
-
- #region Public Static Methods
- public static MethodInfo GetMethod(Type type, MethodInfo method)
- {
- if (!(type is TypeBuilder) && !(type is TypeBuilderInstantiation))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeTypeBuilder"));
-
-
-
-
-
-
-
-
- if (method.IsGenericMethod && !method.IsGenericMethodDefinition)
- throw new ArgumentException(Environment.GetResourceString("Argument_NeedGenericMethodDefinition"), "method");
-
- if (method.DeclaringType == null || !method.DeclaringType.IsGenericTypeDefinition)
- throw new ArgumentException(Environment.GetResourceString("Argument_MethodNeedGenericDeclaringType"), "method");
-
- if (type.GetGenericTypeDefinition() != method.DeclaringType)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidMethodDeclaringType"), "type");
-
-
-
-
- if (type.IsGenericTypeDefinition)
- type = type.MakeGenericType(type.GetGenericArguments());
-
- if (!(type is TypeBuilderInstantiation))
- throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), "type");
-
- return MethodOnTypeBuilderInstantiation.GetMethod(method, type as TypeBuilderInstantiation);
- }
- public static ConstructorInfo GetConstructor(Type type, ConstructorInfo constructor)
- {
- if (!(type is TypeBuilder) && !(type is TypeBuilderInstantiation))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeTypeBuilder"));
-
- if (!constructor.DeclaringType.IsGenericTypeDefinition)
- throw new ArgumentException(Environment.GetResourceString("Argument_ConstructorNeedGenericDeclaringType"), "constructor");
-
- if (!(type is TypeBuilderInstantiation))
- throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), "type");
-
-
- if (type is TypeBuilder && type.IsGenericTypeDefinition)
- type = type.MakeGenericType(type.GetGenericArguments());
-
- if (type.GetGenericTypeDefinition() != constructor.DeclaringType)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidConstructorDeclaringType"), "type");
-
- return ConstructorOnTypeBuilderInstantiation.GetConstructor(constructor, type as TypeBuilderInstantiation);
- }
- public static FieldInfo GetField(Type type, FieldInfo field)
- {
- if (!(type is TypeBuilder) && !(type is TypeBuilderInstantiation))
- throw new ArgumentException(Environment.GetResourceString("Argument_MustBeTypeBuilder"));
-
- if (!field.DeclaringType.IsGenericTypeDefinition)
- throw new ArgumentException(Environment.GetResourceString("Argument_FieldNeedGenericDeclaringType"), "field");
-
- if (!(type is TypeBuilderInstantiation))
- throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), "type");
-
-
- if (type is TypeBuilder && type.IsGenericTypeDefinition)
- type = type.MakeGenericType(type.GetGenericArguments());
-
- if (type.GetGenericTypeDefinition() != field.DeclaringType)
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFieldDeclaringType"), "type");
-
- return FieldOnTypeBuilderInstantiation.GetField(field, type as TypeBuilderInstantiation);
- }
- #endregion
-
- #region Public Const
- public const int UnspecifiedTypeSize = 0;
- #endregion
-
- #region Private Static FCalls
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void InternalSetParentType(int tdTypeDef, int tkParent, Module module);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern void InternalAddInterfaceImpl(int tdTypeDef, int tkInterface, Module module);
- #endregion
-
- #region Internal Static FCalls
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern int InternalDefineMethod(int handle, string name, byte[] signature, int sigLength, MethodAttributes attributes, Module module);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern int InternalDefineMethodSpec(int handle, byte[] signature, int sigLength, Module module);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern int InternalDefineField(int handle, string name, byte[] signature, int sigLength, FieldAttributes attributes, Module module);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void InternalSetMethodIL(int methodHandle, bool isInitLocals, byte[] body, byte[] LocalSig, int sigLength, int maxStackSize, int numExceptions, __ExceptionInstance[] exceptions, int[] tokenFixups, int[] rvaFixups,
- Module module);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void InternalCreateCustomAttribute(int tkAssociate, int tkConstructor, byte[] attr, Module module, bool toDisk, bool updateCompilerFlags);
-
- static internal void InternalCreateCustomAttribute(int tkAssociate, int tkConstructor, byte[] attr, Module module, bool toDisk)
- {
- byte[] localAttr = null;
-
- if (attr != null) {
- localAttr = new byte[attr.Length];
- Array.Copy(attr, localAttr, attr.Length);
- }
- TypeBuilder.InternalCreateCustomAttribute(tkAssociate, tkConstructor, localAttr, module, toDisk, false);
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void InternalSetPInvokeData(Module module, string DllName, string name, int token, int linkType, int linkFlags);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern int InternalDefineProperty(Module module, int handle, string name, int attributes, byte[] signature, int sigLength, int notifyChanging, int notifyChanged);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern int InternalDefineEvent(Module module, int handle, string name, int attributes, int tkEventType);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void InternalDefineMethodSemantics(Module module, int tkAssociation, MethodSemanticsAttributes semantics, int tkMethod);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void InternalDefineMethodImpl(ModuleBuilder module, int tkType, int tkBody, int tkDecl);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void InternalSetMethodImpl(Module module, int tkMethod, MethodImplAttributes MethodImplAttributes);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern int InternalSetParamInfo(Module module, int tkMethod, int iSequence, ParameterAttributes iParamAttributes, string strParamName);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern int InternalGetTokenFromSig(Module module, byte[] signature, int sigLength);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void InternalSetFieldOffset(Module module, int fdToken, int iOffset);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void InternalSetClassLayout(Module module, int tdToken, PackingSize iPackingSize, int iTypeSize);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void InternalSetMarshalInfo(Module module, int tk, byte[] ubMarshal, int ubSize);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void InternalSetConstantValue(Module module, int tk, ref Variant var);
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- static internal extern void InternalAddDeclarativeSecurity(Module module, int parent, SecurityAction action, byte[] blob);
- #endregion
-
- #region Internal\Private Static Members
- private static bool IsPublicComType(Type type)
- {
-
-
-
-
-
- Type enclosingType = type.DeclaringType;
- if (enclosingType != null) {
- if (IsPublicComType(enclosingType)) {
- if ((type.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPublic) {
- return true;
- }
- }
- }
- else {
- if ((type.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.Public) {
- return true;
- }
- }
-
- return false;
- }
-
- static internal bool IsTypeEqual(Type t1, Type t2)
- {
-
- if (t1 == t2)
- return true;
- TypeBuilder tb1 = null;
- TypeBuilder tb2 = null;
- Type runtimeType1 = null;
- Type runtimeType2 = null;
-
-
- if (t1 is TypeBuilder) {
- tb1 = (TypeBuilder)t1;
-
- runtimeType1 = tb1.m_runtimeType;
- }
- else {
- runtimeType1 = t1;
- }
-
- if (t2 is TypeBuilder) {
- tb2 = (TypeBuilder)t2;
-
- runtimeType2 = tb2.m_runtimeType;
- }
- else {
- runtimeType2 = t2;
- }
-
-
- if (tb1 != null && tb2 != null && tb1 == tb2)
- return true;
-
-
- if (runtimeType1 != null && runtimeType2 != null && runtimeType1 == runtimeType2)
- return true;
-
- return false;
- }
-
- static internal void SetConstantValue(Module module, int tk, Type destType, object value)
- {
-
-
-
- if (value == null) {
- if (destType.IsValueType)
- throw new ArgumentException(Environment.GetResourceString("Argument_ConstantNull"));
- }
- else {
-
- Type type = value.GetType();
-
-
- if (destType.IsEnum == false) {
- if (destType != type)
- throw new ArgumentException(Environment.GetResourceString("Argument_ConstantDoesntMatch"));
-
- switch (Type.GetTypeCode(type)) {
- case TypeCode.Boolean:
- case TypeCode.Char:
- case TypeCode.SByte:
- case TypeCode.Byte:
- case TypeCode.Int16:
- case TypeCode.UInt16:
- case TypeCode.Int32:
- case TypeCode.UInt32:
- case TypeCode.Int64:
- case TypeCode.UInt64:
- case TypeCode.Single:
- case TypeCode.Double:
- case TypeCode.Decimal:
- case TypeCode.String:
- break;
- default:
-
- {
- if (type != typeof(System.DateTime))
- throw new ArgumentException(Environment.GetResourceString("Argument_ConstantNotSupported"));
- break;
- }
- break;
-
- }
- }
- else {
-
- if (destType.UnderlyingSystemType != type)
- throw new ArgumentException(Environment.GetResourceString("Argument_ConstantDoesntMatch"));
- }
- }
-
-
- Variant var = new Variant(value);
-
- InternalSetConstantValue(module, tk, ref var);
- }
-
- #endregion
-
- #region Private Data Members
- internal ArrayList m_ca;
- internal MethodBuilder m_currentMethod;
- private TypeToken m_tdType;
- private ModuleBuilder m_module;
- internal string m_strName;
- private string m_strNameSpace;
- private string m_strFullQualName;
- private Type m_typeParent;
- private Type[] m_typeInterfaces;
- internal TypeAttributes m_iAttr;
- internal GenericParameterAttributes m_genParamAttributes;
- internal ArrayList m_listMethods;
- private int m_constructorCount;
- private int m_iTypeSize;
- private PackingSize m_iPackingSize;
- private TypeBuilder m_DeclaringType;
- private Type m_underlyingSystemType;
-
- internal bool m_isHiddenGlobalType;
- internal bool m_isHiddenType;
- internal bool m_hasBeenCreated;
- internal RuntimeType m_runtimeType;
-
- private int m_genParamPos;
- private GenericTypeParameterBuilder[] m_inst;
- private bool m_bIsGenParam;
- private bool