Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetMethodTokenInternal()

int System.Reflection.Emit.ModuleBuilder.GetMethodTokenInternal ( MethodBase method,
Type[] optionalParameterTypes,
bool useMethodDef )
inlinepackage

Definition at line 976 of file ModuleBuilder.cs.

977 {
978 MethodInfo methodInfo = method as MethodInfo;
979 if (method.IsGenericMethod)
980 {
981 MethodInfo methodInfo2 = methodInfo;
982 bool isGenericMethodDefinition = methodInfo.IsGenericMethodDefinition;
984 {
985 methodInfo2 = methodInfo.GetGenericMethodDefinition();
986 }
987 int num = ((Equals(methodInfo2.Module) && (!(methodInfo2.DeclaringType != null) || !methodInfo2.DeclaringType.IsGenericType)) ? GetMethodToken(methodInfo2) : GetMemberRefToken(methodInfo2, null));
989 {
990 return num;
991 }
992 int length;
993 byte[] signature = SignatureHelper.GetMethodSpecSigHelper(this, methodInfo.GetGenericArguments()).InternalGetSignature(out length);
994 ModuleBuilder module = this;
995 return TypeBuilder.DefineMethodSpec(new QCallModule(ref module), num, signature, length);
996 }
997 if ((method.CallingConvention & CallingConventions.VarArgs) == 0 && (method.DeclaringType == null || !method.DeclaringType.IsGenericType))
998 {
999 if (methodInfo != null)
1000 {
1001 return GetMethodToken(methodInfo);
1002 }
1003 return GetConstructorToken(method as ConstructorInfo);
1004 }
1006 }
int GetConstructorToken(ConstructorInfo con)
int GetMemberRefToken(MethodBase method, Type[] optionalParameterTypes)
ModuleBuilder(AssemblyBuilder assemblyBuilder, InternalModuleBuilder internalModuleBuilder)
int GetMethodToken(MethodInfo method)
override bool Equals(object? obj)

References System.Reflection.Emit.TypeBuilder.DefineMethodSpec(), System.Reflection.Emit.ModuleBuilder.Equals(), System.Reflection.Emit.ModuleBuilder.GetConstructorToken(), System.Reflection.Emit.ModuleBuilder.GetMemberRefToken(), System.Reflection.Emit.SignatureHelper.GetMethodSpecSigHelper(), System.Reflection.Emit.ModuleBuilder.GetMethodToken(), and System.length.