Beispiel #1
0
 public File(Directory parent, string path, string name, Image image)
 {
     Name = name;
     Image = image;
     Parent = parent;
     Path = path;
 }
 public Task Search(Directory directory)
 {
     Action<object> action = null;
     action = (f) => {
         Directory folder = (Directory)f;
         var asyncCommand = this.GetAsyncCommand(x => x.Search(null));
         foreach (File item in folder.LoadFiles(Filter.Filter, false)) {
             if (asyncCommand.IsCancellationRequested) {
                 break;
             }
             if (item is Directory) {
                 Task.Factory.StartNew(action, item, TaskCreationOptions.AttachedToParent);
             }
             else {
                 if (item.Name.ToLower().Contains(SearchText.ToLower())) {
                     DispatcherService.BeginInvoke(() => { Files.Add(item);});
                 }
             }
         }
     };
     return Task.Factory.StartNew(action, directory);
 }
Beispiel #3
0
 protected Back(Directory parent, string path, string name, Image image)
     : base(parent, path, name, image)
 {
 }
Beispiel #4
0
 public Directory(Directory parent, string path, string name, Image image)
     : base(parent, path, name, image)
 {
 }
 public void Return(Directory directory)
 {
     ParentFolder = directory.Parent;
 }
 public bool CanReturn(Directory directory)
 {
     return !(directory is Root);
 }
 private void LoadFiles(Directory directory)
 {
     Files = directory.LoadFiles(ExtensionFilter.Filter);
     if (!(directory is Root)) {
         Files.Insert(0, Back.Instance);
     }
     this.RaisePropertyChanged(vm => vm.Files);
 }