示例#1
0
 public SystemTagSet(SystemTagSet copy) : this(copy.Name, copy.Category)
 {
     foreach (var tag in copy.Tags.Values)
     {
         AddTag(tag.Id, tag.Name);
     }
 }
示例#2
0
        public static void Init()
        {
            TagSets.Clear();

            if (Program.MainForm != null)
            {
                Program.MainForm.ProgressStatus.Minimum = 0;
                Program.MainForm.ProgressStatus.Maximum = Enum.GetValues(typeof(TagCategoryTypes)).Length;
                Program.MainForm.ProgressStatus.Value   = 0;
            }

            foreach (var category in EnumerationFunctions.GetAllEnumValues <TagCategoryTypes>())
            {
                var tagSet = new SystemTagSet(category.ToString(), category);
                tagSet.AddTags(category);
                TagSets.Add(category.ToString(), tagSet);

                Application.DoEvents();
                if (Program.MainForm == null)
                {
                    continue;
                }

                Program.MainForm.ProgressStatus.Value++;
                Program.MainForm.SetStatusMessage($"Loading Tag Category [{category}]");
            }

            Program.Log.InfoFormat($"{Enum.GetValues(typeof(TagCategoryTypes)).Length} tag categories loaded.");
        }