public static async Task InitializeAsync(AsyncPackage package) { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken); var commandService = await package.GetServiceAsync <IMenuCommandService, OleMenuCommandService>(); var dte = await package.GetServiceAsync <DTE, DTE2>(); Instance = new BreakInCurrentDocument(package, commandService, dte); }
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); await BreakInCurrentDocument.InitializeAsync(this); }