private void buttonLock_Click(object sender, EventArgs e) { DialogResult result = openFileDialogExecutible.ShowDialog(); if (result == DialogResult.OK) { NameDialog named = new NameDialog(); if (named.ShowDialog() == DialogResult.OK) { locker.lockFile(openFileDialogExecutible.FileName); settings = SettingsSystem.GetSettings(); settings.fileMap.Add(named.textBox1.Text); settings.Save(); refreshList(); } } }