示例#1
0
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            Logger.Initialize(Vsix.Name);

            Options = (Options)GetDialogPage(typeof(Options));

            var commandService = await GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

            if (commandService != null)
            {
                ClearAllErrorsCommand.Initialize(this, commandService);
                ToggleAutoRunCommand.Initialize(this, commandService);
                OpenSettingsCommand.Initialize(this, commandService);
                RunNowCommand.Initialize(this, commandService);
                SpecifyRulesCommand.Initialize(this, commandService);
            }
        }
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await JoinableTaskFactory.SwitchToMainThreadAsync();

            Logger.Initialize(Vsix.Name);

            Options = (Options)GetDialogPage(typeof(Options));


            if (await GetServiceAsync(typeof(IMenuCommandService)) is OleMenuCommandService commandService)
            {
                ClearAllErrorsCommand.Initialize(this, commandService);
                ToggleAutoRunCommand.Initialize(this, commandService);
                OpenSettingsCommand.Initialize(this, commandService);
                RunNowCommand.Initialize(this, commandService);
                SpecifyRulesCommand.Initialize(this, commandService);
            }
        }
 public static void Initialize(Package package, OleMenuCommandService commandService)
 {
     Instance = new ToggleAutoRunCommand(package, commandService);
 }