示例#1
0
 private async void FindRun(Object obj)
 {
     TimerForWPF.Stop();
     TimerForWPF.Start();
     Model.RootFileOrFolder = new FileOrFolder
     {
         Name              = RootFolder,
         IsFile            = false,
         Path              = RootFolder,
         ChldFileOrFolders = new System.Collections.ObjectModel.ObservableCollection <FileOrFolder>()
     };
     Model.FilterForSearch = new FilterForSearch {
         Name = TemplateNameFile ?? "*.*", Content = ContentFile ?? ""
     };
     FileOrFolder.Clear();
     if (await Model.SearchRun())
     {
         TimerForWPF.Pause();
         if (Model.RootFileOrFolder != null)
         {
             FileOrFolder.Add(Model.RootFileOrFolder);
         }
         OnPropertyChanged("FileOrFolder");
     }
 }
示例#2
0
 private void StopRun(Object obj)
 {
     if (Model.SearchStatus == SearchStatus.NotRun)
     {
         return;
     }
     Model.Stop();
     TimerForWPF.Stop();
 }
示例#3
0
 private void PauseRun(Object obj)
 {
     if (Model.SearchStatus == SearchStatus.NotRun)
     {
         return;
     }
     if (Model.SearchStatus == SearchStatus.Pause)
     {
         if (obj is Button button1)
         {
             button1.Background = new SolidColorBrush(Color.FromArgb(221, 221, 221, 221));
         }
         Model.Resume();
         TimerForWPF.Resume();
         return;
     }
     if (obj is Button button)
     {
         button.Background = Brushes.Aqua;
     }
     Model.Pause();
     TimerForWPF.Pause();
 }