AppMain.MainForm.SaveAppSettings C# (CSharp) Method

SaveAppSettings() private method

アプリの設定を設定ファイルに保存する。
private SaveAppSettings ( ) : void
return void
		private void SaveAppSettings()
		{
			this.appSettings.left   = this.Left;
			this.appSettings.top    = this.Top;
			this.appSettings.width  = this.Width;
			this.appSettings.height = this.Height;

			StreamWriter writer = null;
			try
			{
				XmlSerializer serializer = new XmlSerializer(typeof(AppSettings));
				writer = new StreamWriter(Application.StartupPath + MainForm.settingFileName);
				serializer.Serialize(writer, this.appSettings);
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
			finally
			{
				if(writer != null) writer.Close();
			}
		}//SaveAppSettings