private void load(string path) { current = path; IMedia media = Data.Media[path]; IMediaViewer viewer = Registry.Viewers[Registry.SupportedDataTypes[media.FileType]]; viewer.LoadMedia(path, true); frmViewer.Content = viewer.Display; stkTags.Children.Clear(); foreach (int i in media.GetTags()) { ToggleButton tb = new ToggleButton() { Content = Data.Tags[Data.TagLocations[i]].Name, Style = (Style)Application.Current.Resources["Tag Button"], Tag = i }; tb.Checked += handleTagClick; stkTags.Children.Add(tb); } }
/// <summary> /// Returns true if the provided media object contains the tags /// </summary> /// <param name="SearchTags"></param> /// <param name="M"></param> /// <returns></returns> public static bool CheckMedia(int[] SearchTags, int[] ExcludeTags, IMedia M) { int[] tags = M.GetTags(); bool match = true; foreach (int i in SearchTags) { if (!tags.Contains(i)) { match = false; break; } } if (match) { foreach (int i in ExcludeTags) { if (tags.Contains(i)) { match = false; break; } } } if (match) { foreach (int i in tags) { if (!ShowHiddenTags && HiddenTags.Contains(i)) { match = false; break; } } } return(match); }