Ejemplo n.º 1
0
        public static void CreateDatabaseEnum(Database database, DatabaseSettings otherSettings = null)
        {
            string path = DatabaseUtilities.GetEnumPath(database.Name);

            if (!string.IsNullOrEmpty(database.EnumPath) && path != database.EnumPath)
            {
                RemoveDatabaseEnum(database);
            }

            string name;

            string[] entries;
            int[]    indecies;

            PrepareEnumValues(database, out name, out entries, out indecies, otherSettings);

            EnumGenerator.WriteEnum(name, path, entries, indecies);

            database.EnumPath     = path;
            database.EnumTypeName = name; //Connects the generated Enum with the Database
        }