예제 #1
0
        /// <summary>
        /// Opens the file.
        /// </summary>
        /// <remarks>
        /// It is called for the current file when [Enter] is pressed.
        /// The base method just calls <see cref="FarNet.Explorer.OpenFile"/> if the explorer supports it.
        /// </remarks>
        /// <param name="file">The file to be opened.</param>
        public virtual void UIOpenFile(FarFile file)
        {
            if (file == null)
            {
                return;
            }

            if (!Explorer.CanOpenFile)
            {
                return;
            }

            var args     = new OpenFileEventArgs(file);
            var explorer = UIOpenFile(args);

            if (explorer != null)
            {
                explorer.OpenPanelChild(this);
            }
        }
예제 #2
0
 /// <summary>
 /// Calls <see cref="FarNet.Explorer.OpenFile"/>.
 /// </summary>
 /// <param name="args">.</param>
 public virtual Explorer UIOpenFile(OpenFileEventArgs args)
 {
     return(Explorer.OpenFile(args));
 }
예제 #3
0
파일: Explorer.cs 프로젝트: fcenobi/FarNet
 /// <summary>
 /// Opens the file.
 /// </summary>
 /// <param name="args">.</param>
 /// <returns>The explorer to be opened in a child panel, or null.</returns>
 /// <remarks>
 /// It is normally called for the current file in a panel on [Enter].
 /// The core does nothing after the call if it returns null.
 /// Otherwise it opens the returned explorer.
 /// </remarks>
 public virtual Explorer OpenFile(OpenFileEventArgs args)
 {
     return(null);
 }