CsDebugScript.CodeGen.UserTypes.UserTypeFactory.AddSymbol C# (CSharp) Method

AddSymbol() private method

Adds the symbol to user type factory and generates the user type.
private AddSymbol ( Symbol symbol, XmlType type, string nameSpace, UserTypeGenerationFlags generationFlags ) : UserType
symbol Symbol The non-template symbol.
type XmlType The XML type description.
nameSpace string The namespace.
generationFlags UserTypeGenerationFlags The user type generation flags.
return UserType
        internal UserType AddSymbol(Symbol symbol, XmlType type, string nameSpace, UserTypeGenerationFlags generationFlags)
        {
            UserType userType;

            if (symbol.Tag == SymTagEnum.SymTagEnum)
            {
                userType = new EnumUserType(symbol, nameSpace);
            }
            else if (symbol.Tag == SymTagEnum.SymTagExe)
            {
                userType = new GlobalsUserType(symbol, type, nameSpace);
            }
            else if (generationFlags.HasFlag(UserTypeGenerationFlags.GeneratePhysicalMappingOfUserTypes))
            {
                userType = new PhysicalUserType(symbol, type, nameSpace);
            }
            else
            {
                userType = new UserType(symbol, type, nameSpace);
            }

            symbol.UserType = userType;
            return userType;
        }