You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.0 KiB
71 lines
2.0 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
using KPlan.Util;
|
|
|
|
namespace KPlan.Forms {
|
|
/// <summary>
|
|
/// Configure.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class Configure : Window {
|
|
public Configure() {
|
|
InitializeComponent();
|
|
KUtil.SetOwnerWindow(this);
|
|
LoadConfiguration();
|
|
}
|
|
|
|
private void b_Save_Click(object sender, RoutedEventArgs e) {
|
|
try {
|
|
SaveConfiguration();
|
|
Close();
|
|
}
|
|
catch (System.Exception ex) {
|
|
MessageBox.Show(this, "保存配置出错:" + ex.Message, "错误");
|
|
KUtil.LogErr(ex);
|
|
}
|
|
}
|
|
|
|
private void b_Apply_Click(object sender, RoutedEventArgs e) {
|
|
try {
|
|
SaveConfiguration();
|
|
}
|
|
catch (System.Exception ex) {
|
|
MessageBox.Show(this, "保存配置出错:" + ex.Message, "错误");
|
|
KUtil.LogErr(ex);
|
|
}
|
|
}
|
|
|
|
private void b_Close_Click(object sender, RoutedEventArgs e) {
|
|
Close();
|
|
}
|
|
|
|
private void SaveConfiguration() {
|
|
this.config_others.SaveConfiguration();
|
|
this.config_Classification.SaveConfiguration();
|
|
//部件库同步
|
|
this.config_PartSync.SaveConfiguration();
|
|
this.config_ProjSync.SaveConfiguration();
|
|
}
|
|
|
|
private void LoadConfiguration() {
|
|
this.config_others.LoadConfiguration();
|
|
this.config_Classification.LoadConfiguration();
|
|
this.config_Classification.LoadPartGroups();
|
|
//部件库同步
|
|
this.config_PartSync.LoadConfiguration();
|
|
this.config_ProjSync.LoadConfiguration();
|
|
}
|
|
}
|
|
}
|