private Shell CreateShell(
     ShellCommandBase shellCommand,
     IHotkeyHandler hotkeyCommander,
     ContextMenuBase contextMenuBase,
     ScreenHostBase screenHostBase,
     DialogHostBase dialogHostBase,
     ToolbarBase toolbarBase)
 {
     return(new Shell(
                CreateFactoryFor(shellCommand, "startCommand"),
                CreateFactoryFor(hotkeyCommander),
                CreateFactoryFor(contextMenuBase),
                CreateFactoryFor(screenHostBase),
                CreateFactoryFor(dialogHostBase),
                CreateFactoryFor(toolbarBase)));
 }
예제 #2
0
        /// <summary>
        /// The core class of the UI. Hosts everything inside the application.
        /// </summary>
        /// <param name="startCommandFactory">Factory for a command that will perform the appropriate actions to initialize the application after the empty shell has loaded.</param>
        /// <param name="hotkeyCommanderFactory">Factory for a hotkey commander capable of intercepting global hotkey presses made inside the shell.</param>
        /// <param name="contextMenuFactory">Factory for the context menu the shell provides.</param>
        /// <param name="screenHostFactory">Factory for the host for all screens shown in the shell.</param>
        /// <param name="dialogHostFactory">Factory for the host for all dialogs shown in the shell.</param>
        /// <param name="toolbarFactory">Factory for the command toolbar at the top of the shell.</param>
        public Shell(
            [Inject(Key = "startCommand")] Func <IShellCommand> startCommandFactory,
            Func <IHotkeyHandler> hotkeyCommanderFactory,
            Func <ContextMenuBase> contextMenuFactory,
            Func <ScreenHostBase> screenHostFactory,
            Func <DialogHostBase> dialogHostFactory,
            Func <ToolbarBase> toolbarFactory)
        {
            _hotkeyCommander = hotkeyCommanderFactory();
            ContextMenu      = contextMenuFactory();
            ScreenHost       = screenHostFactory();
            DialogHost       = dialogHostFactory();
            Toolbar          = toolbarFactory();
            startCommandFactory().Execute(null);

            ShellCommandBase.OnShellCommandException += OnShellCommandException;
        }
 public void Plugin(IHotkeyHandler handler)
 {
     HotkeyHandlers.Add(handler);
 }
예제 #4
0
 public static IHotkeyCollection Add(this IHotkeyCollection collection, IHotkeyHandler handler)
 {
     return(collection.Add(handler.Hotkey, handler.Handle));
 }