public InstallPackageDirectlyCodeAction( IPackageInstallerService installerService, Document document, string source, string packageName, string versionOpt, bool isLocal) { Title = versionOpt == null ? FeaturesResources.Find_and_install_latest_version : isLocal ? string.Format(FeaturesResources.Use_local_version_0, versionOpt) : string.Format(FeaturesResources.Install_version_0, versionOpt); _installPackageOperation = new InstallPackageDirectlyCodeActionOperation( installerService, document, source, packageName, versionOpt, isLocal); }
protected override Task<IEnumerable<CodeActionOperation>> ComputeOperationsAsync(object options, CancellationToken cancellationToken) { IEnumerable<CodeActionOperation> operations = null; var extractInterfaceOptions = options as ExtractInterfaceOptionsResult; if (extractInterfaceOptions != null && !extractInterfaceOptions.IsCancelled) { var extractInterfaceResult = _extractInterfaceService.ExtractInterfaceFromAnalyzedType(_typeAnalysisResult, extractInterfaceOptions, cancellationToken); if (extractInterfaceResult.Succeeded) { operations = new CodeActionOperation[] { new ApplyChangesOperation(extractInterfaceResult.UpdatedSolution), new NavigationOperation(extractInterfaceResult.NavigationDocumentId, position: 0) }; } } return Task.FromResult(operations); }