public static TSOConfig Load(string source_file) { XmlReader reader = XmlReader.Create(source_file); XmlSerializer serializer = new XmlSerializer(typeof(TSOConfig)); TSOConfig config = serializer.Deserialize(reader) as TSOConfig; reader.Close(); return(config); }
public Form1() { InitializeComponent(); if (File.Exists(config_file)) { config = TSOConfig.Load(config_file); } else { config = new TSOConfig(); } propertyGrid1.SelectedObject = config; }