protected internal static AppSettings Load(CleanModQueue.Form1 form) { using (var s = GetSettingsStream()) { return Load(s, form); } }
private static AppSettings Load(Stream stream, CleanModQueue.Form1 form) { var ser = new XmlSerializer(typeof(AppSettings)); AppSettings settings = null; try { settings = (AppSettings) ser.Deserialize(stream); if (form != null) { settings.Parent = form; settings.SetGeom(); } settings.CleanConflicts(); settings.SetDefaultOrdering(); } catch (Exception ex1) { MessageBox.Show("Cannot read settings. " + ex1.Message, "CleanModQueue error"); settings = null; } return settings; }
protected internal AppSettings(string user, string password, CleanModQueue.Form1 form) : this() { RedditUser = user; RedditPwd = password; Parent = form; }