public GenerateTypeOptionsResult GetGenerateTypeOptions( string className, GenerateTypeDialogOptions generateTypeDialogOptions, Document document, INotificationService notificationService, IProjectManagementService projectManagementService, ISyntaxFactsService syntaxFactsService) { // Storing the actual values ClassName = className; GenerateTypeDialogOptions = generateTypeDialogOptions; if (DefaultNamespace == null) { DefaultNamespace = projectManagementService.GetDefaultNamespace(Project, Project?.Solution.Workspace); } return new GenerateTypeOptionsResult( accessibility: Accessibility, typeKind: TypeKind, typeName: TypeName, project: Project, isNewFile: IsNewFile, newFileName: NewFileName, folders: Folders, fullFilePath: FullFilePath, existingDocument: ExistingDocument, areFoldersValidIdentifiers: AreFoldersValidIdentifiers, defaultNamespace: DefaultNamespace, isCancelled: IsCancelled); }
public GenerateTypeOptionsResult GetGenerateTypeOptions( string className, GenerateTypeDialogOptions generateTypeDialogOptions, Document document, INotificationService notificationService, IProjectManagementService projectManagementService, ISyntaxFactsService syntaxFactsService) { // Storing the actual values ClassName = className; GenerateTypeDialogOptions = generateTypeDialogOptions; if (DefaultNamespace == null) { DefaultNamespace = projectManagementService.GetDefaultNamespace(Project, Project?.Solution.Workspace); } return(new GenerateTypeOptionsResult( accessibility: Accessibility, typeKind: TypeKind, typeName: TypeName, project: Project, isNewFile: IsNewFile, newFileName: NewFileName, folders: Folders, fullFilePath: FullFilePath, existingDocument: ExistingDocument, areFoldersValidIdentifiers: AreFoldersValidIdentifiers, defaultNamespace: DefaultNamespace, isCancelled: IsCancelled)); }
public GenerateTypeOptionsResult GetGenerateTypeOptions( string typeName, GenerateTypeDialogOptions generateTypeDialogOptions, Document document, INotificationService notificationService, IProjectManagementService projectManagementService, ISyntaxFactsService syntaxFactsService ) { var viewModel = new GenerateTypeDialogViewModel( document, notificationService, projectManagementService, syntaxFactsService, generateTypeDialogOptions, typeName, document.Project.Language == LanguageNames.CSharp ? ".cs" : ".vb", _isNewFile, _accessSelectString, _typeKindSelectString ); var dialog = new GenerateTypeDialog(viewModel); var result = dialog.ShowModal(); if (result.HasValue && result.Value) { // Retain choice _isNewFile = viewModel.IsNewFile; _accessSelectString = viewModel.SelectedAccessibilityString; _typeKindSelectString = viewModel.SelectedTypeKindString; var defaultNamespace = projectManagementService.GetDefaultNamespace( viewModel.SelectedProject, viewModel.SelectedProject?.Solution.Workspace ); return(new GenerateTypeOptionsResult( accessibility: viewModel.SelectedAccessibility, typeKind: viewModel.SelectedTypeKind, typeName: viewModel.TypeName, project: viewModel.SelectedProject, isNewFile: viewModel.IsNewFile, newFileName: viewModel.FileName.Trim(), folders: viewModel.Folders, fullFilePath: viewModel.FullFilePath, existingDocument: viewModel.SelectedDocument, defaultNamespace: defaultNamespace, areFoldersValidIdentifiers: viewModel.AreFoldersValidIdentifiers )); } else { return(GenerateTypeOptionsResult.Cancelled); } }
public GenerateTypeOptionsResult GetGenerateTypeOptions( string typeName, GenerateTypeDialogOptions generateTypeDialogOptions, Document document, INotificationService notificationService, IProjectManagementService projectManagementService, ISyntaxFactsService syntaxFactsService) { var viewModel = new GenerateTypeDialogViewModel( document, notificationService, projectManagementService, syntaxFactsService, _generatedCodeService, generateTypeDialogOptions, typeName, document.Project.Language == LanguageNames.CSharp ? ".cs" : ".vb", _isNewFile, _accessSelectString, _typeKindSelectString); var dialog = new GenerateTypeDialog(viewModel); var result = dialog.ShowModal(); if (result.HasValue && result.Value) { // Retain choice _isNewFile = viewModel.IsNewFile; _accessSelectString = viewModel.SelectedAccessibilityString; _typeKindSelectString = viewModel.SelectedTypeKindString; var defaultNamespace = projectManagementService.GetDefaultNamespace(viewModel.SelectedProject, viewModel.SelectedProject?.Solution.Workspace); return new GenerateTypeOptionsResult( accessibility: viewModel.SelectedAccessibility, typeKind: viewModel.SelectedTypeKind, typeName: viewModel.TypeName, project: viewModel.SelectedProject, isNewFile: viewModel.IsNewFile, newFileName: viewModel.FileName.Trim(), folders: viewModel.Folders, fullFilePath: viewModel.FullFilePath, existingDocument: viewModel.SelectedDocument, defaultNamespace: defaultNamespace, areFoldersValidIdentifiers: viewModel.AreFoldersValidIdentifiers); } else { return GenerateTypeOptionsResult.Cancelled; } }