public void showPropertiesWindow() { Load(false); frmProperties frm = new frmProperties(); setOptionsToForm(frm); if (frm.ShowDialog() == DialogResult.OK) { getOptionsFromForm(frm); Save(); } }
public void Load(bool showWindow = true) { bool result = true; RegistryKey key = Registry.CurrentUser.OpenSubKey(regMainPath); if (key == null) { result = false; } else { object t; t = key.GetValue(regstrDBPath); if (t == null || t.ToString() == "") { result = false; } else { strDBPath = t.ToString(); } t = key.GetValue(regstrFreelanceDirectoryPath); if (t == null || t.ToString() == "") { result = false; } else { strFreelanceDirectoryPath = t.ToString(); } t = key.GetValue(regstrGooglDriveRootPath); if (t == null || t.ToString() == "") { result = false; } else { strGoogleDriveRootPath = t.ToString(); } t = key.GetValue(regstr7ZipDirectoryPath); if (t == null || t.ToString() == "") { result = false; } else { str7ZipDirectoryPath = t.ToString(); } } if (key != null) { key.Close(); } if (result == false && showWindow) { frmProperties frm = new frmProperties(); setOptionsToForm(frm); if (frm.ShowDialog() == DialogResult.OK) { getOptionsFromForm(frm); Save(); } } }