コード例 #1
0
 public PictureExplorer()
 {
     InitializeComponent();
     files = FileProcessor.ScanDirectories(path, IsInnerDirectories.IsChecked.Value);
     foreach (var cur in files)
     {
         sortedFiles.Add(cur);
     }
 }
コード例 #2
0
 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);
 }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: Sem8252/Tagger
 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();
 }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
ファイル: MainWindow.xaml.cs プロジェクト: Sem8252/Tagger
        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);
            }
        }
コード例 #6
0
ファイル: MainWindow.xaml.cs プロジェクト: Sem8252/Tagger
 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();
 }
コード例 #7
0
        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();
            }
        }