private void MatchWindow_SourceInitialized(object sender, EventArgs e) { WindowSetting ws = new WindowSetting(); ws.SetXml(Properties.Settings.Default.MatchWindowSetting); Left = ws.Left; Top = ws.Top; Width = ws.Width; Height = ws.Height; WindowState = ws.State; }
private void MatchWindow_Closed(object sender, EventArgs e) { WindowSetting ws = new WindowSetting() { Top = this.Top, Left = this.Left, Width = this.Width, Height = this.Height, State = this.WindowState }; Properties.Settings.Default.MatchWindowSetting = ws.GetXml(); Properties.Settings.Default.Save(); }
public void SetXml(string xml) { XmlSerializer x = new XmlSerializer(typeof(WindowSetting)); using (StringReader sr = new StringReader(xml)) { WindowSetting w = (WindowSetting)x.Deserialize(sr); Top = w.Top; Left = w.Left; Width = w.Width; Height = w.Height; State = w.State; } }