ShellTreeViewBeforeShellCommand Event |
This event is fired when a shell command is to be executed, ie. via the context menu
It is possible to permit the execution of the shell command by modifying the BeforeShellCommandEventArgs
Namespace: Jam.ShellAssembly: ShellBrowser (in ShellBrowser.dll) Version: 7.2
Syntaxpublic event EventHandler<BeforeShellCommandEventArgs> BeforeShellCommand
Public Event BeforeShellCommand As EventHandler(Of BeforeShellCommandEventArgs)
public:
event EventHandler<BeforeShellCommandEventArgs^>^ BeforeShellCommand {
void add (EventHandler<BeforeShellCommandEventArgs^>^ value);
void remove (EventHandler<BeforeShellCommandEventArgs^>^ value);
}
member BeforeShellCommand : IEvent<EventHandler<BeforeShellCommandEventArgs>,
BeforeShellCommandEventArgs>
Value
EventHandlerBeforeShellCommandEventArgs
Example
Shows the analogue usage of the
BeforeShellCommand event.
using (ShellBrowser shellBrowser = new ShellBrowser(lFilePath))
{
shellBrowser.BeforeShellCommand += (s, e) =>
{
if (e.Verb == ShellCommand.Open)
e.Cancel = true;
if (e.Verb == ShellContextMenuCommand.Open)
e.Cancel = true;
if (ShellCommand.IsOpen(e.Verb))
e.Cancel = true;
if (ShellCommand.IsEmpty(e.Verb))
System.Diagnostics.Debug.WriteLine(e.Verb.Caption);
};
shellBrowser.ShowContextMenu(Cursor.Position);
}
See Also