Example #1
0
        private static string GeneratePropertyType(BINProperty metaProperty, Dictionary <uint, string> classNames)
        {
            string type = "";

            if (IsPrimitiveType(metaProperty.type))
            {
                type = TypeToObject[metaProperty.type];
            }
            else if (metaProperty.type == BINValueType.Structure || metaProperty.type == BINValueType.Embedded)
            {
                type = GenerateStructureType(metaProperty, classNames);
            }
            else if (metaProperty.type == BINValueType.Container)
            {
                type = GenerateContainerType(metaProperty, classNames);
            }
            else if (metaProperty.type == BINValueType.Map)
            {
                type = GenerateMapType(metaProperty, classNames);
            }
            else if (metaProperty.type == BINValueType.LinkOffset)
            {
                type = GenerateLinkOffsetType(metaProperty, classNames);
            }
            else if (metaProperty.type == BINValueType.OptionalData)
            {
                type = GenerateOptionalDataType(metaProperty, classNames);
            }

            return(type);
        }
Example #2
0
        private static string GenerateOptionalDataType(BINProperty metaProperty, Dictionary <uint, string> classNames)
        {
            string type = "";

            if (IsPrimitiveType(metaProperty.containerI.type))
            {
                type = TypeToObject[metaProperty.containerI.type];
            }
            else
            {
                type = GuessClassName(metaProperty.otherClass, classNames);
            }

            return("Optional<" + type + ">");
        }
Example #3
0
        private static string GenerateContainerType(BINProperty metaProperty, Dictionary <uint, string> classNames)
        {
            string itemType = "";

            if (IsPrimitiveType(metaProperty.containerI.type))
            {
                itemType = TypeToObject[metaProperty.containerI.type];
            }
            else
            {
                itemType = GuessClassName(metaProperty.otherClass, classNames);
            }

            return("List<" + itemType + ">");
        }
Example #4
0
        private static string GenerateMapType(BINProperty metaProperty, Dictionary <uint, string> classNames)
        {
            string keyType   = TypeToObject[metaProperty.mapI.key];
            string valueType = "";

            if (IsPrimitiveType(metaProperty.mapI.value))
            {
                valueType = TypeToObject[metaProperty.mapI.value];
            }
            else
            {
                valueType = GuessClassName(metaProperty.otherClass, classNames);
            }

            return("Dictionary<" + keyType + ", " + valueType + ">");
        }
Example #5
0
 private static string GenerateLinkOffsetType(BINProperty metaProperty, Dictionary <uint, string> classNames)
 {
     return("Link<" + GuessClassName(metaProperty.otherClass, classNames) + ">");
 }
Example #6
0
 private static string GenerateStructureType(BINProperty metaProperty, Dictionary <uint, string> classNames)
 {
     return(GuessClassName(metaProperty.otherClass, classNames));;
 }