示例#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
文件: Panel.cs 项目: pezipink/FarNet
        /// <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
文件: Panel.cs 项目: pezipink/FarNet
 /// <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
文件: Far.cs 项目: pezipink/FarNet
 /// <summary>
 /// INTERNAL
 /// </summary>
 public abstract Works.IPanelWorks WorksPanel(Panel panel, Explorer explorer);