コード例 #1
0
        private async System.Threading.Tasks.Task InitializeCommandsAsync(IProgress <ServiceProgressData> progress)
        {
            // if the package is zombied, we don't want to add commands
            if (Zombied)
            {
                return;
            }

            var progressData = new ServiceProgressData(VSIXResource.PackageLoad_WaitMessage, VSIXResource.PackageLoad_InitCommands,
                                                       currentStep: 2, TotalLoadSteps);

            progress?.Report(progressData);

            OleMenuCommandService oleCommandService = await this.GetServiceAsync <IMenuCommandService, OleMenuCommandService>();

            if (oleCommandService == null)
            {
                InvalidOperationException loadCommandServiceException = new InvalidOperationException("Failed to load OLE command service");
                AcuminatorLogger.LogException(loadCommandServiceException, logOnlyFromAcuminatorAssemblies: false, LogMode.Error);
                return;
            }

            FormatBqlCommand.Initialize(this, oleCommandService);
            GoToDeclarationOrHandlerCommand.Initialize(this, oleCommandService);
            BqlFixer.FixBqlCommand.Initialize(this, oleCommandService);

            OpenCodeMapWindowCommand.Initialize(this, oleCommandService);
        }
コード例 #2
0
        private async System.Threading.Tasks.Task InitializeCommandsAsync()
        {
            // if the package is zombied, we don't want to add commands
            if (Zombied)
            {
                return;
            }

            OleMenuCommandService oleCommandService = await this.GetServiceAsync <IMenuCommandService, OleMenuCommandService>();

            if (oleCommandService == null)
            {
                InvalidOperationException loadCommandServiceException = new InvalidOperationException("Failed to load OLE command service");
                AcuminatorLogger.LogException(loadCommandServiceException, logOnlyFromAcuminatorAssemblies: false, LogMode.Error);
                return;
            }

            FormatBqlCommand.Initialize(this, oleCommandService);
            GoToDeclarationOrHandlerCommand.Initialize(this, oleCommandService);
            BqlFixer.FixBqlCommand.Initialize(this, oleCommandService);

            OpenCodeMapWindowCommand.Initialize(this, oleCommandService);
        }