예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        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);
                }
            });
        }
예제 #3
0
 public ZippedFolder GetRootFolder(MC.Source.Entries.Directory directory)
 {
     return(new ZippedFolder(this, "", directory));
 }
예제 #4
0
 public void StartWatch(Directory directory)
 {
     watcher.Path = directory.FullPath;
     watcher.EnableRaisingEvents = true;
 }