GetMethod() публичный Метод

Get the method "name" for this class
public GetMethod ( string name ) : MethodRef
name string The method name
Результат MethodRef
Пример #1
0
 internal static MethodRef MethodBodyCtor(ClassRef klass)
 {
     MethodRef ctor = klass.GetMethod(".ctor");
     if (ctor != null)
         return ctor;
     else
     {
         ctor = klass.AddMethod(".ctor", PrimitiveType.Void, new Type[0]);
         ctor.AddCallConv(CallConv.Instance);
         return ctor;
     }
 }
Пример #2
0
        internal static MethodRef AddStaticMethod(ClassRef classRef, string name, PERWAPI.Type retType, PERWAPI.Type[] args)
        {
            MethodRef method = classRef.GetMethod(name, args);

            if (method == null)
                method = classRef.AddMethod(name, retType, args);
            
            return method;
        }
Пример #3
0
        internal static MethodRef AddInstanceMethod(ClassRef classRef, string name, PERWAPI.Type retType, PERWAPI.Type[] args)
        {
            MethodRef method = classRef.GetMethod(name, args);

            if (method == null || method.GetCallConv() != CallConv.Instance)
            {
                method = classRef.AddMethod(name, retType, args);
                method.AddCallConv(CallConv.Instance);
            }
            return method;
        }