24using System.Runtime.InteropServices;
29 internal sealed class __StandAloneMethodSig
32 readonly
bool unmanaged;
34 readonly CallingConventions callingConvention;
35 readonly
Type returnType;
36 readonly
Type[] parameterTypes;
37 readonly
Type[] optionalParameterTypes;
38 readonly PackedCustomModifiers customModifiers;
50 internal __StandAloneMethodSig(
bool unmanaged,
CallingConvention unmanagedCallingConvention, CallingConventions callingConvention,
Type returnType,
Type[] parameterTypes,
Type[] optionalParameterTypes, PackedCustomModifiers customModifiers)
52 this.unmanaged = unmanaged;
53 this.unmanagedCallingConvention = unmanagedCallingConvention;
54 this.callingConvention = callingConvention;
55 this.returnType = returnType;
56 this.parameterTypes = parameterTypes;
57 this.optionalParameterTypes = optionalParameterTypes;
58 this.customModifiers = customModifiers;
61 public bool Equals(__StandAloneMethodSig other)
64 && other.unmanaged == unmanaged
65 && other.unmanagedCallingConvention == unmanagedCallingConvention
66 && other.callingConvention == callingConvention
67 && other.returnType == returnType
68 && Util.ArrayEquals(other.parameterTypes, parameterTypes)
69 && Util.ArrayEquals(other.optionalParameterTypes, optionalParameterTypes)
70 && other.customModifiers.Equals(customModifiers);
73 public override bool Equals(
object obj)
75 return Equals(obj as __StandAloneMethodSig);
78 public override int GetHashCode()
80 return returnType.GetHashCode()
81 ^ Util.GetHashCode(parameterTypes);
84 public bool IsUnmanaged
86 get {
return unmanaged; }
91 get {
return callingConvention; }
96 get {
return unmanagedCallingConvention; }
99 public Type ReturnType
101 get {
return returnType; }
104 public CustomModifiers GetReturnTypeCustomModifiers()
106 return customModifiers.GetReturnTypeCustomModifiers();
109 public Type[] ParameterTypes
111 get {
return Util.Copy(parameterTypes); }
114 public Type[] OptionalParameterTypes
116 get {
return Util.Copy(optionalParameterTypes); }
119 public CustomModifiers GetParameterCustomModifiers(
int index)
121 return customModifiers.GetParameterCustomModifiers(index);
124 public bool ContainsMissingType
128 return returnType.__ContainsMissingType
129 ||
Type.ContainsMissingType(parameterTypes)
130 ||
Type.ContainsMissingType(optionalParameterTypes)
131 || customModifiers.ContainsMissingType;
135 internal int ParameterCount
137 get {
return parameterTypes.Length + optionalParameterTypes.Length; }
IKVM.Reflection.Type Type
System.Runtime.InteropServices.CallingConvention CallingConvention