コード例 #1
0
ファイル: Match.xaml.cs プロジェクト: ThiloL/MatchMaster
        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;
        }
コード例 #2
0
ファイル: Match.xaml.cs プロジェクト: ThiloL/MatchMaster
        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();
        }
コード例 #3
0
        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;
            }
        }