예제 #1
0
        /// <summary>
        /// Processes key press.
        /// </summary>
        /// <param name="pressedKey">Pressed key.</param>
        /// <returns>True if the event was handled, false otherwise.</returns>
        public bool ProcessKeyPress(InputKey pressedKey)
        {
            if (entries.ProcessKeyPress(pressedKey))
            {
                return(true);
            }

            if (pressedKey == 'l' || pressedKey == Keys.Left || pressedKey == Keys.Enter)
            {
                var parentDir = entries.EntryInFocus.GetType() == typeof(SearchResultDirectoryEntry) ?
                                entries.EntryInFocus.Info.FullName :
                                ((FileInfo)entries.EntryInFocus.Info).DirectoryName;

                Search.Cancel();

                InvokeCommand?.Invoke(new ChangeDirectoryCommand(parentDir));
                return(true);
            }

            if (pressedKey == Keys.Escape)
            {
                Search.Cancel();
                pane.Status = JobStatus.Canceled;

                return(false);
            }

            return(false);
        }
예제 #2
0
 public override void Invoke(Shell shell, string[] args)
 {
     InvokeCommand?.Invoke(this, new InvokeShellCommandEventArgs(shell, args));
 }