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 BeginFinallyBlock ()
45 throw new NotSupportedException ();
48 public LocalBuilder DeclareLocal (params object[] args)
50 throw new NotSupportedException ();
53 public Label DefineLabel ()
55 throw new NotSupportedException ();
58 public void Emit (OpCode opcode)
60 throw new NotSupportedException ();
63 public void Emit (OpCode opcode, object args)
65 throw new NotSupportedException ();
68 public void EmitCall (OpCode opcode, params object[] args)
70 throw new NotSupportedException ();
73 public void EndExceptionBlock ()
75 throw new NotSupportedException ();
78 public void MarkLabel (Label loc)
80 throw new NotSupportedException ();
83 public int ILOffset { get; set; }
86 public class TypeBuilder : Type
88 #region implemented abstract members of MemberInfo
90 public override bool IsDefined (Type attributeType, bool inherit)
92 throw new NotSupportedException ();
95 public override object[] GetCustomAttributes (bool inherit)
97 throw new NotSupportedException ();
100 public override object[] GetCustomAttributes (Type attributeType, bool inherit)
102 throw new NotSupportedException ();
105 public override string Name {
107 throw new NotSupportedException ();
113 #region implemented abstract members of Type
115 public override Type GetInterface (string name, bool ignoreCase)
117 throw new NotSupportedException ();
120 public override Type[] GetInterfaces ()
122 throw new NotSupportedException ();
125 public override Type GetElementType ()
127 throw new NotSupportedException ();
130 public override EventInfo GetEvent (string name, BindingFlags bindingAttr)
132 throw new NotSupportedException ();
135 public override EventInfo[] GetEvents (BindingFlags bindingAttr)
137 throw new NotSupportedException ();
140 public override FieldInfo GetField (string name, BindingFlags bindingAttr)
142 throw new NotSupportedException ();
145 public override FieldInfo[] GetFields (BindingFlags bindingAttr)
147 throw new NotSupportedException ();
150 public override MemberInfo[] GetMembers (BindingFlags bindingAttr)
152 throw new NotSupportedException ();
155 protected override MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
157 throw new NotSupportedException ();
160 public override MethodInfo[] GetMethods (BindingFlags bindingAttr)
162 throw new NotSupportedException ();
165 public override Type GetNestedType (string name, BindingFlags bindingAttr)
167 throw new NotSupportedException ();
170 public override Type[] GetNestedTypes (BindingFlags bindingAttr)
172 throw new NotSupportedException ();
175 public override PropertyInfo[] GetProperties (BindingFlags bindingAttr)
177 throw new NotSupportedException ();
180 protected override PropertyInfo GetPropertyImpl (string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
182 throw new NotSupportedException ();
185 protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
187 throw new NotSupportedException ();
190 protected override TypeAttributes GetAttributeFlagsImpl ()
192 throw new NotSupportedException ();
195 protected override bool HasElementTypeImpl ()
197 throw new NotSupportedException ();
200 protected override bool IsArrayImpl ()
202 throw new NotSupportedException ();
205 protected override bool IsByRefImpl ()
207 throw new NotSupportedException ();
210 protected override bool IsCOMObjectImpl ()
212 throw new NotSupportedException ();
215 protected override bool IsPointerImpl ()
217 throw new NotSupportedException ();
220 protected override bool IsPrimitiveImpl ()
222 throw new NotSupportedException ();
225 public override ConstructorInfo[] GetConstructors (BindingFlags bindingAttr)
227 throw new NotSupportedException ();
230 public override object InvokeMember (string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, string[] namedParameters)
232 throw new NotSupportedException ();
235 public override Assembly Assembly {
237 throw new NotSupportedException ();
241 public override string AssemblyQualifiedName {
243 throw new NotSupportedException ();
247 public override Type BaseType {
249 throw new NotSupportedException ();
253 public override string FullName {
255 throw new NotSupportedException ();
259 public override Guid GUID {
261 throw new NotSupportedException ();
265 public override Module Module {
267 throw new NotSupportedException ();
271 public override string Namespace {
273 throw new NotSupportedException ();
277 public override Type UnderlyingSystemType {
279 throw new NotSupportedException ();
285 public void AddInterfaceImplementation (Type interfaceType)
287 throw new NotSupportedException ();
290 public void AddDeclarativeSecurity (params object[] args)
292 throw new NotSupportedException ();
295 public void SetParent (object arg)
297 throw new NotSupportedException ();
300 public Type CreateType()
302 throw new NotSupportedException ();
305 public ConstructorBuilder DefineConstructor (params object[] args)
307 throw new NotSupportedException ();
310 public MethodBuilder DefineMethod (params object[] args)
312 throw new NotSupportedException ();
315 public TypeBuilder DefineNestedType (params object[] args)
317 throw new NotSupportedException ();
320 public PropertyBuilder DefineProperty (params object[] args)
322 throw new NotSupportedException ();
325 public EventBuilder DefineEvent (params object[] args)
327 throw new NotSupportedException ();
330 public FieldBuilder DefineField (params object[] args)
332 throw new NotSupportedException ();
335 public GenericTypeParameterBuilder[] DefineGenericParameters (params string[] names)
337 throw new NotSupportedException ();
340 public MethodBuilder DefineMethodOverride (params object[] args)
342 throw new NotSupportedException ();
345 public static ConstructorInfo GetConstructor (Type type, ConstructorInfo constructor)
347 throw new NotSupportedException ();
350 public static FieldInfo GetField (Type type, FieldInfo field)
352 throw new NotSupportedException ();
355 public static MethodInfo GetMethod (Type type, MethodInfo method)
357 throw new NotSupportedException ();
360 public void SetCustomAttribute (params object[] args)
362 throw new NotSupportedException ();
366 public class MethodBuilder : MethodBase
368 #region implemented abstract members of MemberInfo
370 public override bool IsDefined (Type attributeType, bool inherit)
372 throw new NotSupportedException ();
375 public override object[] GetCustomAttributes (bool inherit)
377 throw new NotSupportedException ();
380 public override object[] GetCustomAttributes (Type attributeType, bool inherit)
382 throw new NotSupportedException ();
385 public override Type DeclaringType {
387 throw new NotSupportedException ();
391 public override MemberTypes MemberType {
393 throw new NotSupportedException ();
397 public override string Name {
399 throw new NotSupportedException ();
403 public override Type ReflectedType {
405 throw new NotSupportedException ();
411 #region implemented abstract members of MethodBase
413 public override MethodImplAttributes GetMethodImplementationFlags ()
415 throw new NotSupportedException ();
418 public override ParameterInfo[] GetParameters ()
420 throw new NotSupportedException ();
423 public override object Invoke (object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, System.Globalization.CultureInfo culture)
425 throw new NotSupportedException ();
428 public override RuntimeMethodHandle MethodHandle {
430 throw new NotSupportedException ();
434 public override MethodAttributes Attributes {
436 throw new NotSupportedException ();
442 public void AddDeclarativeSecurity (params object[] args)
444 throw new NotSupportedException ();
447 public ParameterBuilder DefineParameter (params object[] args)
449 throw new NotSupportedException ();
452 public GenericTypeParameterBuilder[] DefineGenericParameters (params string[] names)
454 throw new NotSupportedException ();
457 public MethodToken GetToken()
459 throw new NotSupportedException ();
462 public ILGenerator GetILGenerator ()
464 throw new NotSupportedException ();
467 public void SetCustomAttribute (params object[] args)
469 throw new NotSupportedException ();
472 public void SetImplementationFlags (MethodImplAttributes attributes)
474 throw new NotSupportedException ();
477 public void SetParameters (params Type[] parameterTypes)
479 throw new NotSupportedException ();
482 public void SetReturnType (object arg)
484 throw new NotSupportedException ();
488 public class AssemblyBuilder : Assembly
490 public void AddResourceFile (params object[] args)
492 throw new NotSupportedException ();
495 public void DefineVersionInfoResource (params object[] args)
497 throw new NotSupportedException ();
500 public ModuleBuilder DefineDynamicModule (params object[] args)
502 throw new NotSupportedException ();
505 public void DefineUnmanagedResource (params object[] args)
507 throw new NotSupportedException ();
510 public void Save (params object[] args)
512 throw new NotSupportedException ();
515 public void SetEntryPoint (params object[] args)
517 throw new NotSupportedException ();
520 public void SetCustomAttribute (params object[] args)
522 throw new NotSupportedException ();
526 public class LocalBuilder : LocalVariableInfo
530 public class GenericTypeParameterBuilder : Type
532 #region implemented abstract members of MemberInfo
534 public override bool IsDefined (Type attributeType, bool inherit)
536 throw new NotSupportedException ();
539 public override object[] GetCustomAttributes (bool inherit)
541 throw new NotSupportedException ();
544 public override object[] GetCustomAttributes (Type attributeType, bool inherit)
546 throw new NotSupportedException ();
549 public override string Name {
551 throw new NotSupportedException ();
557 #region implemented abstract members of Type
559 public override Type GetInterface (string name, bool ignoreCase)
561 throw new NotSupportedException ();
564 public override Type[] GetInterfaces ()
566 throw new NotSupportedException ();
569 public override Type GetElementType ()
571 throw new NotSupportedException ();
574 public override EventInfo GetEvent (string name, BindingFlags bindingAttr)
576 throw new NotSupportedException ();
579 public override EventInfo[] GetEvents (BindingFlags bindingAttr)
581 throw new NotSupportedException ();
584 public override FieldInfo GetField (string name, BindingFlags bindingAttr)
586 throw new NotSupportedException ();
589 public override FieldInfo[] GetFields (BindingFlags bindingAttr)
591 throw new NotSupportedException ();
594 public override MemberInfo[] GetMembers (BindingFlags bindingAttr)
596 throw new NotSupportedException ();
599 protected override MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
601 throw new NotSupportedException ();
604 public override MethodInfo[] GetMethods (BindingFlags bindingAttr)
606 throw new NotSupportedException ();
609 public override Type GetNestedType (string name, BindingFlags bindingAttr)
611 throw new NotSupportedException ();
614 public override Type[] GetNestedTypes (BindingFlags bindingAttr)
616 throw new NotSupportedException ();
619 public override PropertyInfo[] GetProperties (BindingFlags bindingAttr)
621 throw new NotSupportedException ();
624 protected override PropertyInfo GetPropertyImpl (string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
626 throw new NotSupportedException ();
629 protected override ConstructorInfo GetConstructorImpl (BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
631 throw new NotSupportedException ();
634 protected override TypeAttributes GetAttributeFlagsImpl ()
636 throw new NotSupportedException ();
639 protected override bool HasElementTypeImpl ()
641 throw new NotSupportedException ();
644 protected override bool IsArrayImpl ()
646 throw new NotSupportedException ();
649 protected override bool IsByRefImpl ()
651 throw new NotSupportedException ();
654 protected override bool IsCOMObjectImpl ()
656 throw new NotSupportedException ();
659 protected override bool IsPointerImpl ()
661 throw new NotSupportedException ();
664 protected override bool IsPrimitiveImpl ()
666 throw new NotSupportedException ();
669 public override ConstructorInfo[] GetConstructors (BindingFlags bindingAttr)
671 throw new NotSupportedException ();
674 public override object InvokeMember (string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, string[] namedParameters)
676 throw new NotSupportedException ();
679 public override Assembly Assembly {
681 throw new NotSupportedException ();
685 public override string AssemblyQualifiedName {
687 throw new NotSupportedException ();
691 public override Type BaseType {
693 throw new NotSupportedException ();
697 public override string FullName {
699 throw new NotSupportedException ();
703 public override Guid GUID {
705 throw new NotSupportedException ();
709 public override Module Module {
711 throw new NotSupportedException ();
715 public override string Namespace {
717 throw new NotSupportedException ();
721 public override Type UnderlyingSystemType {
723 throw new NotSupportedException ();
729 public void SetCustomAttribute (params object[] args)
731 throw new NotSupportedException ();
734 public void SetGenericParameterAttributes (GenericParameterAttributes genericParameterAttributes)
736 throw new NotSupportedException ();
739 public void SetInterfaceConstraints (params Type[] interfaceConstraints)
741 throw new NotSupportedException ();
744 public void SetBaseTypeConstraint (Type baseTypeConstraint)
746 throw new NotSupportedException ();
750 public class ConstructorBuilder : MethodBase
752 #region implemented abstract members of MemberInfo
754 public override bool IsDefined (Type attributeType, bool inherit)
756 throw new NotSupportedException ();
759 public override object[] GetCustomAttributes (bool inherit)
761 throw new NotSupportedException ();
764 public override object[] GetCustomAttributes (Type attributeType, bool inherit)
766 throw new NotSupportedException ();
769 public override Type DeclaringType {
771 throw new NotSupportedException ();
775 public override MemberTypes MemberType {
777 throw new NotSupportedException ();
781 public override string Name {
783 throw new NotSupportedException ();
787 public override Type ReflectedType {
789 throw new NotSupportedException ();
795 #region implemented abstract members of MethodBase
797 public override MethodImplAttributes GetMethodImplementationFlags ()
799 throw new NotSupportedException ();
802 public override ParameterInfo[] GetParameters ()
804 throw new NotSupportedException ();
807 public override object Invoke (object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, System.Globalization.CultureInfo culture)
809 throw new NotSupportedException ();
812 public override RuntimeMethodHandle MethodHandle {
814 throw new NotSupportedException ();
818 public override MethodAttributes Attributes {
820 throw new NotSupportedException ();
826 public void AddDeclarativeSecurity (params object[] args)
828 throw new NotSupportedException ();
831 public ParameterBuilder DefineParameter (params object[] args)
833 throw new NotSupportedException ();
836 public MethodToken GetToken()
838 throw new NotSupportedException ();
841 public ILGenerator GetILGenerator ()
843 throw new NotSupportedException ();
846 public void SetCustomAttribute (params object[] args)
848 throw new NotSupportedException ();
851 public void SetImplementationFlags (MethodImplAttributes attributes)
853 throw new NotSupportedException ();
857 public class ModuleBuilder : Module
859 public void DefineManifestResource (params object[] args)
861 throw new NotSupportedException ();
864 public TypeBuilder DefineType (params object[] args)
866 throw new NotSupportedException ();
869 public MethodToken GetToken()
871 throw new NotSupportedException ();
874 public MethodInfo GetArrayMethod (params object[] args)
876 throw new NotSupportedException ();
879 public void SetCustomAttribute (params object[] args)
881 throw new NotSupportedException ();
885 public class PropertyBuilder : PropertyInfo
887 #region implemented abstract members of MemberInfo
889 public override bool IsDefined (Type attributeType, bool inherit)
891 throw new NotSupportedException ();
894 public override object[] GetCustomAttributes (bool inherit)
896 throw new NotSupportedException ();
899 public override object[] GetCustomAttributes (Type attributeType, bool inherit)
901 throw new NotSupportedException ();
904 public override Type DeclaringType {
906 throw new NotSupportedException ();
910 public override string Name {
912 throw new NotSupportedException ();
916 public override Type ReflectedType {
918 throw new NotSupportedException ();
924 #region implemented abstract members of PropertyInfo
926 public override MethodInfo[] GetAccessors (bool nonPublic)
928 throw new NotSupportedException ();
931 public override MethodInfo GetGetMethod (bool nonPublic)
933 throw new NotSupportedException ();
936 public override ParameterInfo[] GetIndexParameters ()
938 throw new NotSupportedException ();
941 public override MethodInfo GetSetMethod (bool nonPublic)
943 throw new NotSupportedException ();
946 public override object GetValue (object obj, BindingFlags invokeAttr, Binder binder, object[] index, System.Globalization.CultureInfo culture)
948 throw new NotSupportedException ();
951 public override void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, object[] index, System.Globalization.CultureInfo culture)
953 throw new NotSupportedException ();
956 public override PropertyAttributes Attributes {
958 throw new NotSupportedException ();
962 public override bool CanRead {
964 throw new NotSupportedException ();
968 public override bool CanWrite {
970 throw new NotSupportedException ();
974 public override Type PropertyType {
976 throw new NotSupportedException ();
982 public MethodToken GetToken()
984 throw new NotSupportedException ();
987 public void SetGetMethod (object arg)
989 throw new NotSupportedException ();
992 public void SetSetMethod (object arg)
994 throw new NotSupportedException ();
997 public void SetCustomAttribute (params object[] args)
999 throw new NotSupportedException ();
1003 public class FieldBuilder : FieldInfo
1005 #region implemented abstract members of MemberInfo
1007 public override bool IsDefined (Type attributeType, bool inherit)
1009 throw new NotSupportedException ();
1012 public override object[] GetCustomAttributes (bool inherit)
1014 throw new NotSupportedException ();
1017 public override object[] GetCustomAttributes (Type attributeType, bool inherit)
1019 throw new NotSupportedException ();
1022 public override Type DeclaringType {
1024 throw new NotSupportedException ();
1028 public override string Name {
1030 throw new NotSupportedException ();
1034 public override Type ReflectedType {
1036 throw new NotSupportedException ();
1042 #region implemented abstract members of FieldInfo
1044 public override object GetValue (object obj)
1046 throw new NotSupportedException ();
1049 public override void SetValue (object obj, object value, BindingFlags invokeAttr, Binder binder, System.Globalization.CultureInfo culture)
1051 throw new NotSupportedException ();
1054 public override FieldAttributes Attributes {
1056 throw new NotSupportedException ();
1060 public override RuntimeFieldHandle FieldHandle {
1062 throw new NotSupportedException ();
1066 public override Type FieldType {
1068 throw new NotSupportedException ();
1074 public void SetConstant (object arg)
1076 throw new NotSupportedException ();
1079 public void SetCustomAttribute (params object[] args)
1081 throw new NotSupportedException ();
1085 public class ParameterBuilder : ParameterInfo
1087 public void SetConstant (object arg)
1089 throw new NotSupportedException ();
1092 public void SetCustomAttribute (params object[] args)
1094 throw new NotSupportedException ();
1098 public class EventBuilder
1100 public void SetAddOnMethod (MethodBuilder mdBuilder)
1102 throw new NotSupportedException ();
1105 public void SetRemoveOnMethod (MethodBuilder mdBuilder)
1107 throw new NotSupportedException ();
1110 public void SetCustomAttribute (params object[] args)
1112 throw new NotSupportedException ();
1116 public class CustomAttributeBuilder
1118 public CustomAttributeBuilder (params object[] args)
1120 throw new NotSupportedException ();