예제 #1
0
 public FileOpener(EntityClasses.File file)
 {
     File   = file;
     window = new TextEditorWindow();
     window.Show();
     window.SearchButt.Click   += SearchWord;
     window.ClearTagButt.Click += ParseHtml;
     window.Closing            += EditorShutDown;
 }
예제 #2
0
        private void CutClick(object sender, RoutedEventArgs e)
        {
            TreeViewItem selected = (TreeViewItem)leftFileTree.SelectedItem ?? (TreeViewItem)rightFileTree.SelectedItem;

            if (selected != null)
            {
                MyFile file = new MyFile(selected.Tag.ToString());
                file.Cut();
                return;
            }
            selected = (TreeViewItem)leftFolderTree.SelectedItem ?? (TreeViewItem)rightFolderTree.SelectedItem;
            if (selected != null)
            {
                new Folder(selected.Tag.ToString()).Cut();
            }
        }
예제 #3
0
        private void DeleteFile(object sender, RoutedEventArgs e)
        {
            TreeViewItem selected = (TreeViewItem)leftFileTree.SelectedItem ?? (TreeViewItem)rightFileTree.SelectedItem;

            if (selected != null)
            {
                MyFile file = new MyFile(selected.Tag.ToString());
                file.Delete();
                left.FillFileTree(left.CurrentLocation);
                right.FillFileTree(right.CurrentLocation);
                return;
            }
            TreeViewItem lselected = (TreeViewItem)leftFolderTree.SelectedItem ?? (TreeViewItem)rightFolderTree.SelectedItem;

            if (lselected != null)
            {
                Folder folder = new Folder(lselected.Tag.ToString());
                folder.Delete();
                try
                {
                    TreeViewItem parent = ((TreeViewItem)lselected.Parent);
                    left.RefreshSubFolders(parent);
                }
                catch (InvalidCastException)
                {
                    left.FillFolderTree();
                }
                return;
            }
            TreeViewItem rselected = (TreeViewItem)rightFolderTree.SelectedItem;

            if (rselected != null)
            {
                Folder       folder = new Folder(rselected.Tag.ToString());
                TreeViewItem parent = ((TreeViewItem)rselected.Parent);
                try
                {
                    right.RefreshSubFolders(parent);
                    folder.Delete();
                }
                catch (InvalidCastException)
                {
                    right.FillFolderTree();
                }
                return;
            }
        }