public PictureExplorer() { InitializeComponent(); files = FileProcessor.ScanDirectories(path, IsInnerDirectories.IsChecked.Value); foreach (var cur in files) { sortedFiles.Add(cur); } }
public PictureExplorer(string dirPath) { InitializeComponent(); path = dirPath; files = FileProcessor.ScanDirectories(path, IsInnerDirectories.IsChecked.Value); foreach (var cur in files) { sortedFiles.Add(cur); } //var tagLibrary = TagLib.ReadFromFile(path); //var tags = TagLib.GetAllTags(tagLibrary).OrderBy(x => x); }
private void DeleteTagButton_Click(object sender, RoutedEventArgs e) { //Rescan(); if (checkedPictures == 0) { FileProcessor.RemoveTag(files, TagListComboBox.SelectionBoxItem.ToString()); } else { FileProcessor.RemoveTag(checkedImages, TagListComboBox.SelectionBoxItem.ToString()); } Rescan(); }
private void IsInnerDirectories_Checked(object sender, RoutedEventArgs e) { if (checkMarks.Count == 0) { grid.Children.Clear(); files = FileProcessor.ScanDirectories(path, IsInnerDirectories.IsChecked.Value); sortedFiles.Clear(); foreach (var cur in files) { sortedFiles.Add(cur); } Scan_Click(this, e); } }
private void AddAll(string tag) { var toUse = TagLib.TagsToWrite(tagLibrary, tag); Rescan(); List <FileInfo> toTag = new List <FileInfo>(checkedImages); foreach (var curTag in toUse) { FileProcessor.AddTag(toTag, curTag); Rescan(); toTag.Clear(); toTag = new List <FileInfo>(checkedImages); } }
private void addTagKey(List <FileInfo> filesToTag) { Rescan(); if (!(TextBoxTag.Text.Contains('%') || (TextBoxTag.Text == ""))) { if (tagLibrary.Find(x => x[1].Equals(TextBoxTag.Text)) != null) { AddAll(TextBoxTag.Text); } else { FileProcessor.AddTag(filesToTag, TextBoxTag.Text); } } Rescan(); }
private void Scan_Click(object sender, RoutedEventArgs e) { //files = FileProcessor.ScanDirectories(path, IsInnerDirectories.IsChecked.Value); //List<string> tagsToSearch = new List<string>(); files = FileProcessor.ScanDirectories(path, IsInnerDirectories.IsChecked.Value); sortedFiles.Clear(); foreach (var cur in files) { sortedFiles.Add(cur); } var tagsToSearch = SearchBox.Text.Split(' '); //if(SearchBox.Text=="") foreach (var tag in tagsToSearch) { if (tag.Length > 1) { if (tag[0] == '-') { var badFiles = sortedFiles.FindAll(x => x.FullName.Contains(tag.Substring(1))); foreach (var file in badFiles) { sortedFiles.Remove(file); } } else { sortedFiles = sortedFiles.FindAll(x => x.FullName.Contains(tag)); } } } if (checkMarks.Count == 0) { redraw(); } }