Exemple #1
0
 private void InitializeLogger()
 {
     try
     {
         AcuminatorLogger = new AcuminatorLogger(this, swallowUnobservedTaskExceptions: false);
     }
     catch (Exception ex)
     {
         ActivityLog.TryLogError(PackageName,
                                 $"An error occurred during the logger initialization ({ex.GetType().Name}, message: \"{ex.Message}\")");
     }
 }
Exemple #2
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            AcuminatorLogger?.Dispose();
            _outOfProcessSettingsUpdater?.Dispose();

            VS.Events.SolutionEvents.OnAfterBackgroundSolutionLoadComplete -= SolutionEvents_OnAfterBackgroundSolutionLoadComplete;

            if (_vsWorkspace != null)
            {
                _vsWorkspace.WorkspaceChanged -= Workspace_WorkspaceChanged;
                _vsWorkspace = null;
            }
        }
        private void InitializeLogger(IProgress <ServiceProgressData> progress)
        {
            var progressData = new ServiceProgressData(VSIXResource.PackageLoad_WaitMessage, VSIXResource.PackageLoad_InitLogger,
                                                       currentStep: 1, TotalLoadSteps);

            progress?.Report(progressData);

            try
            {
                AcuminatorLogger = new AcuminatorLogger(this, swallowUnobservedTaskExceptions: false);
            }
            catch (Exception ex)
            {
                ActivityLog.TryLogError(PackageName,
                                        $"An error occurred during the logger initialization ({ex.GetType().Name}, message: \"{ex.Message}\")");
            }
        }
Exemple #4
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);
        }