System.Xml.Xsl.XsltOld.XsltCompileContext.GetXPathType C# (CSharp) Method

GetXPathType() public static method

public static GetXPathType ( Type type ) : XPathResultType
type Type
return XPathResultType
        public static XPathResultType GetXPathType(Type type) {
            switch(Type.GetTypeCode(type)) {
            case TypeCode.String :
                return XPathResultType.String;
            case TypeCode.Boolean :
                return XPathResultType.Boolean;
            case TypeCode.Object :
                if (
                    typeof(XPathNavigator ).IsAssignableFrom(type) ||
                    typeof(IXPathNavigable).IsAssignableFrom(type)
                ) {
                    return XPathResultType.Navigator;
                }
                if (typeof(XPathNodeIterator).IsAssignableFrom(type)) {
                    return XPathResultType.NodeSet;
                }
                return XPathResultType.Any;
            case TypeCode.DateTime :
                return XPathResultType.Error;
            default: /* all numeric types */
                return XPathResultType.Number;
            }
        }