Пример #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;
        }
Пример #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
        }
Пример #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;
        }
Пример #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;
        }
Пример #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);
        }
Пример #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);
 }
Пример #7
0
 /// <summary>
 /// INTERNAL
 /// </summary>
 public abstract Works.IPanelWorks WorksPanel(Panel panel, Explorer explorer);
Пример #8
0
 /// <summary>
 /// Calls <see cref="FarNet.Explorer.ExploreRoot"/>.
 /// </summary>
 /// <param name="args">.</param>
 public virtual Explorer UIExploreRoot(ExploreRootEventArgs args)
 {
     return(Explorer.ExploreRoot(args));
 }
Пример #9
0
 /// <summary>
 /// Calls <see cref="FarNet.Explorer.GetContent"/>.
 /// </summary>
 /// <param name="args">.</param>
 public virtual void UIGetContent(GetContentEventArgs args)
 {
     Explorer.GetContent(args);
 }
Пример #10
0
 /// <summary>
 /// Calls <see cref="FarNet.Explorer.ExploreLocation"/>.
 /// </summary>
 /// <param name="args">.</param>
 public virtual Explorer UIExploreLocation(ExploreLocationEventArgs args)
 {
     return(Explorer.ExploreLocation(args));
 }
Пример #11
0
 /// <summary>
 /// Calls <see cref="FarNet.Explorer.ExploreDirectory"/>.
 /// </summary>
 /// <param name="args">.</param>
 public virtual Explorer UIExploreDirectory(ExploreDirectoryEventArgs args)
 {
     return(Explorer.ExploreDirectory(args));
 }
Пример #12
0
 /// <summary>
 /// Calls <see cref="FarNet.Explorer.OpenFile"/>.
 /// </summary>
 /// <param name="args">.</param>
 public virtual Explorer UIOpenFile(OpenFileEventArgs args)
 {
     return(Explorer.OpenFile(args));
 }
Пример #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));
 }
Пример #14
0
 /// <summary>
 /// INTERNAL
 /// </summary>
 public abstract Works.IPanelWorks WorksPanel(Panel panel, Explorer explorer);