コード例 #1
0
        public override void Do(ActionPerformerArgs actionPerformerArgs)
        {
            PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender;

            var root = Path.GetPathRoot(panelSet.FocusedListView.SelectedItem.Item.FullName);

            panelSet.FocusedListView.Current = new DirectoryInfo(root);

            panelSet.RefreshFocusedPanel();
        }
コード例 #2
0
        public override void Do(ActionPerformerArgs actionPerformerArgs)
        {
            PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender;

            var parent = Directory.GetParent(panelSet.FocusedListView.Current.FullName)
                         ?? new DirectoryInfo(Path.GetPathRoot(panelSet.FocusedListView.Current.FullName));

            panelSet.FocusedListView.Current = parent;

            panelSet.RefreshFocusedPanel();
        }
コード例 #3
0
        public override void Do(ActionPerformerArgs actionPerformerArgs)
        {
            PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender;

            PopupInput popupInput = new PopupInput(panelSet, "Enter new folder name:");

            popupInput.Render();
            string newName = popupInput.UserInputResult;

            var currentPath = panelSet.FocusedListView.Current.FullName + "\\" + newName;

            Directory.CreateDirectory(currentPath);

            panelSet.RefreshFocusedPanel();
        }
コード例 #4
0
ファイル: Paste.cs プロジェクト: BlackMoonRider/FileManager
        public override void Do(ActionPerformerArgs actionPerformerArgs)
        {
            PanelSet panelSet = (PanelSet)actionPerformerArgs.Sender;

            FileSystemInfo senderInfo = panelSet.FocusedListView.Current;
            FileSystemInfo sourceInfo = panelSet.CurrentItemToOperateOn.Item;

            var action = panelSet.CurrentAction;

            var source      = sourceInfo.FullName;
            var destination = senderInfo.FullName + "\\" + sourceInfo.Name;

            if (sourceInfo is FileInfo)
            {
                if (action == Actions.Copy)
                {
                    File.Copy(source, destination);
                }

                else if (action == Actions.Cut)
                {
                    File.Move(source, destination);
                }
            }

            else if (sourceInfo is DirectoryInfo)
            {
                if (action == Actions.Copy)
                {
                    Utility.DirectoryCopy(source, destination);
                }

                else if (action == Actions.Cut)
                {
                    Directory.Move(source, destination);
                }
            }

            if (action == Actions.Copy)
            {
                panelSet.RefreshFocusedPanel();
            }

            else if (action == Actions.Cut)
            {
                panelSet.RefreshScreen();
            }
        }