Exemple #1
0
        protected override void Initialize()
        {
            base.Initialize();
            this.InitializeSqm();

            IServiceProvider serviceProvider = this;

            this.deprecatedSonarRuleSetManager = this.GetMefService <IDeprecatedSonarRuleSetManager>();

            var activeSolutionBoundTracker = this.GetMefService <IActiveSolutionBoundTracker>();
            var sonarQubeService           = this.GetMefService <ISonarQubeService>();
            var workspace = this.GetMefService <VisualStudioWorkspace>();

            logger = this.GetMefService <ILogger>();
            Debug.Assert(logger != null, "MEF composition error - failed to retrieve a logger");

            var vsSolution = serviceProvider.GetService <SVsSolution, IVsSolution>();

            this.sonarAnalyzerManager = new SonarAnalyzerManager(activeSolutionBoundTracker, sonarQubeService, workspace,
                                                                 vsSolution, logger);

            this.usageAnalyzer = new BoundSolutionAnalyzer(serviceProvider);

            this.commandManager = new PackageCommandManager(serviceProvider.GetService <IMenuCommandService>());
            this.commandManager.Initialize(serviceProvider.GetMefService <ITeamExplorerController>(),
                                           serviceProvider.GetMefService <IProjectPropertyManager>());

            this.deprecationManager = new DeprecationManager(this.GetMefService <IInfoBarManager>(), logger);
        }
Exemple #2
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (disposing)
            {
                this.sonarAnalyzerManager?.Dispose();
                this.sonarAnalyzerManager = null;

                this.usageAnalyzer?.Dispose();
                this.usageAnalyzer = null;

                this.deprecationManager?.Dispose();
                this.deprecationManager = null;

                this.deprecatedSonarRuleSetManager?.Dispose();
                this.deprecatedSonarRuleSetManager = null;
            }
        }