public static TTSetting Load(string path) { System.Xml.Serialization.XmlSerializer xser = new System.Xml.Serialization.XmlSerializer(typeof(TTSetting)); System.IO.StreamReader sr = new System.IO.StreamReader(path, System.Text.Encoding.Default); TTSetting rtn = (TTSetting)xser.Deserialize(sr); sr.Close(); return(rtn); }
public void LoadSettings() { if (System.IO.File.Exists(TTFile + ".config")) { mySettings = TTSetting.Load(TTFile + ".config"); } else { mySettings = new TTSetting(); } tbxPath.Text = mySettings.SaveingPath; tbxNamePattern.Text = mySettings.FileNamePattern; tbxFixDel.Text = mySettings.FixDelete; cbxSepDir.IsChecked = mySettings.MultiDir; }