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

ArgPrecedence() static private method

static private ArgPrecedence ( Type t ) : int
t System.Type
return int
	internal static int ArgPrecedence(Type t) {
	    Type objectType = typeof(Object);
	    if (t == objectType) return 3000;

	    TypeCode tc = Type.GetTypeCode(t);
	    if (tc == TypeCode.Object) return 1;
	    if (tc == TypeCode.UInt64) return 10;
	    if (tc == TypeCode.UInt32) return 11;
	    if (tc == TypeCode.UInt16) return 12;
	    if (tc == TypeCode.Int64) return 13;
	    if (tc == TypeCode.Int32) return 14;
	    if (tc == TypeCode.Int16) return 15;
	    if (tc == TypeCode.Char) return 16;
	    if (tc == TypeCode.SByte) return 17;
	    if (tc == TypeCode.Byte) return 18;
	    if (tc == TypeCode.Single) return 20;
	    if (tc == TypeCode.Double) return 21;
	    if (tc == TypeCode.String) return 30;
	    if (tc == TypeCode.Boolean) return 40;

	    if (t.IsArray) {
		Type e = t.GetElementType();
		if (e == objectType)
		    return 2500;
		return 100 + ArgPrecedence(e);
	    }

	    return 2000;
	}