Пример #1
0
        private void AddCategory(CategoryDescriptor category)
        {
#if CCDEBUG
            Control.Logger.LogDebug($"Add Category: {category.Name}");
#endif
            if (Categories.TryGetValue(category.Name, out var c))
            {
#if CCDEBUG
                Control.Logger.LogDebug($"Already have, apply: {category.Name}");
#endif
                c.Apply(category);
            }
            else
            {
#if CCDEBUG
                Control.Logger.LogDebug($"Adding new: {category.Name}");
#endif
                Categories.Add(category.Name, category);
                category.InitDefaults();
            }

#if CCDEBUG
            Control.Logger.LogDebug($"Current Categories");
            foreach (var categoryDescriptor in Categories)
            {
                Control.Logger.LogDebug($" - {categoryDescriptor.Value.Name}");
            }
#endif
        }