Beispiel #1
0
 private void LoadConfig_Click(object sender, System.EventArgs e)
 {
     if (ifl == null || imng == null)
     {
         LoadAssemblyModule();
     }
     System.IO.FileStream f = null;
     try
     {
         f = new FileStream(ConfigFile.Text, FileMode.Open, FileAccess.Read);
         System.Xml.Serialization.XmlSerializer xmls = new System.Xml.Serialization.XmlSerializer(imng.Config.GetType());
         SySal.Management.Configuration         cnf  = imng.Config;
         cnf         = (SySal.Management.Configuration)xmls.Deserialize(f);
         imng.Config = cnf;
         f.Close();
     }
     catch (Exception x)
     {
         if (f != null)
         {
             f.Close();
         }
         MessageBox.Show(x.Message);
     }
 }
Beispiel #2
0
 private void EditConfig_Click(object sender, System.EventArgs e)
 {
     if (ifl == null || imng == null)
     {
         LoadAssemblyModule();
     }
     SySal.Management.Configuration tempc = imng.Config;
     if (imng.EditConfiguration(ref tempc))
     {
         imng.Config = tempc;
     }
 }
Beispiel #3
0
        /// <summary>
        /// GUI editor to configure the algorithm parameters.
        /// </summary>
        /// <param name="c">the configuration to be edited.</param>
        /// <returns><c>true</c> if the configuration is accepted, <c>false</c> otherwise.</returns>
        public bool EditConfiguration(ref SySal.Management.Configuration c)
        {
            EditConfigForm ec = new EditConfigForm();

            ec.C = (SySal.Processing.MCSAnnecy.Configuration)(c.Clone());
            if (ec.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                c = (SySal.Processing.MCSAnnecy.Configuration)(ec.C.Clone());
                return(true);
            }
            return(false);
        }