System.Runtime.Remoting.MetadataServices.SdlParser.MapSchemaTypesToCSharpTypes C# (CSharp) Method

MapSchemaTypesToCSharpTypes() private static method

private static MapSchemaTypesToCSharpTypes ( String fullTypeName ) : String
fullTypeName String
return String
        private static String MapSchemaTypesToCSharpTypes(String fullTypeName)
        {
            Util.Log("SdlParser.MapSchemaTypesToCSharpTypes Enter fullTypeName "+fullTypeName);
            // Check for array types
            String typeName = fullTypeName;
            int index = fullTypeName.IndexOf('[');
            if(index != -1)
                typeName = fullTypeName.Substring(0, index);

            String newTypeName = typeName;
            // Handle byte and sbyte
            if(typeName == "unsigned-byte" || typeName == "binary")
                newTypeName = "byte";
            else if(typeName == "byte")
                newTypeName = "sbyte";
            // Handle unsigned versions
            // short, int, long, float, double, decimal are the same
            else if(typeName.StartsWith("unsigned-"))
                newTypeName = 'u' + typeName.Substring("unsigned-".Length);
            // Handle bool type
            else if(typeName == "boolean")
                newTypeName = "bool";
            // Schemas have not yet defined char type
            else if(typeName == "string")
                newTypeName = "String";
            else if(typeName == "character")
                newTypeName = "char";
            else if(typeName == "ur-type")
                newTypeName = "Object";
            else if(typeName == "timeInstant")
                newTypeName = "DateTime";

            // Handle array types
            if(index != -1)
                newTypeName = newTypeName + fullTypeName.Substring(index);
            Util.Log("SdlParser.MapSchemaTypesToCSharpTypes Exit Type "+newTypeName);           
            return(newTypeName);
        }