protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { // When initialized asynchronously, the current thread may be a background thread at this point. // Do any initialization that requires the UI thread after switching to the UI thread. await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); await WebResourcePublishCommand.InitializeAsync(this); }
public static async Async.Task InitializeAsync(AsyncPackage package) { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken); var commandService = await package.GetServiceAsync((typeof(IMenuCommandService))) as OleMenuCommandService; var settingsManager = await package.GetServiceAsync(typeof(SVsSettingsManager)) as IVsSettingsManager; Instance = new WebResourcePublishCommand(package, commandService, settingsManager); }