private void newDialog_DialogClosed(object sender, EventArgs e) { inputDialog.DialogClosed -= newDialog_DialogClosed; if (inputDialog.DialogResult) { if (!string.IsNullOrEmpty(inputDialog.InputText)) { string s = inputDialog.InputText.Trim(); if (s.Length > 0) { int id = Core.Settings.Default.GetCollectionID(s); if (id < 0) { Core.Settings.Default.AddCollection(s); AvailableCollections.Add(s); SelectedCollection = s; } } } } }
private void newDialog_DialogClosed(object sender, EventArgs e) { inputDialog.DialogClosed -= newDialog_DialogClosed; if (inputDialog.DialogResult) { if (!string.IsNullOrEmpty(inputDialog.InputText)) { string s = inputDialog.InputText.Trim(); if (s.Length > 0) { var c = Settings.Settings.Default.GetCollection(s); if (c == null) { c = Settings.Settings.Default.GetCollection(s, createIfNotExists: true); if (c != null) { AvailableCollections.Add(c); SelectedCollection = c; } } } } } }