IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IKVM.Reflection.GenericMethodInstance Class Referencesealed

Public Member Functions

override bool Equals (object obj)
 
override int GetHashCode ()
 
override ParameterInfo[] GetParameters ()
 
override MethodImplAttributes GetMethodImplementationFlags ()
 
override MethodBody GetMethodBody ()
 
override MethodInfo MakeGenericMethod (params Type[] typeArguments)
 
override MethodInfo GetGenericMethodDefinition ()
 
override MethodBase __GetMethodOnTypeDefinition ()
 
override Type[] GetGenericArguments ()
 
override MethodInfo[] __GetMethodImpls ()
 

Properties

override Type ReturnType [get]
 
override ParameterInfo ReturnParameter [get]
 
override CallingConventions CallingConvention [get]
 
override MethodAttributes Attributes [get]
 
override string Name [get]
 
override Type DeclaringType [get]
 
override Module Module [get]
 
override int MetadataToken [get]
 
override int __MethodRVA [get]
 
override bool IsGenericMethod [get]
 
override bool IsGenericMethodDefinition [get]
 
override bool ContainsGenericParameters [get]
 

Detailed Description

Definition at line 31 of file GenericMethodInstance.cs.

Member Function Documentation

◆ __GetMethodImpls()

override MethodInfo[] IKVM.Reflection.GenericMethodInstance.__GetMethodImpls ( )

Definition at line 250 of file GenericMethodInstance.cs.

251 {
252 var methods = method.__GetMethodImpls();
253 for (int i = 0; i < methods.Length; i++)
254 methods[i] = (MethodInfo)methods[i].BindTypeParameters(declaringType);
255
256 return methods;
257 }
IKVM.Reflection.MethodInfo MethodInfo

◆ __GetMethodOnTypeDefinition()

override MethodBase IKVM.Reflection.GenericMethodInstance.__GetMethodOnTypeDefinition ( )

Definition at line 195 of file GenericMethodInstance.cs.

196 {
197 return method;
198 }

◆ Equals()

override bool IKVM.Reflection.GenericMethodInstance.Equals ( object obj)

Definition at line 53 of file GenericMethodInstance.cs.

54 {
55 var other = obj as GenericMethodInstance;
56 return other != null
57 && other.method.Equals(method)
58 && other.declaringType.Equals(declaringType)
59 && Util.ArrayEquals(other.methodArgs, methodArgs);
60 }

◆ GetGenericArguments()

override Type[] IKVM.Reflection.GenericMethodInstance.GetGenericArguments ( )

Definition at line 200 of file GenericMethodInstance.cs.

201 {
202 if (methodArgs == null)
203 return method.GetGenericArguments();
204 else
205 return (Type[])methodArgs.Clone();
206 }
IKVM.Reflection.Type Type

◆ GetGenericMethodDefinition()

override MethodInfo IKVM.Reflection.GenericMethodInstance.GetGenericMethodDefinition ( )

Definition at line 180 of file GenericMethodInstance.cs.

181 {
182 if (IsGenericMethod)
183 {
185 return this;
186 else if (declaringType.IsConstructedGenericType)
187 return new GenericMethodInstance(declaringType, method, null);
188 else
189 return method;
190 }
191
192 throw new InvalidOperationException();
193 }

◆ GetHashCode()

override int IKVM.Reflection.GenericMethodInstance.GetHashCode ( )

Definition at line 62 of file GenericMethodInstance.cs.

63 {
64 return declaringType.GetHashCode() * 33 ^ method.GetHashCode() ^ Util.GetHashCode(methodArgs);
65 }

◆ GetMethodBody()

override MethodBody IKVM.Reflection.GenericMethodInstance.GetMethodBody ( )

Definition at line 135 of file GenericMethodInstance.cs.

136 {
137 var md = method as IKVM.Reflection.Reader.MethodDefImpl;
138 if (md != null)
139 return md.GetMethodBody(this);
140
141 throw new NotSupportedException();
142 }
override MethodBody GetMethodBody()

◆ GetMethodImplementationFlags()

override MethodImplAttributes IKVM.Reflection.GenericMethodInstance.GetMethodImplementationFlags ( )

Definition at line 110 of file GenericMethodInstance.cs.

111 {
112 return method.GetMethodImplementationFlags();
113 }

◆ GetParameters()

override ParameterInfo[] IKVM.Reflection.GenericMethodInstance.GetParameters ( )

Definition at line 77 of file GenericMethodInstance.cs.

78 {
79 var parameters = method.GetParameters();
80 for (int i = 0; i < parameters.Length; i++)
81 parameters[i] = new GenericParameterInfoImpl(this, parameters[i]);
82
83 return parameters;
84 }

◆ MakeGenericMethod()

override MethodInfo IKVM.Reflection.GenericMethodInstance.MakeGenericMethod ( params Type[] typeArguments)

Definition at line 149 of file GenericMethodInstance.cs.

150 {
151 return new GenericMethodInstance(declaringType, method, typeArguments);
152 }

Property Documentation

◆ __MethodRVA

override int IKVM.Reflection.GenericMethodInstance.__MethodRVA
get

Definition at line 144 of file GenericMethodInstance.cs.

145 {
146 get { return method.__MethodRVA; }
147 }

◆ Attributes

override MethodAttributes IKVM.Reflection.GenericMethodInstance.Attributes
get

Definition at line 105 of file GenericMethodInstance.cs.

106 {
107 get { return method.Attributes; }
108 }

◆ CallingConvention

override CallingConventions IKVM.Reflection.GenericMethodInstance.CallingConvention
get

Definition at line 100 of file GenericMethodInstance.cs.

101 {
102 get { return method.CallingConvention; }
103 }

◆ ContainsGenericParameters

override bool IKVM.Reflection.GenericMethodInstance.ContainsGenericParameters
get

Definition at line 164 of file GenericMethodInstance.cs.

165 {
166 get
167 {
168 if (declaringType.ContainsGenericParameters)
169 return true;
170
171 if (methodArgs != null)
172 foreach (var type in methodArgs)
173 if (type.ContainsGenericParameters)
174 return true;
175
176 return false;
177 }
178 }

◆ DeclaringType

override Type IKVM.Reflection.GenericMethodInstance.DeclaringType
get

Definition at line 120 of file GenericMethodInstance.cs.

121 {
122 get { return declaringType.IsModulePseudoType ? null : declaringType; }
123 }

◆ IsGenericMethod

override bool IKVM.Reflection.GenericMethodInstance.IsGenericMethod
get

Definition at line 154 of file GenericMethodInstance.cs.

155 {
156 get { return method.IsGenericMethod; }
157 }

◆ IsGenericMethodDefinition

override bool IKVM.Reflection.GenericMethodInstance.IsGenericMethodDefinition
get

Definition at line 159 of file GenericMethodInstance.cs.

160 {
161 get { return method.IsGenericMethodDefinition && methodArgs == null; }
162 }

◆ MetadataToken

override int IKVM.Reflection.GenericMethodInstance.MetadataToken
get

Definition at line 130 of file GenericMethodInstance.cs.

131 {
132 get { return method.MetadataToken; }
133 }

◆ Module

override Module IKVM.Reflection.GenericMethodInstance.Module
get

Definition at line 125 of file GenericMethodInstance.cs.

126 {
127 get { return method.Module; }
128 }

◆ Name

override string IKVM.Reflection.GenericMethodInstance.Name
get

Definition at line 115 of file GenericMethodInstance.cs.

116 {
117 get { return method.Name; }
118 }

◆ ReturnParameter

override ParameterInfo IKVM.Reflection.GenericMethodInstance.ReturnParameter
get

Definition at line 72 of file GenericMethodInstance.cs.

73 {
74 get { return new GenericParameterInfoImpl(this, method.ReturnParameter); }
75 }

◆ ReturnType

override Type IKVM.Reflection.GenericMethodInstance.ReturnType
get

Definition at line 67 of file GenericMethodInstance.cs.

68 {
69 get { return method.ReturnType.BindTypeParameters(this); }
70 }

The documentation for this class was generated from the following file: