2 // monotouch.cs: iOS System.Reflection.Emit API needed to simplify mcs compilation
5 // Marek Safar <marek.safar@gmail.com>
7 // Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 namespace System.Reflection.Emit
31 public class ILGenerator
33 public void BeginCatchBlock (Type exceptionType)
35 throw new NotSupportedException ();
38 public Label BeginExceptionBlock ()
40 throw new NotSupportedException ();
43 public void BeginExceptFilterBlock ()
45 throw new NotSupportedException ();
48 public void BeginFinallyBlock ()
50 throw new NotSupportedException ();
53 public LocalBuilder DeclareLocal (params object[] args)
55 throw new NotSupportedException ();
58 public Label DefineLabel ()
60 throw new NotSupportedException ();
63 public void Emit (OpCode opcode)
65 throw new NotSupportedException ();
68 public void Emit (OpCode opcode, object args)
70 throw new NotSupportedException ();
73 public void EmitCall (OpCode opcode, params object[] args)
75 throw new NotSupportedException ();
78 public void EndExceptionBlock ()
80 throw new NotSupportedException ();
83 public void MarkLabel (Label loc)
85 throw new NotSupportedException ();
88 public int ILOffset { get; set; }
91 public class TypeBuilder : Type
93 #region implemented abstract members of MemberInfo
95 public override bool IsDefined (Type attributeType, bool inherit)
97 throw new NotSupportedException ();
100 public override object[] GetCustomAttributes (bool inherit)
102 throw new NotSupportedException ();
105 public override object[] GetCustomAttributes (Type attributeType, bool inherit)
107 throw new NotSupportedException ();
110 public override string Name {
112 throw new NotSupportedException ();
118 #region implemented abstract members of Type
120 public override Type GetInterface (string name, bool ignoreCase)
122 throw new NotSupportedException ();
125 public override Type[] GetInterfaces ()
127 throw new NotSupportedException ();
130 public override Type GetElementType ()
132 throw new NotSupportedException ();
135 public override EventInfo GetEvent (string name, BindingFlags bindingAttr)
137 throw new NotSupportedException ();
140 public override EventInfo[] GetEvents (BindingFlags bindingAttr)
142 throw new NotSupportedException ();
145 public override FieldInfo GetField (string name, BindingFlags bindingAttr)
147 throw new NotSupportedException ();
150 public override FieldInfo[] GetFields (BindingFlags bindingAttr)
152 throw new NotSupportedException ();
155 public override MemberInfo[] GetMembers (BindingFlags bindingAttr)
157 throw new NotSupportedException ();
160 protected override MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
162 throw new NotSupportedException ();
165 public override MethodInfo[] GetMethods (BindingFlags bindingAttr)
167 throw new NotSupportedException ();
170 public override Type GetNestedType (string name, BindingFlags bindingAttr)
172 throw new NotSupportedException ();
175 public override Type[] GetNestedTypes (BindingFlags bindingAttr)
177 throw new NotSupportedException ();
180 public override PropertyInfo[] GetProperties (BindingFlags bindingAttr)
182 throw new NotSupportedException ();
185 protected override PropertyInfo GetPropertyImpl (string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
187 throw new NotSupportedException ();
190 protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
192 throw new NotSupportedException ();
195 protected override TypeAttributes GetAttributeFlagsImpl ()
197 throw new NotSupportedException ();
200 protected override bool HasElementTypeImpl ()
202 throw new NotSupportedException ();
205 protected override bool IsArrayImpl ()
207 throw new NotSupportedException ();
210 protected override bool IsByRefImpl ()
212 throw new NotSupportedException ();
215 protected override bool IsCOMObjectImpl ()
217 throw new NotSupportedException ();
220 protected override bool IsPointerImpl ()
222 throw new NotSupportedException ();
225 protected override bool IsPrimitiveImpl ()
227 throw new NotSupportedException ();
230 public override ConstructorInfo[] GetConstructors (BindingFlags bindingAttr)
232 throw new NotSupportedException ();
235 public override object InvokeMember (string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, string[] namedParameters)
237 throw new NotSupportedException ();
240 public override Assembly Assembly {
242 throw new NotSupportedException ();
246 public override string AssemblyQualifiedName {
248 throw new NotSupportedException ();
252 public override Type BaseType {
254 throw new NotSupportedException ();
258 public override string FullName {
260 throw new NotSupportedException ();
264 public override Guid GUID {
266 throw new NotSupportedException ();
270 public override Module Module {
272 throw new NotSupportedException ();
276 public override string Namespace {
278 throw new NotSupportedException ();
282 public override Type UnderlyingSystemType {
284 throw new NotSupportedException ();
290 public void AddInterfaceImplementation (Type interfaceType)
292 throw new NotSupportedException ();
295 public void AddDeclarativeSecurity (params object[] args)
297 throw new NotSupportedException ();
300 public void SetParent (object arg)
302 throw new NotSupportedException ();
305 public Type CreateType()
307 throw new NotSupportedException ();
310 public ConstructorBuilder DefineConstructor (params object[] args)
312 throw new NotSupportedException ();
315 public MethodBuilder DefineMethod (params object[] args)
317 throw new NotSupportedException ();
320 public TypeBuilder DefineNestedType (params object[] args)
322 throw new NotSupportedException ();
325 public PropertyBuilder DefineProperty (params object[] args)
327 throw new NotSupportedException ();
330 public EventBuilder DefineEvent (params object[] args)
332 throw new NotSupportedException ();
335 public FieldBuilder DefineField (params object[] args)
337 throw new NotSupportedException ();
340 public GenericTypeParameterBuilder[] DefineGenericParameters (params string[] names)
342 throw new NotSupportedException ();
345 public MethodBuilder DefineMethodOverride (params object[] args)
347 throw new NotSupportedException ();
350 public static ConstructorInfo GetConstructor (Type type, ConstructorInfo constructor)
352 throw new NotSupportedException ();
355 public static FieldInfo GetField (Type type, FieldInfo field)
357 throw new NotSupportedException ();
360 public static MethodInfo GetMethod (Type type, MethodInfo method)
362 throw new NotSupportedException ();
365 public void SetCustomAttribute (params object[] args)
367 throw new NotSupportedException ();
371 public class MethodBuilder : MethodBase
373 #region implemented abstract members of MemberInfo
375 public override bool IsDefined (Type attributeType, bool inherit)
377 throw new NotSupportedException ();
380 public override object[] GetCustomAttributes (bool inherit)
382 throw new NotSupportedException ();
385 public override object[] GetCustomAttributes (Type attributeType, bool inherit)
387 throw new NotSupportedException ();
390 public override Type DeclaringType {
392 throw new NotSupportedException ();
396 public override MemberTypes MemberType {
398 throw new NotSupportedException ();
402 public override string Name {
404 throw new NotSupportedException ();
408 public override Type ReflectedType {
410 throw new NotSupportedException ();
416 #region implemented abstract members of MethodBase
418 public override MethodImplAttributes GetMethodImplementationFlags ()
420 throw new NotSupportedException ();
423 public override ParameterInfo[] GetParameters ()
425 throw new NotSupportedException ();
428 public override object Invoke (object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, System.Globalization.CultureInfo culture)
430 throw new NotSupportedException ();
433 public override RuntimeMethodHandle MethodHandle {
435 throw new NotSupportedException ();
439 public override MethodAttributes Attributes {
441 throw new NotSupportedException ();
447 public void AddDeclarativeSecurity (params object[] args)
449 throw new NotSupportedException ();
452 public ParameterBuilder DefineParameter (params object[] args)
454 throw new NotSupportedException ();
457 public GenericTypeParameterBuilder[] DefineGenericParameters (params string[] names)
459 throw new NotSupportedException ();
462 public MethodToken GetToken()
464 throw new NotSupportedException ();
467 public ILGenerator GetILGenerator ()
469 throw new NotSupportedException ();
472 public void SetCustomAttribute (params object[] args)
474 throw new NotSupportedException ();
477 public void SetImplementationFlags (MethodImplAttributes attributes)
479 throw new NotSupportedException ();
482 public void SetParameters (params Type[] parameterTypes)
484 throw new NotSupportedException ();
487 public void SetReturnType (object arg)
489 throw new NotSupportedException ();
493 public class AssemblyBuilder : Assembly
495 public void AddResourceFile (params object[] args)
497 throw new NotSupportedException ();
500 public void DefineVersionInfoResource (params object[] args)
502 throw new NotSupportedException ();
505 public ModuleBuilder DefineDynamicModule (params object[] args)
507 throw new NotSupportedException ();
510 public void DefineUnmanagedResource (params object[] args)
512 throw new NotSupportedException ();
515 public void Save (params object[] args)
517 throw new NotSupportedException ();
520 public void SetEntryPoint (params object[] args)
522 throw new NotSupportedException ();
525 public void SetCustomAttribute (params object[] args)
527 throw new NotSupportedException ();
531 public class LocalBuilder : LocalVariableInfo
535 public class GenericTypeParameterBuilder : Type
537 #region implemented abstract members of MemberInfo
539 public override bool IsDefined (Type attributeType, bool inherit)
541 throw new NotSupportedException ();
544 public override object[] GetCustomAttributes (bool inherit)
546 throw new NotSupportedException ();
549 public override object[] GetCustomAttributes (Type attributeType, bool inherit)
551 throw new NotSupportedException ();
554 public override string Name {
556 throw new NotSupportedException ();
562 #region implemented abstract members of Type
564 public override Type GetInterface (string name, bool ignoreCase)
566 throw new NotSupportedException ();
569 public override Type[] GetInterfaces ()
571 throw new NotSupportedException ();
574 public override Type GetElementType ()
576 throw new NotSupportedException ();
579 public override EventInfo GetEvent (string name, BindingFlags bindingAttr)
581 throw new NotSupportedException ();
584 public override EventInfo[] GetEvents (BindingFlags bindingAttr)
586 throw new NotSupportedException ();
589 public override FieldInfo GetField (string name, BindingFlags bindingAttr)
591 throw new NotSupportedException ();
594 public override FieldInfo[] GetFields (BindingFlags bindingAttr)
596 throw new NotSupportedException ();
599 public override MemberInfo[] GetMembers (BindingFlags bindingAttr)
601 throw new NotSupportedException ();
604 protected override MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
606 throw new NotSupportedException ();
609 public override MethodInfo[] GetMethods (BindingFlags bindingAttr)
611 throw new NotSupportedException ();
614 public override Type GetNestedType (string name, BindingFlags bindingAttr)
616 throw new NotSupportedException ();
619 public override Type[] GetNestedTypes (BindingFlags bindingAttr)
621 throw new NotSupportedException ();
624 public override PropertyInfo[] GetProperties (BindingFlags bindingAttr)
626 throw new NotSupportedException ();
629 protected override PropertyInfo GetPropertyImpl (string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
631 throw new NotSupportedException ();
634 protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
636 throw new NotSupportedException ();
639 protected override TypeAttributes GetAttributeFlagsImpl ()
641 throw new NotSupportedException ();
644 protected override bool HasElementTypeImpl ()
646 throw new NotSupportedException ();
649 protected override bool IsArrayImpl ()
651 throw new NotSupportedException ();
654 protected override bool IsByRefImpl ()
656 throw new NotSupportedException ();
659 protected override bool IsCOMObjectImpl ()
661 throw new NotSupportedException ();
664 protected override bool IsPointerImpl ()
666 throw new NotSupportedException ();
669 protected override bool IsPrimitiveImpl ()
671 throw new NotSupportedException ();
674 public override ConstructorInfo[] GetConstructors (BindingFlags bindingAttr)
676 throw new NotSupportedException ();
679 public override object InvokeMember (string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, string[] namedParameters)
681 throw new NotSupportedException ();
684 public override Assembly Assembly {
686 throw new NotSupportedException ();
690 public override string AssemblyQualifiedName {
692 throw new NotSupportedException ();
696 public override Type BaseType {
698 throw new NotSupportedException ();
702 public override string FullName {
704 throw new NotSupportedException ();
708 public override Guid GUID {
710 throw new NotSupportedException ();
714 public override Module Module {
716 throw new NotSupportedException ();
720 public override string Namespace {
722 throw new NotSupportedException ();
726 public override Type UnderlyingSystemType {
728 throw new NotSupportedException ();
734 public void SetCustomAttribute (params object[] args)
736 throw new NotSupportedException ();
739 public void SetGenericParameterAttributes (GenericParameterAttributes genericParameterAttributes)
741 throw new NotSupportedException ();
744 public void SetInterfaceConstraints (params Type[] interfaceConstraints)
746 throw new NotSupportedException ();
749 public void SetBaseTypeConstraint (Type baseTypeConstraint)
751 throw new NotSupportedException ();
755 public class ConstructorBuilder : MethodBase
757 #region implemented abstract members of MemberInfo
759 public override bool IsDefined (Type attributeType, bool inherit)
761 throw new NotSupportedException ();
764 public override object[] GetCustomAttributes (bool inherit)
766 throw new NotSupportedException ();
769 public override object[] GetCustomAttributes (Type attributeType, bool inherit)
771 throw new NotSupportedException ();
774 public override Type DeclaringType {
776 throw new NotSupportedException ();
780 public override MemberTypes MemberType {
782 throw new NotSupportedException ();
786 public override string Name {
788 throw new NotSupportedException ();
792 public override Type ReflectedType {
794 throw new NotSupportedException ();
800 #region implemented abstract members of MethodBase
802 public override MethodImplAttributes GetMethodImplementationFlags ()
804 throw new NotSupportedException ();
807 public override ParameterInfo[] GetParameters ()
809 throw new NotSupportedException ();
812 public override object Invoke (object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, System.Globalization.CultureInfo culture)
814 throw new NotSupportedException ();
817 public override RuntimeMethodHandle MethodHandle {
819 throw new NotSupportedException ();
823 public override MethodAttributes Attributes {
825 throw new NotSupportedException ();
831 public void AddDeclarativeSecurity (params object[] args)
833 throw new NotSupportedException ();
836 public ParameterBuilder DefineParameter (params object[] args)
838 throw new NotSupportedException ();
841 public MethodToken GetToken()
843 throw new NotSupportedException ();
846 public ILGenerator GetILGenerator ()
848 throw new NotSupportedException ();
851 public void SetCustomAttribute (params object[] args)
853 throw new NotSupportedException ();
856 public void SetImplementationFlags (MethodImplAttributes attributes)
858 throw new NotSupportedException ();
862 public class ModuleBuilder : Module
864 public void DefineManifestResource (params object[] args)
866 throw new NotSupportedException ();
869 public TypeBuilder DefineType (params object[] args)
871 throw new NotSupportedException ();
874 public MethodToken GetToken()
876 throw new NotSupportedException ();
879 public MethodInfo GetArrayMethod (params object[] args)
881 throw new NotSupportedException ();
884 public void SetCustomAttribute (params object[] args)
886 throw new NotSupportedException ();
890 public class PropertyBuilder : PropertyInfo
892 #region implemented abstract members of MemberInfo
894 public override bool IsDefined (Type attributeType, bool inherit)
896 throw new NotSupportedException ();
899 public override object[] GetCustomAttributes (bool inherit)
901 throw new NotSupportedException ();
904 public override object[] GetCustomAttributes (Type attributeType, bool inherit)
906 throw new NotSupportedException ();
909 public override Type DeclaringType {
911 throw new NotSupportedException ();
915 public override string Name {
917 throw new NotSupportedException ();
921 public override Type ReflectedType {
923 throw new NotSupportedException ();
929 #region implemented abstract members of PropertyInfo
931 public override MethodInfo[] GetAccessors (bool nonPublic)
933 throw new NotSupportedException ();
936 public override MethodInfo GetGetMethod (bool nonPublic)
938 throw new NotSupportedException ();
941 public override ParameterInfo[] GetIndexParameters ()
943 throw new NotSupportedException ();
946 public override MethodInfo GetSetMethod (bool nonPublic)
948 throw new NotSupportedException ();
951 public override object GetValue (object obj, BindingFlags invokeAttr, Binder binder, object[] index, System.Globalization.CultureInfo culture)
953 throw new NotSupportedException ();
956 public override void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, System.Globalization.CultureInfo culture)
958 throw new NotSupportedException ();
961 public override PropertyAttributes Attributes {
963 throw new NotSupportedException ();
967 public override bool CanRead {
969 throw new NotSupportedException ();
973 public override bool CanWrite {
975 throw new NotSupportedException ();
979 public override Type PropertyType {
981 throw new NotSupportedException ();
987 public MethodToken GetToken()
989 throw new NotSupportedException ();
992 public void SetGetMethod (object arg)
994 throw new NotSupportedException ();
997 public void SetSetMethod (object arg)
999 throw new NotSupportedException ();
1002 public void SetCustomAttribute (params object[] args)
1004 throw new NotSupportedException ();
1008 public class FieldBuilder : FieldInfo
1010 #region implemented abstract members of MemberInfo
1012 public override bool IsDefined (Type attributeType, bool inherit)
1014 throw new NotSupportedException ();
1017 public override object[] GetCustomAttributes (bool inherit)
1019 throw new NotSupportedException ();
1022 public override object[] GetCustomAttributes (Type attributeType, bool inherit)
1024 throw new NotSupportedException ();
1027 public override Type DeclaringType {
1029 throw new NotSupportedException ();
1033 public override string Name {
1035 throw new NotSupportedException ();
1039 public override Type ReflectedType {
1041 throw new NotSupportedException ();
1047 #region implemented abstract members of FieldInfo
1049 public override object GetValue (object obj)
1051 throw new NotSupportedException ();
1054 public override void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, System.Globalization.CultureInfo culture)
1056 throw new NotSupportedException ();
1059 public override FieldAttributes Attributes {
1061 throw new NotSupportedException ();
1065 public override RuntimeFieldHandle FieldHandle {
1067 throw new NotSupportedException ();
1071 public override Type FieldType {
1073 throw new NotSupportedException ();
1079 public void SetConstant (object arg)
1081 throw new NotSupportedException ();
1084 public void SetCustomAttribute (params object[] args)
1086 throw new NotSupportedException ();
1090 public class ParameterBuilder : ParameterInfo
1092 public void SetConstant (object arg)
1094 throw new NotSupportedException ();
1097 public void SetCustomAttribute (params object[] args)
1099 throw new NotSupportedException ();
1103 public class EventBuilder
1105 public void SetAddOnMethod (MethodBuilder mdBuilder)
1107 throw new NotSupportedException ();
1110 public void SetRemoveOnMethod (MethodBuilder mdBuilder)
1112 throw new NotSupportedException ();
1115 public void SetCustomAttribute (params object[] args)
1117 throw new NotSupportedException ();
1121 public class CustomAttributeBuilder
1123 public CustomAttributeBuilder (params object[] args)
1125 throw new NotSupportedException ();