Example #1
0
 private void btnMakeCurrent_Click(object sender, EventArgs e)
 {
     if (lbConfigurations.SelectedItems.Count != 1)
     {
         return;
     }
     System.IO.StreamReader r = null;
     try
     {
         r          = new System.IO.StreamReader(System.IO.Directory.GetFiles(ConfigDir, lbConfigurations.SelectedItem.ToString() + "." + QuasiStaticAcqSettings.FileExtension)[0]);
         WorkConfig = (QuasiStaticAcqSettings)xmls.Deserialize(r);
         r.Close();
         r = null;
         CurrentConfig.Copy(WorkConfig);
         MessageBox.Show("The selected configuration is now the current configuration.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception x)
     {
         MessageBox.Show(x.ToString(), "File error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     finally
     {
         if (r != null)
         {
             r.Close();
         }
         ShowWorkConfig();
     }
 }
Example #2
0
        private void OnLoad(object sender, EventArgs e)
        {
            LoadConfigurationList();
            if (WorkConfig == null)
            {
                WorkConfig = (QuasiStaticAcqSettings)CurrentConfig.Clone();
            }
            ShowWorkConfig();
            string summaryfile = this.DataDir;

            if (summaryfile.EndsWith("/") == false && summaryfile.EndsWith("\\") == false)
            {
                summaryfile += "/";
            }
            summaryfile        += QuasiStaticAcquisition.IndexedPatternTemplate;
            txtSummaryFile.Text = summaryfile;
            EnableControls(true);
        }