Esempio n. 1
0
        public static async Task InitializeAsync(CollapseCommandPackage package)
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken);

            OleMenuCommandService commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

            Instance = new ExpandCommand(package, commandService);
        }
Esempio n. 2
0
        private ExpandCommand(CollapseCommandPackage package, OleMenuCommandService commandService)
        {
            this.package   = package ?? throw new ArgumentNullException(nameof(package));
            commandService = commandService ?? throw new ArgumentNullException(nameof(commandService));

            var menuCommandID = new CommandID(CommandSet, CommandId);
            var menuItem      = new MenuCommand(this.Execute, menuCommandID);

            commandService.AddCommand(menuItem);
        }
 public void Initialize(CollapseCommandPackage package, RunningDocumentTable runningDocumentTable, DTE2 dte)
 {
     this.package = package;
     this.runningDocumentTable = runningDocumentTable;
     this.dte = dte;
 }