Esempio n. 1
0
 public void RefreshFiles(string path)
 {
     try {
         FileOperation.LoadFiles(path);
     } catch (Exception ex) { MessageBox.Show(ex.Message); }
 }
Esempio n. 2
0
 private void CreateNewFolder()
 {
     try {
         FileOperation.CreateFolder(CurrentLocation, null, true);
     } catch (Exception e) { MessageBox.Show("from Base: OnCreateNewFolder: \n" + e); }
 }
Esempio n. 3
0
 private void CreateNewDocument()
 {
     try {
         FileOperation.CreateDocument(CurrentLocation, true);
     } catch (Exception e) { MessageBox.Show("from Base: OnCreateNewDocument: \n" + e); }
 }
Esempio n. 4
0
        private void CreateContextMenu()
        {
            m_open   = new MenuItem("Open");
            m_cut    = new MenuItem("Cut");
            m_copy   = new MenuItem("Copy");
            m_delete = new MenuItem("Delete");
            m_paste  = new MenuItem("Paste");
            m_rename = new MenuItem("Rename");
            m_prop   = new MenuItem("Properties");

            m_open.Click += (o, e) => {
                FileDoubleClicked();
            };

            m_cut.Click += (o, e) => {
                b.CutClicked = true;
                b.pn_flow.ContextMenu.MenuItems[2].Enabled = true;
                SelectedFiles.SetCopyBuffer();
            };

            m_copy.Click += (o, e) => {
                b.CopyClicked = true;
                b.pn_flow.ContextMenu.MenuItems[2].Enabled = true;
                SelectedFiles.SetCopyBuffer();
            };

            m_delete.Click += (o, e) => {
                try {
                    FileOperation.DeleteFiles(SelectedFiles.GetNames());
                    b.LoadFiles(b.CurrentLocation);
                } catch (Exception ex) { MessageBox.Show(ex.Message); UnSelectFile(); }
            };


            m_paste.Click += (o, e) => {
                b.PasteFiles();
            };

            m_rename.Click += (o, e) => {
                RenameFile();
            };

            m_prop.Click += (o, e) => {
                FileProperties();
            };

            ContextMenu menu = new ContextMenu(new MenuItem[] { m_open, m_cut, m_copy, m_delete, m_rename, m_prop });

            fl_file.ContextMenu = menu;

            fl_file.ContextMenu.Popup += (o, ev) => {
                if (b.CutClicked || b.CopyClicked)
                {
                    if (!fl_file.ContextMenu.MenuItems.Contains(m_paste))
                    {
                        fl_file.ContextMenu.MenuItems.Add(4, m_paste);
                    }
                }
                else if (fl_file.ContextMenu.MenuItems.Contains(m_paste))
                {
                    fl_file.ContextMenu.MenuItems.Remove(m_paste);
                }
            };
        }