示例#1
0
        public void ShowPanel()
        {
            string currentDirectory = A.Psf.SyncPaths();

            try
            {
                string drive = UI.SelectMenu.SelectDrive(null, true);
                if (drive == null)
                {
                    return;
                }

                AnyPanel ap;
                if (drive == "Folder &tree")
                {
                    ap = new FolderTree();
                }
                else if (drive == "&Any objects")
                {
                    ap = new ObjectPanel();
                }
                else
                {
                    ap = new ItemPanel(drive);
                }
                ap.Open();
            }
            finally
            {
                A.SetCurrentDirectoryFinally(currentDirectory);
            }
        }
示例#2
0
文件: Actor.cs 项目: fcenobi/FarNet
        public void ShowPanel()
        {
            string currentDirectory = A.Psf.SyncPaths();

            try
            {
                string drive = UI.SelectMenu.SelectPowerPanel();
                if (drive == null)
                {
                    return;
                }

                AnyPanel ap;
                if (drive == UI.SelectMenu.TextFolderTree)
                {
                    ap = new FolderTree();
                }
                else if (drive == UI.SelectMenu.TextAnyObjects)
                {
                    ap = new ObjectPanel();
                }
                else
                {
                    ap = new ItemPanel(drive);
                }
                ap.Open();
            }
            finally
            {
                A.SetCurrentDirectoryFinally(currentDirectory);
            }
        }
示例#3
0
        /// <summary>
        /// Opens the path on another panel for the FileSystem provider or an item panel as a child of this panel for other providers.
        /// </summary>
        /// <param name="file">The file to open.</param>
        public override void OpenFile(FarFile file)
        {
            // base
            if (UserWants != UserAction.Enter)
            {
                base.OpenFile(file);
                return;
            }

            // get data
            TreeFile     node     = (TreeFile)file;
            PSObject     data     = node.Data as PSObject;
            ProviderInfo provider = (ProviderInfo)data.Properties["PSProvider"].Value;

            // open at the passive panel
            if (provider.Name == "FileSystem")
            {
                Far.Api.Panel2.CurrentDirectory = node.Path;
                Far.Api.Panel2.Update(false);
                Far.Api.Panel2.Redraw();
            }
            // open at the same panel as child
            else
            {
                ItemPanel panel = new ItemPanel(node.Path);
                panel.OpenChild(this);
            }
        }
示例#4
0
        public void ShowPanel()
        {
            string currentDirectory = A.Psf.SyncPaths();
            try
            {
                string drive = UI.SelectMenu.SelectDrive(null, true);
                if (drive == null)
                    return;

                AnyPanel ap;
                if (drive == "Folder &tree")
                    ap = new FolderTree();
                else if (drive == "&Any objects")
                    ap = new ObjectPanel();
                else
                    ap = new ItemPanel(drive);
                ap.Open();
            }
            finally
            {
                A.SetCurrentDirectoryFinally(currentDirectory);
            }
        }
示例#5
0
        /// <summary>
        /// Opens the path on another panel for the FileSystem provider or an item panel as a child of this panel for other providers.
        /// </summary>
        /// <param name="file">The file to open.</param>
        public override void OpenFile(FarFile file)
        {
            // base
            if (UserWants != UserAction.Enter)
            {
                base.OpenFile(file);
                return;
            }

            // get data
            TreeFile node = (TreeFile)file;
            PSObject data = node.Data as PSObject;
            ProviderInfo provider = (ProviderInfo)data.Properties["PSProvider"].Value;

            // open at the passive panel
            if (provider.Name == "FileSystem")
            {
                Far.Api.Panel2.CurrentDirectory = node.Path;
                Far.Api.Panel2.Update(false);
                Far.Api.Panel2.Redraw();
            }
            // open at the same panel as child
            else
            {
                ItemPanel panel = new ItemPanel(node.Path);
                panel.OpenChild(this);
            }
        }