GetMethod() public method

Get the method "name" for this class
public GetMethod ( string name ) : MethodRef
name string The method name
return MethodRef
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }