/// <summary> /// Gets the matching category for the specified <see cref="Tag"/>. Will return a dummy if no match was found. /// </summary> public static Tag GetCategoryFor(Tag tag) { int index = tag.Value.IndexOf('_'); string prefix = string.Empty; if (index != -1) { prefix = tag.Value.Substring(0, index); } var category = categories.Values.FirstOrDefault(t => t.Value.Equals(prefix, StringComparison.OrdinalIgnoreCase)); return category ?? new Tag { Index = ushort.MaxValue, Value = prefix }; }
private static IEnumerable<Tag> FetchTagsForCategory(Tag category) { return CatalogTagRegistry.FetchTagsForCategory(category.Value).Order().ToArray(); }
private static Tag GetCurrentCategory(Tag currentlySelectedTag) { return CatalogTagRegistry.GetCategoryFor(currentlySelectedTag); }
private static object[] UpdateTagListBox(Tag category, DoubleListBox listBox) { object[] availableTags = FetchTagsForCategory(category).ToObjectArray(); listBox.AssignSecondaryList(availableTags); return availableTags; }
private static IEnumerable <Tag> FetchTagsForCategory(Tag category) { return(CatalogTagRegistry.FetchTagsForCategory(category.Value).Order().ToArray()); }
private static Tag GetCurrentCategory(Tag currentlySelectedTag) { return(CatalogTagRegistry.GetCategoryFor(currentlySelectedTag)); }