将Windows窗体属性绑定到C#中的应用程序设置的最佳方法?

将Windows窗体属性绑定到C#中的应用程序设置的最佳方法?,c#,.net,C#,.net,在一个需要重新分解的桌面应用程序中,我有几段代码如下所示: private void LoadSettings() { WindowState = Properties.Settings.Default.WindowState; Location = Properties.Settings.Default.WindowLocation; ... } private void SaveSettings() { Properties.Settings.Default

在一个需要重新分解的桌面应用程序中,我有几段代码如下所示:

private void LoadSettings()
{
    WindowState = Properties.Settings.Default.WindowState;
    Location = Properties.Settings.Default.WindowLocation;
    ...
}

private void SaveSettings()
{
    Properties.Settings.Default.WindowState = WindowState;
    Properties.Settings.Default.WindowLocation = Location;
    ...
}
替换这个的最好方法是什么?项目施加的限制:

  • VisualStudio2005
  • C#/.NET 2.0
  • Windows窗体
更新

对于子孙后代,我还发现了两个有用的教程:和

我问了一个关于使用此技术绑定表单大小的后续问题。我把它们分开,以帮助那些寻找类似问题的人。
如果在设计器中打开windows窗体,请查看属性框。第一项应为“(应用程序设置)”。下面是“(PropertyBinding)”。在那里,你可以找到完全按照你的意愿去做的选择