3 // System.Reflection.Emit/EnumBuilder.cs
6 // Paolo Molaro (lupus@ximian.com)
8 // (C) 2001 Ximian, Inc. http://www.ximian.com
12 using System.Reflection;
13 using System.Reflection.Emit;
14 using System.Globalization;
15 using System.Runtime.CompilerServices;
17 namespace System.Reflection.Emit {
18 public sealed class EnumBuilder : Type {
19 CustomAttributeBuilder[] cattrs;
21 public override Assembly Assembly {
24 public override string AssemblyQualifiedName {
27 public override Type BaseType {
30 public override Type DeclaringType {
33 public override string FullName {
36 public override Guid GUID {
37 get { return Guid.Empty; }
39 public override Module Module {
42 public override string Name {
45 public override string Namespace {
48 public override Type ReflectedType {
51 public override RuntimeTypeHandle TypeHandle {
52 get { return new RuntimeTypeHandle (); }
54 public TypeToken TypeToken {
55 get { return new TypeToken (); }
57 public FieldBuilder UnderlyingField {
60 public override Type UnderlyingSystemType {
63 /* no need to override
64 public override MemberTypes MemberType {
65 get {return MemberTypes.TypeInfo;}
69 internal EnumBuilder (ModuleBuilder mb, string name, TypeAttributes visibility, Type underlyingType)
73 public Type CreateType ()
78 public FieldBuilder DefineLiteral (string literalName, object literalValue)
82 protected override TypeAttributes GetAttributeFlagsImpl ()
84 return (TypeAttributes)0;
87 protected override ConstructorInfo GetConstructorImpl (
88 BindingFlags bindingAttr, Binder binder, CallingConventions cc,
89 Type[] types, ParameterModifier[] modifiers)
94 public override ConstructorInfo[] GetConstructors( BindingFlags bindingAttr)
99 public override object[] GetCustomAttributes(bool inherit)
104 public override object[] GetCustomAttributes(Type attributeType, bool inherit)
109 public override Type GetElementType()
111 throw new NotSupportedException ();
114 public override EventInfo GetEvent( string name, BindingFlags bindingAttr)
119 public override EventInfo[] GetEvents()
124 public override EventInfo[] GetEvents( BindingFlags bindingAttr)
129 public override FieldInfo GetField( string name, BindingFlags bindingAttr)
134 public override FieldInfo[] GetFields( BindingFlags bindingAttr)
139 public override Type GetInterface( string name, bool ignoreCase)
144 public override InterfaceMapping GetInterfaceMap( Type interfaceType)
146 throw new NotImplementedException ();
149 public override Type[] GetInterfaces()
154 public override MemberInfo[] GetMember( string name, MemberTypes type, BindingFlags bindingAttr)
159 public override MemberInfo[] GetMembers( BindingFlags bindingAttr)
164 protected override MethodInfo GetMethodImpl (
165 string name, BindingFlags bindingAttr, Binder binder,
166 CallingConventions callConvention, Type[] types,
167 ParameterModifier[] modifiers)
173 public override MethodInfo[] GetMethods( BindingFlags bindingAttr)
178 public override Type GetNestedType( string name, BindingFlags bindingAttr)
183 public override Type[] GetNestedTypes( BindingFlags bindingAttr)
188 public override PropertyInfo[] GetProperties( BindingFlags bindingAttr)
193 protected override PropertyInfo GetPropertyImpl (
194 string name, BindingFlags bindingAttr, Binder binder,
195 Type returnType, Type[] types,
196 ParameterModifier[] modifiers)
201 protected override bool HasElementTypeImpl()
203 throw new NotSupportedException ();
206 public override object InvokeMember (
207 string name, BindingFlags invokeAttr, Binder binder,
208 object target, object[] args,
209 ParameterModifier[] modifiers, CultureInfo culture,
210 string[] namedParameters)
215 protected override bool IsArrayImpl()
220 protected override bool IsByRefImpl()
225 protected override bool IsCOMObjectImpl()
230 protected override bool IsPointerImpl()
235 protected override bool IsPrimitiveImpl()
240 protected override bool IsValueTypeImpl()
245 public override bool IsDefined( Type attributeType, bool inherit)
250 public void SetCustomAttribute( CustomAttributeBuilder customBuilder)
252 if (cattrs != null) {
253 CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];
254 cattrs.CopyTo (new_array, 0);
255 new_array [cattrs.Length] = customBuilder;
258 cattrs = new CustomAttributeBuilder [1];
259 cattrs [0] = customBuilder;
263 public void SetCustomAttribute( ConstructorInfo con, byte[] binaryAttribute)
265 SetCustomAttribute (new CustomAttributeBuilder (con, binaryAttribute));
269 public override bool HasGenericArguments {
271 throw new NotImplementedException ();
275 public override bool ContainsGenericParameters {
277 throw new NotImplementedException ();
281 public override bool IsGenericParameter {
283 throw new NotImplementedException ();
287 public override int GenericParameterPosition {
289 throw new NotImplementedException ();
293 public override MethodInfo DeclaringMethod {
295 throw new NotImplementedException ();