using System; using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace System.Reflection.Emit { /// Describes and represents an enumeration type. // Token: 0x020001EF RID: 495 [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(_EnumBuilder))] [ComVisible(true)] public sealed class EnumBuilder : Type, _EnumBuilder { // Token: 0x060019B7 RID: 6583 RVA: 0x00062058 File Offset: 0x00060258 internal EnumBuilder(ModuleBuilder mb, string name, TypeAttributes visibility, Type underlyingType) { this._tb = new TypeBuilder(mb, name, visibility | TypeAttributes.Sealed, typeof(Enum), null, PackingSize.Unspecified, 0, null); this._underlyingType = underlyingType; this._underlyingField = this._tb.DefineField("value__", underlyingType, FieldAttributes.Private | FieldAttributes.SpecialName | FieldAttributes.RTSpecialName); this.setup_enum_type(this._tb); } /// Maps a set of names to a corresponding set of dispatch identifiers. /// Reserved for future use. Must be IID_NULL. /// Passed-in array of names to be mapped. /// Count of the names to be mapped. /// The locale context in which to interpret the names. /// Caller-allocated array which receives the IDs corresponding to the names. /// The method is called late-bound using the COM IDispatch interface. // Token: 0x060019B8 RID: 6584 RVA: 0x000620C0 File Offset: 0x000602C0 void _EnumBuilder.GetIDsOfNames([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId) { throw new NotImplementedException(); } /// Retrieves the type information for an object, which can then be used to get the type information for an interface. /// The type information to return. /// The locale identifier for the type information. /// Receives a pointer to the requested type information object. /// The method is called late-bound using the COM IDispatch interface. // Token: 0x060019B9 RID: 6585 RVA: 0x000620C8 File Offset: 0x000602C8 void _EnumBuilder.GetTypeInfo(uint iTInfo, uint lcid, IntPtr ppTInfo) { throw new NotImplementedException(); } /// Retrieves the number of type information interfaces that an object provides (either 0 or 1). /// Points to a location that receives the number of type information interfaces provided by the object. /// The method is called late-bound using the COM IDispatch interface. // Token: 0x060019BA RID: 6586 RVA: 0x000620D0 File Offset: 0x000602D0 void _EnumBuilder.GetTypeInfoCount(out uint pcTInfo) { throw new NotImplementedException(); } /// Provides access to properties and methods exposed by an object. /// Identifies the member. /// Reserved for future use. Must be IID_NULL. /// The locale context in which to interpret arguments. /// Flags describing the context of the call. /// Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays. /// Pointer to the location where the result is to be stored. /// Pointer to a structure that contains exception information. /// The index of the first argument that has an error. /// The method is called late-bound using the COM IDispatch interface. // Token: 0x060019BB RID: 6587 RVA: 0x000620D8 File Offset: 0x000602D8 void _EnumBuilder.Invoke(uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams, IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr) { throw new NotImplementedException(); } // Token: 0x060019BC RID: 6588 RVA: 0x000620E0 File Offset: 0x000602E0 internal TypeBuilder GetTypeBuilder() { return this._tb; } /// Retrieves the dynamic assembly that contains this enum definition. /// Read-only. The dynamic assembly that contains this enum definition. // Token: 0x17000487 RID: 1159 // (get) Token: 0x060019BD RID: 6589 RVA: 0x000620E8 File Offset: 0x000602E8 public override Assembly Assembly { get { return this._tb.Assembly; } } /// Returns the full path of this enum qualified by the display name of the parent assembly. /// Read-only. The full path of this enum qualified by the display name of the parent assembly. /// If has not been called previously. // Token: 0x17000488 RID: 1160 // (get) Token: 0x060019BE RID: 6590 RVA: 0x000620F8 File Offset: 0x000602F8 public override string AssemblyQualifiedName { get { return this._tb.AssemblyQualifiedName; } } /// Returns the parent of this type which is always . /// Read-only. The parent of this type. // Token: 0x17000489 RID: 1161 // (get) Token: 0x060019BF RID: 6591 RVA: 0x00062108 File Offset: 0x00060308 public override Type BaseType { get { return this._tb.BaseType; } } /// Returns the type that declared this . /// Read-only. The type that declared this . // Token: 0x1700048A RID: 1162 // (get) Token: 0x060019C0 RID: 6592 RVA: 0x00062118 File Offset: 0x00060318 public override Type DeclaringType { get { return this._tb.DeclaringType; } } /// Returns the full path of this enum. /// Read-only. The full path of this enum. // Token: 0x1700048B RID: 1163 // (get) Token: 0x060019C1 RID: 6593 RVA: 0x00062128 File Offset: 0x00060328 public override string FullName { get { return this._tb.FullName; } } /// Returns the GUID of this enum. /// Read-only. The GUID of this enum. /// This method is not currently supported in types that are not complete. // Token: 0x1700048C RID: 1164 // (get) Token: 0x060019C2 RID: 6594 RVA: 0x00062138 File Offset: 0x00060338 public override Guid GUID { get { return this._tb.GUID; } } /// Retrieves the dynamic module that contains this definition. /// Read-only. The dynamic module that contains this definition. // Token: 0x1700048D RID: 1165 // (get) Token: 0x060019C3 RID: 6595 RVA: 0x00062148 File Offset: 0x00060348 public override Module Module { get { return this._tb.Module; } } /// Returns the name of this enum. /// Read-only. The name of this enum. // Token: 0x1700048E RID: 1166 // (get) Token: 0x060019C4 RID: 6596 RVA: 0x00062158 File Offset: 0x00060358 public override string Name { get { return this._tb.Name; } } /// Returns the namespace of this enum. /// Read-only. The namespace of this enum. // Token: 0x1700048F RID: 1167 // (get) Token: 0x060019C5 RID: 6597 RVA: 0x00062168 File Offset: 0x00060368 public override string Namespace { get { return this._tb.Namespace; } } /// Returns the type that was used to obtain this . /// Read-only. The type that was used to obtain this . // Token: 0x17000490 RID: 1168 // (get) Token: 0x060019C6 RID: 6598 RVA: 0x00062178 File Offset: 0x00060378 public override Type ReflectedType { get { return this._tb.ReflectedType; } } /// Retrieves the internal handle for this enum. /// Read-only. The internal handle for this enum. /// This property is not currently supported. // Token: 0x17000491 RID: 1169 // (get) Token: 0x060019C7 RID: 6599 RVA: 0x00062188 File Offset: 0x00060388 public override RuntimeTypeHandle TypeHandle { get { return this._tb.TypeHandle; } } /// Returns the internal metadata type token of this enum. /// Read-only. The type token of this enum. // Token: 0x17000492 RID: 1170 // (get) Token: 0x060019C8 RID: 6600 RVA: 0x00062198 File Offset: 0x00060398 public TypeToken TypeToken { get { return this._tb.TypeToken; } } /// Returns the underlying field for this enum. /// Read-only. The underlying field for this enum. // Token: 0x17000493 RID: 1171 // (get) Token: 0x060019C9 RID: 6601 RVA: 0x000621A8 File Offset: 0x000603A8 public FieldBuilder UnderlyingField { get { return this._underlyingField; } } /// Returns the underlying system type for this enum. /// Read-only. Returns the underlying system type. // Token: 0x17000494 RID: 1172 // (get) Token: 0x060019CA RID: 6602 RVA: 0x000621B0 File Offset: 0x000603B0 public override Type UnderlyingSystemType { get { return this._underlyingType; } } /// Creates a object for this enum. /// A object for this enum. /// This type has been previously created.-or- The enclosing type has not been created. // Token: 0x060019CB RID: 6603 RVA: 0x000621B8 File Offset: 0x000603B8 public Type CreateType() { return this._tb.CreateType(); } // Token: 0x060019CC RID: 6604 [MethodImpl(MethodImplOptions.InternalCall)] private extern void setup_enum_type(Type t); /// Defines the named static field in an enumeration type with the specified constant value. /// The defined field. /// The name of the static field. /// The constant value of the literal. // Token: 0x060019CD RID: 6605 RVA: 0x000621D4 File Offset: 0x000603D4 public FieldBuilder DefineLiteral(string literalName, object literalValue) { FieldBuilder fieldBuilder = this._tb.DefineField(literalName, this, FieldAttributes.FamANDAssem | FieldAttributes.Family | FieldAttributes.Static | FieldAttributes.Literal); fieldBuilder.SetConstant(literalValue); return fieldBuilder; } // Token: 0x060019CE RID: 6606 RVA: 0x000621FC File Offset: 0x000603FC protected override TypeAttributes GetAttributeFlagsImpl() { return this._tb.attrs; } // Token: 0x060019CF RID: 6607 RVA: 0x0006220C File Offset: 0x0006040C protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { return this._tb.GetConstructor(bindingAttr, binder, callConvention, types, modifiers); } /// Returns an array of objects representing the public and non-public constructors defined for this class, as specified. /// Returns an array of objects representing the specified constructors defined for this class. If no constructors are defined, an empty array is returned. /// This must be a bit flag from : InvokeMethod, NonPublic, and so on. /// This method is not currently supported in types that are not complete. /// /// /// // Token: 0x060019D0 RID: 6608 RVA: 0x00062220 File Offset: 0x00060420 [ComVisible(true)] public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) { return this._tb.GetConstructors(bindingAttr); } /// Returns all the custom attributes defined for this constructor. /// Returns an array of objects representing all the custom attributes of the constructor represented by this instance. /// Specifies whether to search this member's inheritance chain to find the attributes. /// This method is not currently supported in types that are not complete. // Token: 0x060019D1 RID: 6609 RVA: 0x00062230 File Offset: 0x00060430 public override object[] GetCustomAttributes(bool inherit) { return this._tb.GetCustomAttributes(inherit); } /// Returns the custom attributes identified by the given type. /// Returns an array of objects representing the attributes of this constructor that are of . /// The Type object to which the custom attributes are applied. /// Specifies whether to search this member's inheritance chain to find the attributes. /// This method is not currently supported in types that are not complete. // Token: 0x060019D2 RID: 6610 RVA: 0x00062240 File Offset: 0x00060440 public override object[] GetCustomAttributes(Type attributeType, bool inherit) { return this._tb.GetCustomAttributes(attributeType, inherit); } /// Calling this method always throws . /// This method is not supported. No value is returned. /// This method is not currently supported. // Token: 0x060019D3 RID: 6611 RVA: 0x00062250 File Offset: 0x00060450 public override Type GetElementType() { return this._tb.GetElementType(); } /// Returns the event with the specified name. /// Returns an object representing the event declared or inherited by this type with the specified name. If there are no matches, null is returned. /// The name of the event to get. /// This invocation attribute. This must be a bit flag from : InvokeMethod, NonPublic, and so on. /// This method is not currently supported in types that are not complete. // Token: 0x060019D4 RID: 6612 RVA: 0x00062260 File Offset: 0x00060460 public override EventInfo GetEvent(string name, BindingFlags bindingAttr) { return this._tb.GetEvent(name, bindingAttr); } /// Returns the events for the public events declared or inherited by this type. /// Returns an array of objects representing the public events declared or inherited by this type. An empty array is returned if there are no public events. /// This method is not currently supported in types that are not complete. // Token: 0x060019D5 RID: 6613 RVA: 0x00062270 File Offset: 0x00060470 public override EventInfo[] GetEvents() { return this._tb.GetEvents(); } /// Returns the public and non-public events that are declared by this type. /// Returns an array of objects representing the public and non-public events declared or inherited by this type. An empty array is returned if there are no events, as specified. /// This must be a bit flag from , such as InvokeMethod, NonPublic, and so on. /// This method is not currently supported in types that are not complete. /// /// /// // Token: 0x060019D6 RID: 6614 RVA: 0x00062280 File Offset: 0x00060480 public override EventInfo[] GetEvents(BindingFlags bindingAttr) { return this._tb.GetEvents(bindingAttr); } /// Returns the field specified by the given name. /// Returns the object representing the field declared or inherited by this type with the specified name and public or non-public modifier. If there are no matches, then null is returned. /// The name of the field to get. /// This must be a bit flag from : InvokeMethod, NonPublic, and so on. /// This method is not currently supported in types that are not complete. // Token: 0x060019D7 RID: 6615 RVA: 0x00062290 File Offset: 0x00060490 public override FieldInfo GetField(string name, BindingFlags bindingAttr) { return this._tb.GetField(name, bindingAttr); } /// Returns the public and non-public fields that are declared by this type. /// Returns an array of objects representing the public and non-public fields declared or inherited by this type. An empty array is returned if there are no fields, as specified. /// This must be a bit flag from , such as InvokeMethod, NonPublic, and so on. /// This method is not currently supported in types that are not complete. /// /// /// // Token: 0x060019D8 RID: 6616 RVA: 0x000622A0 File Offset: 0x000604A0 public override FieldInfo[] GetFields(BindingFlags bindingAttr) { return this._tb.GetFields(bindingAttr); } /// Returns the interface implemented (directly or indirectly) by this type, with the specified fully-qualified name. /// Returns a object representing the implemented interface. Returns null if no interface matching name is found. /// The name of the interface. /// If true, the search is case-insensitive. If false, the search is case-sensitive. /// This method is not currently supported in types that are not complete. // Token: 0x060019D9 RID: 6617 RVA: 0x000622B0 File Offset: 0x000604B0 public override Type GetInterface(string name, bool ignoreCase) { return this._tb.GetInterface(name, ignoreCase); } /// Returns an interface mapping for the interface requested. /// The requested interface mapping. /// The type of the interface for which the interface mapping is to be retrieved. /// The type does not implement the interface. // Token: 0x060019DA RID: 6618 RVA: 0x000622C0 File Offset: 0x000604C0 [ComVisible(true)] public override InterfaceMapping GetInterfaceMap(Type interfaceType) { return this._tb.GetInterfaceMap(interfaceType); } /// Returns an array of all the interfaces implemented on this a class and its base classes. /// Returns an array of objects representing the implemented interfaces. If none are defined, an empty array is returned. // Token: 0x060019DB RID: 6619 RVA: 0x000622D0 File Offset: 0x000604D0 public override Type[] GetInterfaces() { return this._tb.GetInterfaces(); } /// Returns all members with the specified name, type, and binding that are declared or inherited by this type. /// Returns an array of objects representing the public and non-public members defined on this type if is used; otherwise, only the public members are returned. /// The name of the member. /// The type of member that is to be returned. /// This must be a bit flag from : InvokeMethod, NonPublic, and so on. /// This method is not currently supported in types that are not complete. // Token: 0x060019DC RID: 6620 RVA: 0x000622E0 File Offset: 0x000604E0 public override MemberInfo[] GetMember(string name, MemberTypes type, BindingFlags bindingAttr) { return this._tb.GetMember(name, type, bindingAttr); } /// Returns the specified members declared or inherited by this type,. /// Returns an array of objects representing the public and non-public members declared or inherited by this type. An empty array is returned if there are no matching members. /// This must be a bit flag from : InvokeMethod, NonPublic, and so on. /// This method is not currently supported in types that are not complete. /// /// /// // Token: 0x060019DD RID: 6621 RVA: 0x000622F0 File Offset: 0x000604F0 public override MemberInfo[] GetMembers(BindingFlags bindingAttr) { return this._tb.GetMembers(bindingAttr); } // Token: 0x060019DE RID: 6622 RVA: 0x00062300 File Offset: 0x00060500 protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { if (types == null) { return this._tb.GetMethod(name, bindingAttr); } return this._tb.GetMethod(name, bindingAttr, binder, callConvention, types, modifiers); } /// Returns all the public and non-public methods declared or inherited by this type, as specified. /// Returns an array of objects representing the public and non-public methods defined on this type if is used; otherwise, only the public methods are returned. /// This must be a bit flag from , such as InvokeMethod, NonPublic, and so on. /// This method is not currently supported in types that are not complete. /// /// /// // Token: 0x060019DF RID: 6623 RVA: 0x00062338 File Offset: 0x00060538 public override MethodInfo[] GetMethods(BindingFlags bindingAttr) { return this._tb.GetMethods(bindingAttr); } /// Returns the specified nested type that is declared by this type. /// A object representing the nested type that matches the specified requirements, if found; otherwise, null. /// The containing the name of the nested type to get. /// A bitmask comprised of one or more that specify how the search is conducted.-or- Zero, to conduct a case-sensitive search for public methods. /// This method is not currently supported in types that are not complete. // Token: 0x060019E0 RID: 6624 RVA: 0x00062348 File Offset: 0x00060548 public override Type GetNestedType(string name, BindingFlags bindingAttr) { return this._tb.GetNestedType(name, bindingAttr); } /// Returns the public and non-public nested types that are declared or inherited by this type. /// An array of objects representing all the types nested within the current that match the specified binding constraints.An empty array of type , if no types are nested within the current , or if none of the nested types match the binding constraints. /// This must be a bit flag from , such as InvokeMethod, NonPublic, and so on. /// This method is not currently supported in types that are not complete. /// /// /// // Token: 0x060019E1 RID: 6625 RVA: 0x00062358 File Offset: 0x00060558 public override Type[] GetNestedTypes(BindingFlags bindingAttr) { return this._tb.GetNestedTypes(bindingAttr); } /// Returns all the public and non-public properties declared or inherited by this type, as specified. /// Returns an array of objects representing the public and non-public properties defined on this type if is used; otherwise, only the public properties are returned. /// This invocation attribute. This must be a bit flag from : InvokeMethod, NonPublic, and so on. /// This method is not currently supported in types that are not complete. /// /// /// // Token: 0x060019E2 RID: 6626 RVA: 0x00062368 File Offset: 0x00060568 public override PropertyInfo[] GetProperties(BindingFlags bindingAttr) { return this._tb.GetProperties(bindingAttr); } // Token: 0x060019E3 RID: 6627 RVA: 0x00062378 File Offset: 0x00060578 protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) { throw this.CreateNotSupportedException(); } // Token: 0x060019E4 RID: 6628 RVA: 0x00062380 File Offset: 0x00060580 protected override bool HasElementTypeImpl() { return this._tb.HasElementType; } /// Invokes the specified member. The method that is to be invoked must be accessible and provide the most specific match with the specified argument list, under the contraints of the specified binder and invocation attributes. /// Returns the return value of the invoked member. /// The name of the member to invoke. This can be a constructor, method, property, or field. A suitable invocation attribute must be specified. Note that it is possible to invoke the default member of a class by passing an empty string as the name of the member. /// The invocation attribute. This must be a bit flag from BindingFlags. /// An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects using reflection. If binder is null, the default binder is used. See . /// The object on which to invoke the specified member. If the member is static, this parameter is ignored. /// An argument list. This is an array of objects that contains the number, order, and type of the parameters of the member to be invoked. If there are no parameters this should be null. /// An array of the same length as with elements that represent the attributes associated with the arguments of the member to be invoked. A parameter has attributes associated with it in the metadata. They are used by various interoperability services. See the metadata specs for details such as this. /// An instance of CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used. (Note that this is necessary to, for example, convert a string that represents 1000 to a double value, since 1000 is represented differently by different cultures.) /// Each parameter in the array gets the value in the corresponding element in the array. If the length of is greater than the length of , the remaining argument values are passed in order. /// This method is not currently supported in types that are not complete. /// /// /// // Token: 0x060019E5 RID: 6629 RVA: 0x00062390 File Offset: 0x00060590 public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) { return this._tb.InvokeMember(name, invokeAttr, binder, target, args, modifiers, culture, namedParameters); } // Token: 0x060019E6 RID: 6630 RVA: 0x000623B8 File Offset: 0x000605B8 protected override bool IsArrayImpl() { return false; } // Token: 0x060019E7 RID: 6631 RVA: 0x000623BC File Offset: 0x000605BC protected override bool IsByRefImpl() { return false; } // Token: 0x060019E8 RID: 6632 RVA: 0x000623C0 File Offset: 0x000605C0 protected override bool IsCOMObjectImpl() { return false; } // Token: 0x060019E9 RID: 6633 RVA: 0x000623C4 File Offset: 0x000605C4 protected override bool IsPointerImpl() { return false; } // Token: 0x060019EA RID: 6634 RVA: 0x000623C8 File Offset: 0x000605C8 protected override bool IsPrimitiveImpl() { return false; } // Token: 0x060019EB RID: 6635 RVA: 0x000623CC File Offset: 0x000605CC protected override bool IsValueTypeImpl() { return true; } /// Checks if the specified custom attribute type is defined. /// true if one or more instance of is defined on this member; otherwise, false. /// The Type object to which the custom attributes are applied. /// Specifies whether to search this member's inheritance chain to find the attributes. /// This method is not currently supported in types that are not complete. // Token: 0x060019EC RID: 6636 RVA: 0x000623D0 File Offset: 0x000605D0 public override bool IsDefined(Type attributeType, bool inherit) { return this._tb.IsDefined(attributeType, inherit); } // Token: 0x060019ED RID: 6637 RVA: 0x000623E0 File Offset: 0x000605E0 public override Type MakeArrayType() { return new ArrayType(this, 0); } /// // Token: 0x060019EE RID: 6638 RVA: 0x000623EC File Offset: 0x000605EC public override Type MakeArrayType(int rank) { if (rank < 1) { throw new IndexOutOfRangeException(); } return new ArrayType(this, rank); } // Token: 0x060019EF RID: 6639 RVA: 0x00062404 File Offset: 0x00060604 public override Type MakeByRefType() { return new ByRefType(this); } // Token: 0x060019F0 RID: 6640 RVA: 0x0006240C File Offset: 0x0006060C public override Type MakePointerType() { return new PointerType(this); } /// Sets a custom attribute using a custom attribute builder. /// An instance of a helper class to define the custom attribute. /// /// is null. // Token: 0x060019F1 RID: 6641 RVA: 0x00062414 File Offset: 0x00060614 public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { this._tb.SetCustomAttribute(customBuilder); } /// Sets a custom attribute using a specified custom attribute blob. /// The constructor for the custom attribute. /// A byte blob representing the attributes. /// /// or is null. // Token: 0x060019F2 RID: 6642 RVA: 0x00062424 File Offset: 0x00060624 [ComVisible(true)] public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) { this.SetCustomAttribute(new CustomAttributeBuilder(con, binaryAttribute)); } // Token: 0x060019F3 RID: 6643 RVA: 0x00062434 File Offset: 0x00060634 private Exception CreateNotSupportedException() { return new NotSupportedException("The invoked member is not supported in a dynamic module."); } // Token: 0x040007A1 RID: 1953 private TypeBuilder _tb; // Token: 0x040007A2 RID: 1954 private FieldBuilder _underlyingField; // Token: 0x040007A3 RID: 1955 private Type _underlyingType; } }