Пример #1
0
 private void setOptionsToForm(frmProperties frm)
 {
     frm.setDBPath(strDBPath);
     frm.setFreelanceDirectoryPath(strFreelanceDirectoryPath);
     frm.setGoogleDriveRootPath(strGoogleDriveRootPath);
     frm.set7ZipDirectoryPath(str7ZipDirectoryPath);
 }
Пример #2
0
 private void getOptionsFromForm(frmProperties frm)
 {
     strDBPath = frm.getDBPath();
     strGoogleDriveRootPath    = frm.getGoogleDriveRootPath();
     strFreelanceDirectoryPath = frm.getFreelanceDirectoryPath();
     str7ZipDirectoryPath      = frm.get7ZipDirectoryPath();
 }
Пример #3
0
        public void showPropertiesWindow()
        {
            Load(false);
            frmProperties frm = new frmProperties();

            setOptionsToForm(frm);
            if (frm.ShowDialog() == DialogResult.OK)
            {
                getOptionsFromForm(frm);
                Save();
            }
        }
Пример #4
0
        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();
                }
            }
        }