private void PathOfListView_KeyDown(object sender, KeyEventArgs e) { if (e.Key != Key.Enter) { return; } var textbox = sender as TextBox; if (!_searchFlag) { if (Directory.Exists(textbox.Text)) { if (textbox.Name.EndsWith("1")) { fileFiller1.OpenEntry(new Folder(textbox.Text)); } else { fileFiller2.OpenEntry(new Folder(textbox.Text)); } } else { MessageBox.Show("Folder not found.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } } }
private void Watcher_Created(object sender, FileSystemEventArgs e) { //For the dynamics var Data = graphicalApp.DataSource; Entity elem = null; if (Directory.Exists(e.FullPath)) { elem = new Folder(e.FullPath); } else if (System.IO.File.Exists(e.FullPath)) { elem = new File(e.FullPath); } dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, (ThreadStart) delegate() { if (elem != null) { Data.Add(elem); } }); }
public ZippedFolder GetRootFolder(MC.Source.Entries.Directory directory) { return(new ZippedFolder(this, "", directory)); }
public void StartWatch(Directory directory) { watcher.Path = directory.FullPath; watcher.EnableRaisingEvents = true; }