private void addEntryToolStripMenuItem_Click(object sender, EventArgs e) { if (treEntries.Focused) { IEntry entry = _fileAdapter.NewEntry(); Name name = new Name(entry, _fileAdapter.EntriesHaveUniqueNames, _fileAdapter.NameList, _fileAdapter.NameFilter, _fileAdapter.NameMaxLength, true); if (name.ShowDialog() == DialogResult.OK && name.NameChanged) { entry.Name = name.NewName; if (_fileAdapter.AddEntry(entry)) { _hasChanges = true; LoadEntries(); treEntries.SelectNodeByIEntry(entry); UpdateForm(); } } } }