private void CreateButton_Click(object sender, RoutedEventArgs e) { CreateListDialog dlg = new CreateListDialog(); dlg.Owner = this; dlg.Closing += (s, args) => { if (dlg.DialogResult == true) { if (manager.AssemblyLists.Contains(dlg.NewListName)) { args.Cancel = true; MainWindow.Instance.ShowMessageBox("A list with the same name was found."); } } }; if (dlg.ShowDialog() == true) { manager.CreateList(new AssemblyList(dlg.NewListName)); } }
private void CreateButton_Click(object sender, RoutedEventArgs e) { CreateListDialog dlg = new CreateListDialog(); dlg.Owner = this; dlg.Closing += (s, args) => { if (dlg.DialogResult == true) { if (manager.FileLists.Contains(dlg.NewListName)) { args.Cancel = true; MainWindow.Instance.ShowMessageBox("A list with the same name was found."); } } }; if (dlg.ShowDialog() == true) { manager.CreateList(new DnSpyFileList(manager.DnSpyFileListOptions, dlg.NewListName)); } }
private void CreateButton_Click(object sender, RoutedEventArgs e) { CreateListDialog dlg = new CreateListDialog(); dlg.Owner = this; dlg.Closing += (s, args) => { if (dlg.DialogResult == true) { if (manager.AssemblyLists.Contains(dlg.NewListName)) { args.Cancel = true; MessageBox.Show("同名列表已存在.", null, MessageBoxButton.OK); } } }; if (dlg.ShowDialog() == true) { manager.CreateList(new AssemblyList(dlg.NewListName)); } }
private async void CreateButton_Click(object sender, RoutedEventArgs e) { CreateListDialog dlg = new CreateListDialog(); dlg.Closing += (s, args) => { if (dlg.DialogResult == true) { if (manager.AssemblyLists.Contains(dlg.NewListName)) { args.Cancel = true; MessageBox.Show("A list with the same name was found.", null, MessageBoxButton.OK); } } }; if (await dlg.ShowDialog <bool>(this) == true) { manager.CreateList(new AssemblyList(dlg.NewListName)); } }