protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { await JoinableTaskFactory.SwitchToMainThreadAsync(); _dte = ServiceProvider.GlobalProvider.GetService(typeof(EnvDTE.DTE)) as DTE2; _serviceProvider = new ServiceProvider((IServiceProvider)_dte); _runningDocTable = new RunningDocumentTable(_serviceProvider); _runningDocTable.Advise(new RunningDocTableEventsHandler(this)); optionPage = (OptionPageGrid)GetDialogPage(typeof(OptionPageGrid)); await base.InitializeAsync(cancellationToken, progress); }
protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { await JoinableTaskFactory.SwitchToMainThreadAsync(); _dte = ServiceProvider.GlobalProvider.GetService(typeof(EnvDTE.DTE)) as DTE2; _serviceProvider = new ServiceProvider((IServiceProvider)_dte); _runningDocTable = new RunningDocumentTable(_serviceProvider); _runningDocTable.Advise(new RunningDocTableEventsHandler(this)); optionPage = (OptionPageGrid)GetDialogPage(typeof(OptionPageGrid)); _node = new NodeProcess(this); if (!_node.IsReadyToExecute()) { #pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed _node.EnsurePackageInstalledAsync().ConfigureAwait(false); #pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed } await base.InitializeAsync(cancellationToken, progress); }