Exemplo n.º 1
0
        /// <summary>
        /// New panel with the explorer.
        /// </summary>
        /// <param name="explorer">The panel explorer.</param>
        public AnyPanel(Explorer explorer)
            : base(explorer)
        {
            // settings
            DotsMode = PanelDotsMode.Dots;

            // start mode
            ViewMode = PanelViewMode.AlternativeFull;
        }
Exemplo n.º 2
0
        public FarPodPanel(Explorer explorer)
            : base(explorer)
        {
            Title = MsgStr.FarPodPrefix;
            FormatName = MsgStr.FarPodPrefix;

            Highlighting = PanelHighlighting.Full;
            DotsMode = PanelDotsMode.Off;

            UseFilter = true;

            //InfoItems =
            //SetPlan()
            //ViewPlan
        }
Exemplo n.º 3
0
        internal ListPanel(Explorer explorer)
            : base(explorer)
        {
            PostName(_lastCurrentName);

            // 090411 Use custom Descriptions mode
            PanelPlan plan = new PanelPlan();
            plan.Columns = new FarColumn[]
            {
                new SetColumn() { Kind = "N", Name = "Name" },
                new SetColumn() { Kind = "Z", Name = "Value" }
            };
            SetPlan(PanelViewMode.AlternativeFull, plan);

            InvokingCommand += OnInvokingCommand;
        }
Exemplo n.º 4
0
        ///
        public static GetContentEventArgs WorksExportExplorerFile(Explorer explorer, Panel panel, ExplorerModes mode, FarFile file, string fileName)
        {
            if (explorer == null) throw new ArgumentNullException("explorer");
            if (panel == null) throw new ArgumentNullException("panel");

            if (!explorer.CanGetContent)
                return null;

            // export file
            Log.Source.TraceInformation("ExportFile");
            var args = new GetContentEventArgs(mode, file, fileName);
            panel.UIGetContent(args);
            if (args.Result != JobResult.Done)
                return null;

            // no text or an actual file exists?
            if (args.UseText == null || !string.IsNullOrEmpty(args.UseFileName))
                return args;

            // export text
            string text = args.UseText as string;
            if (text == null)
            {
                IEnumerable collection = args.UseText as IEnumerable;
                if (collection == null)
                {
                    text = args.UseText.ToString();
                }
                else
                {
                    // write collection
                    using (StreamWriter writer = new StreamWriter(fileName, false, Encoding.Unicode))
                        foreach (var it in collection)
                            writer.WriteLine(it);
                    return args;
                }
            }

            // write text
            File.WriteAllText(fileName, text, Encoding.Unicode);
            args.CodePage = 1200;
            return args;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Navigates to a virtual file system location specified by the explorer and updates the panel.
        /// </summary>
        /// <param name="explorer">The target explorer.</param>
        /// <remarks>
        /// The target explorer must have the same <see cref="FarNet.Explorer.TypeId"/> as the current one.
        /// </remarks>
        public virtual void Navigate(Explorer explorer)
        {
            if (explorer == null) throw new ArgumentNullException("explorer");
            if (explorer.TypeId != Explorer.TypeId) throw new ArgumentException("New explorer is not compatible with the current.");

            _Panel.Navigate(explorer);
        }
Exemplo n.º 6
0
 /// <summary>
 /// New module panel with its file explorer.
 /// </summary>
 /// <param name="explorer">The panel explorer.</param>
 public Panel(Explorer explorer)
 {
     if (explorer == null) throw new ArgumentNullException("explorer");
     _Panel = Far.Api.WorksPanel(this, explorer);
 }
Exemplo n.º 7
0
 /// <summary>
 /// INTERNAL
 /// </summary>
 public abstract Works.IPanelWorks WorksPanel(Panel panel, Explorer explorer);
Exemplo n.º 8
0
 /// <summary>
 /// Calls <see cref="FarNet.Explorer.ExploreRoot"/>.
 /// </summary>
 /// <param name="args">.</param>
 public virtual Explorer UIExploreRoot(ExploreRootEventArgs args)
 {
     return(Explorer.ExploreRoot(args));
 }
Exemplo n.º 9
0
 /// <summary>
 /// Calls <see cref="FarNet.Explorer.GetContent"/>.
 /// </summary>
 /// <param name="args">.</param>
 public virtual void UIGetContent(GetContentEventArgs args)
 {
     Explorer.GetContent(args);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Calls <see cref="FarNet.Explorer.ExploreLocation"/>.
 /// </summary>
 /// <param name="args">.</param>
 public virtual Explorer UIExploreLocation(ExploreLocationEventArgs args)
 {
     return(Explorer.ExploreLocation(args));
 }
Exemplo n.º 11
0
 /// <summary>
 /// Calls <see cref="FarNet.Explorer.ExploreDirectory"/>.
 /// </summary>
 /// <param name="args">.</param>
 public virtual Explorer UIExploreDirectory(ExploreDirectoryEventArgs args)
 {
     return(Explorer.ExploreDirectory(args));
 }
Exemplo n.º 12
0
 /// <summary>
 /// Calls <see cref="FarNet.Explorer.OpenFile"/>.
 /// </summary>
 /// <param name="args">.</param>
 public virtual Explorer UIOpenFile(OpenFileEventArgs args)
 {
     return(Explorer.OpenFile(args));
 }
Exemplo n.º 13
0
 /// <summary>
 /// Calls <see cref="FarNet.Explorer.GetFiles"/>.
 /// </summary>
 /// <param name="args">.</param>
 public virtual IEnumerable <FarFile> UIGetFiles(GetFilesEventArgs args)
 {
     return(Explorer.GetFiles(args));
 }
Exemplo n.º 14
0
 /// <summary>
 /// INTERNAL
 /// </summary>
 public abstract Works.IPanelWorks WorksPanel(Panel panel, Explorer explorer);