/// <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 };
		}
Esempio n. 2
0
			private static IEnumerable<Tag> FetchTagsForCategory(Tag category)
			{
				return CatalogTagRegistry.FetchTagsForCategory(category.Value).Order().ToArray();
			}
Esempio n. 3
0
			private static Tag GetCurrentCategory(Tag currentlySelectedTag)
			{
				return CatalogTagRegistry.GetCategoryFor(currentlySelectedTag);
			}
Esempio n. 4
0
			private static object[] UpdateTagListBox(Tag category, DoubleListBox listBox)
			{
				object[] availableTags = FetchTagsForCategory(category).ToObjectArray();
				listBox.AssignSecondaryList(availableTags);

				return availableTags;
			}
Esempio n. 5
0
 private static IEnumerable <Tag> FetchTagsForCategory(Tag category)
 {
     return(CatalogTagRegistry.FetchTagsForCategory(category.Value).Order().ToArray());
 }
Esempio n. 6
0
 private static Tag GetCurrentCategory(Tag currentlySelectedTag)
 {
     return(CatalogTagRegistry.GetCategoryFor(currentlySelectedTag));
 }