Exemplo n.º 1
0
 // form loaded
 private void main_Load(object sender, EventArgs e)
 {
     if (File.Exists("setting.xml"))
     {
         // load setting-data
         var xserial = new XmlSerializer(typeof(setting));
         var sr      = new StreamReader("setting.xml");
         myst = (setting)xserial.Deserialize(sr);
         if (myst.latestData != null)
         {
             cmb_theory.Text     = myst.latestData.theory;
             cmb_basis.Text      = myst.latestData.basis;
             cmb_star.Text       = myst.latestData.star;
             chk_mnosymm.Checked = myst.latestData.isnosymm;
             scfsetting          = myst.latestData.scf;
             iopsetting          = myst.latestData.iop;
         }
         sr.Close();
     }
     // if no-setting username
     if (myst.usrName == string.Empty)
     {
         var dedit = new simpleedit();
         dedit.description = "input your name";
         if (dedit.ShowDialog(this) == DialogResult.OK)
         {
             myst.usrName = dedit.inputText;
         }
     }
 }
Exemplo n.º 2
0
        // iop edit
        private void btn_iop_Click(object sender, EventArgs e)
        {
            var bedit = new simpleedit();

            bedit.inputText    = iopsetting;
            bedit.titleCaption = bedit.description = "IOP Setting";
            if (bedit.ShowDialog() == DialogResult.OK)
            {
                iopsetting = bedit.inputText;
            }
        }
Exemplo n.º 3
0
 // appname-set checked
 private void checkBox5_CheckedChanged(object sender, EventArgs e)
 {
     if (checkBox5.Checked)
     {
         var ed = new simpleedit();
         ed.titleCaption = "input your app command";
         ed.description  = "$i replaced input-file-path";
         ed.inputText    = runappname;
         if (ed.ShowDialog() == DialogResult.OK)
         {
             runappname = ed.inputText;
         }
         else
         {
             checkBox5.Checked = false;
         }
     }
 }
Exemplo n.º 4
0
        // set use-checkfile
        private void btn_usechk_Click(object sender, EventArgs e)
        {
            var dedit = new simpleedit();

            dedit.description = "enter filepath:";
            dedit.inputText   = myst.scrDir.Replace("%user%", myst.usrName);
            if (dedit.ShowDialog() == DialogResult.OK)
            {
                isUseCheckfile = true;
                var path = dedit.inputText;
                if (path.IndexOf(".") < 0)
                {
                    path += ".chk";
                }
                UseChkLocation = path;
                txb_name.Text  = Path.GetFileNameWithoutExtension(dedit.inputText);
                toggleControlEnabled(true);
                txb_lockpos.Enabled = false;
            }
        }