Beispiel #1
0
 private void NewLineKrystalMenuItem_Click(object sender, EventArgs e)
 {
     using (NewLineKrystalDialog dlg = new NewLineKrystalDialog())
     {
         DialogResult result = dlg.ShowDialog();
         if (result == DialogResult.OK)
         {
             string lineValue = dlg.LineKrystalValue;
             if (lineValue.Length > 0)
             {
                 LineKrystal lk = new LineKrystal(K.UntitledKrystalName, lineValue);
                 lk.Save(false);  // false: do not ovewrite existing files
             }
         }
     }
 }
Beispiel #2
0
 private void OpenLineKrystalMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string lineKrystalFilepath = K.GetFilepathFromOpenFileDialog(K.DialogFilterIndex.line);
         if (lineKrystalFilepath.Length > 0)
         {
             LineKrystal          lineKrystal = new LineKrystal(lineKrystalFilepath);
             NewLineKrystalDialog dlg         = new NewLineKrystalDialog();
             dlg.Text = lineKrystal.Name;
             dlg.SetButtons();
             dlg.LineKrystalValue = K.GetStringOfUnsignedInts(lineKrystal.Strands[0].Values);
             dlg.Show();
         }
     }
     catch (ApplicationException ae)
     {
         MessageBox.Show(ae.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Beispiel #3
0
 private void OpenLineKrystalMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string lineKrystalFilepath = K.GetFilepathFromOpenFileDialog(K.DialogFilterIndex.line);
         if (lineKrystalFilepath.Length > 0)
         {
             LineKrystal lineKrystal = new LineKrystal(lineKrystalFilepath);
             NewLineKrystalDialog dlg = new NewLineKrystalDialog();
             dlg.Text = lineKrystal.Name;
             dlg.SetButtons();
             dlg.LineKrystalValue = K.GetStringOfUnsignedInts(lineKrystal.Strands[0].Values);
             dlg.Show();
         }
     }
     catch (ApplicationException ae)
     {
         MessageBox.Show(ae.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
Beispiel #4
0
 private void NewLineKrystalMenuItem_Click(object sender, EventArgs e)
 {
     using(NewLineKrystalDialog dlg = new NewLineKrystalDialog())
     {
         DialogResult result = dlg.ShowDialog();
         if(result == DialogResult.OK)
         {
             string lineValue = dlg.LineKrystalValue;
             if(lineValue.Length > 0)
             {
                 LineKrystal lk = new LineKrystal(K.UntitledKrystalName, lineValue);
                 lk.Save(false);  // false: do not ovewrite existing files
             }
         }
     }
 }