private SyncConfiguration GetCurrentConfigFromUI(bool applyVars = false)
        {
            SyncConfiguration config = new SyncConfiguration();
            Type type = config.GetType();

            FieldInfo[] properties = type.GetFields();

            foreach (FieldInfo property in properties)
            {
                if (property.Name.StartsWith("m_"))
                {
                    if (m_mapTextItems.ContainsKey(property.Name))
                    {
                        var v = m_mapTextItems[property.Name].Text;
                        v = applyVars ? RunImplementation.applyVariables(v, m_variables) : v;
                        property.SetValue(config, v);
                    }
                    else if (m_mapCheckItems.ContainsKey(property.Name))
                    {
                        property.SetValue(config, m_mapCheckItems[property.Name].Checked);
                    }
                    else
                    {
                        MessageBox.Show("unknown property:" + property.Name);
                    }
                }
            }

            return(config);
        }
 private void OnTextFieldChange(TextBox textBox, Label label)
 {
     if (Directory.Exists(RunImplementation.applyVariables(textBox.Text, m_variables)))
     {
         label.Text = "✓";
     }
     else
     {
         label.Text = "X";
     }
 }
        public static SyncConfiguration Deserialize(string sFilename, Dictionary <string, string> vars = null)
        {
            XmlSerializer deserializer = new XmlSerializer(typeof(SyncConfiguration));
            TextReader    reader       = new StreamReader(sFilename);
            var           txt          = reader.ReadToEnd();

            if (vars != null)
            {
                txt = RunImplementation.applyVariables(txt, vars);
            }

            var    stm = new MemoryStream(Encoding.UTF8.GetBytes(txt));
            object obj = deserializer.Deserialize(stm);

            reader.Close();
            return((SyncConfiguration)obj);
        }