Exemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            XMLSettings.CreateAppSettings_SetDefaults();

            string dir = XMLSettings.GetSettingsValue(XMLSettings.ApplicationSettings.DrawingDirectory);

            txtDrawingDirectory.Text = dir;
            txtDrawingDirectory.Select(dir.Length + 1, 0);

            ckbDefault.Checked = DrawingDirectoryIsDefault(dir);
        }
Exemplo n.º 2
0
        private void ckbDefault_CheckedChanged(object sender, EventArgs e)
        {
            string dir       = txtDrawingDirectory.Text;
            bool   isChecked = ckbDefault.Checked;

            if (isChecked)
            {
                if (dir != string.Empty && System.IO.Directory.Exists(dir))
                {
                    XMLSettings.SetSettingsValue(XMLSettings.ApplicationSettings.DrawingDirectory, dir);
                    ckbDefault.Enabled = false;
                }
            }
        }
Exemplo n.º 3
0
        private bool DrawingDirectoryIsDefault(string dir)
        {
            bool flag = false;

            dir = txtDrawingDirectory.Text;

            string savedDir = XMLSettings.GetSettingsValue(XMLSettings.ApplicationSettings.DrawingDirectory);

            if (dir != string.Empty && System.IO.Directory.Exists(dir))
            {
                if (dir == savedDir)
                {
                    flag = true;
                }
                else
                {
                    flag = false;
                }
            }

            return(flag);
        }