Exemple #1
0
        protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            var commandServicesContainerBuilder = new CommandServicesContainer.Builder(this);

            await commandServicesContainerBuilder.CreateServicesAsync();

            await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            commandServicesContainerBuilder.CreateServicesOnUIThread();

            var commandServicesContainer = commandServicesContainerBuilder.GetCommandServicesContainer();

            InitializeCommands();

            await base.InitializeAsync(cancellationToken, progress);

            void InitializeCommands()
            {
                AnalyzeSolutionCommand.Initialize(commandServicesContainer);
                AnalyzeSelectedProjectsCommand.Initialize(commandServicesContainer);

                ShowOptionsDialogCommand.Initialize(commandServicesContainer);
                ShowSharpenResultsToolWindowCommand.Initialize(commandServicesContainer);

                AnalyzeCurrentDocumentContextCommand.Initialize(commandServicesContainer);
                AnalyzeSolutionContextCommand.Initialize(commandServicesContainer);
                AnalyzeSelectedProjectsContextCommand.Initialize(commandServicesContainer);
                AnalyzeSelectedDocumentsContextCommand.Initialize(commandServicesContainer);
                AnalyzeSelectedFoldersContextCommand.Initialize(commandServicesContainer);
            }
        }
Exemple #2
0
        protected override void Initialize()
        {
            SharpenExtensionService.CreateSingleInstance();

            AnalyzeSolutionCommand.Initialize(this, SharpenExtensionService.Instance);
            AnalyzeSelectedProjectsCommand.Initialize(this, SharpenExtensionService.Instance);

            ShowOptionsDialogCommand.Initialize(this);
            ShowSharpenResultsToolWindowCommand.Initialize(this);

            AnalyzeCurrentDocumentContextCommand.Initialize(this, SharpenExtensionService.Instance);
            AnalyzeSolutionContextCommand.Initialize(this, SharpenExtensionService.Instance);
            AnalyzeSelectedProjectsContextCommand.Initialize(this, SharpenExtensionService.Instance);
            AnalyzeSelectedDocumentsContextCommand.Initialize(this, SharpenExtensionService.Instance);
            AnalyzeSelectedFoldersContextCommand.Initialize(this, SharpenExtensionService.Instance);

            base.Initialize();
        }