public SyncPageObjectsTask(GeneratePageObjectsCommand parent, SynchronizePageObjectsModel model, ProgressReporterDelegate progressReporter) { this.model = model ?? throw new ArgumentNullException(nameof(model)); this.parent = parent ?? throw new ArgumentNullException(nameof(parent)); Progress = progressReporter ?? throw new ArgumentNullException(nameof(progressReporter)); }
/// <summary> /// Initializes the singleton instance of the command. /// </summary> /// <param name="package">Owner package, not null.</param> public static async Task InitializeAsync(AsyncPackage package) { // Switch to the main thread - the call to AddCommand in // GeneratePageObjectsCommand's constructor requires the UI thread. await ThreadHelper.JoinableTaskFactory .SwitchToMainThreadAsync(package.DisposalToken); var dte = await package .GetServiceAsync(typeof(DTE)) as DTE; Assumes.Present(dte); var solutionService = await package .GetServiceAsync(typeof(SVsSolution)) as IVsSolution2; Assumes.Present(solutionService); var outputWindowService = await package .GetServiceAsync(typeof(SVsOutputWindow)) as IVsOutputWindow; Assumes.Present(outputWindowService); var threadedWaitDialogFactory = await package .GetServiceAsync(typeof(SVsThreadedWaitDialogFactory)) as IVsThreadedWaitDialogFactory; var monitorSelectionService = await package .GetServiceAsync(typeof(SVsShellMonitorSelection)) as IVsMonitorSelection; var generatePageObjectsService = await package .GetServiceAsync(typeof(SGeneratePageObjectsService)) as IGeneratePageObjectsService; Instance = new GeneratePageObjectsCommand(package, dte, solutionService, outputWindowService, threadedWaitDialogFactory, monitorSelectionService, generatePageObjectsService); }