Ejemplo n.º 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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }