3 // System.Reflection.Emit/SignatureHelper.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;
16 using System.Runtime.InteropServices;
18 namespace System.Reflection.Emit {
19 public sealed class SignatureHelper {
20 internal enum SignatureHelperType {
27 private ModuleBuilder module;
28 private Type[] arguments;
29 private SignatureHelperType type;
31 internal SignatureHelper (ModuleBuilder module, SignatureHelperType type)
37 public static SignatureHelper GetFieldSigHelper (Module mod)
39 if (!(mod is ModuleBuilder))
40 throw new NotImplementedException ();
42 return new SignatureHelper ((ModuleBuilder) mod, SignatureHelperType.HELPER_FIELD);
44 public static SignatureHelper GetLocalVarSigHelper (Module mod)
46 if (!(mod is ModuleBuilder))
47 throw new NotImplementedException ();
49 return new SignatureHelper ((ModuleBuilder) mod, SignatureHelperType.HELPER_LOCAL);
52 public static SignatureHelper GetMethodSigHelper( Module mod, CallingConventions callingConvention, Type returnType)
54 throw new NotImplementedException ();
57 public static SignatureHelper GetMethodSigHelper( Module mod, Type returnType, Type[] parameterTypes)
59 throw new NotImplementedException ();
62 public static SignatureHelper GetPropertySigHelper( Module mod, Type returnType, Type[] parameterTypes)
64 throw new NotImplementedException ();
66 public void AddArgument (Type clsArgument)
68 if (arguments != null) {
69 Type[] new_a = new Type [arguments.Length + 1];
70 System.Array.Copy (arguments, new_a, arguments.Length);
71 new_a [arguments.Length] = clsArgument;
74 arguments = new Type [1];
75 arguments [0] = clsArgument;
79 public void AddSentinel ()
81 throw new NotImplementedException ();
84 public override bool Equals (object obj)
86 throw new NotImplementedException ();
89 public override int GetHashCode ()
91 throw new NotImplementedException ();
94 [MethodImplAttribute(MethodImplOptions.InternalCall)]
95 internal extern byte[] get_signature_local ();
97 [MethodImplAttribute(MethodImplOptions.InternalCall)]
98 internal extern byte[] get_signature_field ();
100 public byte[] GetSignature ()
103 case SignatureHelperType.HELPER_LOCAL:
104 return get_signature_local ();
105 case SignatureHelperType.HELPER_FIELD:
106 return get_signature_field ();
108 throw new NotImplementedException ();
112 public override string ToString() {
113 return "SignatureHelper";