public CommandService( IShell app, MainThread mainThread, IEventStream eventStream, Selection selection, [ImportMany] IEnumerable <Lazy <IMenuCommand, MenuCommandMetadata> > commands, [ImportMany] IEnumerable <Lazy <ContentView, MenuCommandMetadata> > views) { var allCommands = commands.Concat( views .OrderBy(x => x.Metadata.Key) .Select(x => new Lazy <IMenuCommand, MenuCommandMetadata>( () => new MenuCommandAdapter(x, app), // We need a different metadata with a null context // to convert the ContentView into a global command new MenuCommandMetadata { DisplayName = x.Metadata.DisplayName, Key = x.Metadata.Key, Order = x.Metadata.Order, DefaultVisible = true, ReportProgress = false }))); foreach (var command in allCommands) { var key = Tuple.Create(command.Metadata.Key, command.Metadata.Context); if (!this.commands.TryGetValue(key, out var existingCommand) || existingCommand.Metadata.Order > command.Metadata.Order) { this.commands[key] = command; } } this.mainThread = mainThread; this.eventStream = eventStream; this.selection = selection; }
public InstallPluginsCommand(IShell shell, IPluginManager plugins, MainThread mainThread) { this.shell = shell; this.plugins = plugins; this.mainThread = mainThread; }
public CommandExports(Lazy <IShell> app, MainThread mainThread) { this.app = app; this.mainThread = mainThread; }