public Task <ExtractInterfaceOptionsResult> GetExtractInterfaceOptionsAsync( ISyntaxFactsService syntaxFactsService, INotificationService notificationService, List <ISymbol> extractableMembers, string defaultInterfaceName, List <string> allTypeNames, string defaultNamespace, string generatedNameTypeParameterSuffix, string languageName) { var viewModel = new ExtractInterfaceDialogViewModel( syntaxFactsService, defaultInterfaceName, extractableMembers, allTypeNames, defaultNamespace, generatedNameTypeParameterSuffix, languageName, languageName == LanguageNames.CSharp ? ".cs" : ".vb"); var dialog = _dialogFactory.CreateExport().Value; dialog.ViewModel = viewModel; var options = dialog.Show() == true ? new ExtractInterfaceOptionsResult( isCancelled: false, includedMembers: viewModel.MemberContainers.Where(c => c.IsChecked).Select(c => c.MemberSymbol).AsImmutable(), interfaceName: viewModel.InterfaceName.Trim(), fileName: viewModel.FileName.Trim(), location: GetLocation(viewModel.Destination)) : ExtractInterfaceOptionsResult.Cancelled; return(Task.FromResult(options)); }
internal ExtractInterfaceDialog(ExtractInterfaceDialogViewModel viewModel) { _viewModel = viewModel; SetCommandBindings(); InitializeComponent(); DataContext = viewModel; Loaded += ExtractInterfaceDialog_Loaded; IsVisibleChanged += ExtractInterfaceDialog_IsVisibleChanged; }
public ExtractInterfaceOptionsResult GetExtractInterfaceOptions(ISyntaxFactsService syntaxFactsService, INotificationService notificationService, List<ISymbol> extractableMembers, string defaultInterfaceName, List<string> conflictingTypeNames, string defaultNamespace, string generatedNameTypeParameterSuffix, string languageName) { var viewModel = new ExtractInterfaceDialogViewModel(syntaxFactsService, defaultInterfaceName, extractableMembers, conflictingTypeNames, defaultNamespace, generatedNameTypeParameterSuffix, languageName, languageName == LanguageNames.CSharp ? ".cs" : ".vb"); var dialog = new ExtractInterfaceDialog(viewModel); dialog.SetOwnerToActive(); var options = dialog.ShowDialog() == true ? new ExtractInterfaceOptionsResult( isCancelled: false, includedMembers: viewModel.MemberContainers.Where(c => c.IsChecked).Select(c => c.MemberSymbol), interfaceName: viewModel.InterfaceName.Trim(), fileName: viewModel.FileName.Trim()) : ExtractInterfaceOptionsResult.Cancelled; return options; }
public ExtractInterfaceOptionsResult GetExtractInterfaceOptions(ISyntaxFactsService syntaxFactsService, INotificationService notificationService, List <ISymbol> extractableMembers, string defaultInterfaceName, List <string> conflictingTypeNames, string defaultNamespace, string generatedNameTypeParameterSuffix, string languageName) { var viewModel = new ExtractInterfaceDialogViewModel(syntaxFactsService, defaultInterfaceName, extractableMembers, conflictingTypeNames, defaultNamespace, generatedNameTypeParameterSuffix, languageName, languageName == LanguageNames.CSharp ? ".cs" : ".vb"); var dialog = new ExtractInterfaceDialog(viewModel); dialog.SetOwnerToActive(); var options = dialog.ShowDialog() == true ? new ExtractInterfaceOptionsResult( isCancelled: false, includedMembers: viewModel.MemberContainers.Where(c => c.IsChecked).Select(c => c.MemberSymbol), interfaceName: viewModel.InterfaceName.Trim(), fileName: viewModel.FileName.Trim()) : ExtractInterfaceOptionsResult.Cancelled; return(options); }