Python.Runtime.MethodBinder.GetMethods C# (CSharp) Method

GetMethods() private method

private GetMethods ( ) : System.Reflection.MethodBase[]
return System.Reflection.MethodBase[]
	internal MethodBase[] GetMethods() {
	    if (!init) {
		// I'm sure this could be made more efficient.
		list.Sort(new MethodSorter());
		methods = (MethodBase[])list.ToArray(typeof(MethodBase));
		init = true;
	    }
	    return methods;
	}

Usage Example

Example #1
0
        internal bool NeedsDefaultArgs(IntPtr args)
        {
            int pynargs = Runtime.Interop.PyTuple_Size(args);

            MethodBase[] methods = SetterBinder.GetMethods();
            if (methods.Length == 0)
            {
                return(false);
            }

            MethodBase mi = methods[0];

            ParameterInfo[] pi = mi.GetParameters();
            // need to subtract one for the value
            int clrnargs = pi.Length - 1;

            if (pynargs == clrnargs || pynargs > clrnargs)
            {
                return(false);
            }

            for (int v = pynargs; v < clrnargs; v++)
            {
                if (pi[v].DefaultValue == DBNull.Value)
                {
                    return(false);
                }
            }
            return(true);
        }
All Usage Examples Of Python.Runtime.MethodBinder::GetMethods