Exemple #1
0
 private void NewConstantKrystalMenuItem_Click(object sender, EventArgs e)
 {
     using(NewConstantKrystalDialog dlg = new NewConstantKrystalDialog())
     {
         DialogResult result = dlg.ShowDialog();
         if(result == DialogResult.OK)
         {
             String constantValueStr = dlg.ConstantKrystalValue;
             if(constantValueStr.Length > 0)
             {
                 uint constantValue = uint.Parse(constantValueStr);
                 ConstantKrystal ck = new ConstantKrystal(K.UntitledKrystalName, constantValue);
                 ck.Save(false);  // false: do not ovewrite existing files
             }
         }
     }
 }
Exemple #2
0
 private void NewConstantKrystalMenuItem_Click(object sender, EventArgs e)
 {
     using (NewConstantKrystalDialog dlg = new NewConstantKrystalDialog())
     {
         DialogResult result = dlg.ShowDialog();
         if (result == DialogResult.OK)
         {
             String constantValueStr = dlg.ConstantKrystalValue;
             if (constantValueStr.Length > 0)
             {
                 uint            constantValue = uint.Parse(constantValueStr);
                 ConstantKrystal ck            = new ConstantKrystal(K.UntitledKrystalName, constantValue);
                 ck.Save(false);  // false: do not ovewrite existing files
             }
         }
     }
 }
Exemple #3
0
 private void OpenConstantKrystalMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string constantKrystalFilepath = K.GetFilepathFromOpenFileDialog(K.DialogFilterIndex.constant);
         if (constantKrystalFilepath.Length > 0)
         {
             ConstantKrystal          constantKrystal = new ConstantKrystal(constantKrystalFilepath);
             NewConstantKrystalDialog dlg             = new NewConstantKrystalDialog();
             dlg.Text = constantKrystal.Name;
             dlg.SetButtons();
             dlg.ConstantKrystalValue = constantKrystal.MaxValue.ToString();
             dlg.Show();
         }
     }
     catch (ApplicationException ae)
     {
         MessageBox.Show(ae.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Exemple #4
0
 private void OpenConstantKrystalMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string constantKrystalFilepath = K.GetFilepathFromOpenFileDialog(K.DialogFilterIndex.constant);
         if (constantKrystalFilepath.Length > 0)
         {
             ConstantKrystal constantKrystal = new ConstantKrystal(constantKrystalFilepath);
             NewConstantKrystalDialog dlg = new NewConstantKrystalDialog();
             dlg.Text = constantKrystal.Name;
             dlg.SetButtons();
             dlg.ConstantKrystalValue = constantKrystal.MaxValue.ToString();
             dlg.Show();
         }
     }
     catch (ApplicationException ae)
     {
         MessageBox.Show(ae.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }