Ejemplo n.º 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);
            }
        }
Ejemplo n.º 2
0
        protected override void Initialize()
        {
            SharpenExtensionService.CreateSingleInstance();

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

            base.Initialize();
        }