private void FileTracker_Created(object sender, FileSystemChangeSet e) { foreach (StorageFile ExceptFile in e.StorageItems) { USBFilePresenter.ThisPage.FileCollection.Add(new RemovableDeviceFile(ExceptFile)); } }
private async void FolderTracker_Created(object sender, FileSystemChangeSet e) { foreach (StorageFolder NewFolder in e.StorageItems) { e.ParentNode.Children.Add(new TreeViewNode { Content = NewFolder, HasUnrealizedChildren = (await NewFolder.GetFoldersAsync()).Count != 0 }); } }
private void FileTracker_Deleted(object sender, FileSystemChangeSet e) { for (int i = 0; i < e.StorageItems.Count; i++) { for (int j = 0; j < USBFilePresenter.ThisPage.FileCollection.Count; j++) { RemovableDeviceFile DeviceFile = USBFilePresenter.ThisPage.FileCollection[j]; if (DeviceFile.RelativeId == ((StorageFile)e.StorageItems[i]).FolderRelativeId) { USBFilePresenter.ThisPage.FileCollection.Remove(DeviceFile); j--; } } } }
private void FolderTracker_Deleted(object sender, FileSystemChangeSet e) { foreach (StorageFolder OldFolder in e.StorageItems) { foreach (var SubNode in from SubNode in e.ParentNode.Children where (SubNode.Content as StorageFolder).FolderRelativeId == OldFolder.FolderRelativeId select SubNode) { if (FolderTree.SelectedNodes.FirstOrDefault() == SubNode) { USBFilePresenter.ThisPage.FileCollection.Clear(); USBFilePresenter.ThisPage.HasFile.Visibility = Visibility.Visible; } e.ParentNode.Children.Remove(SubNode); } } }