diff --git a/App.xaml.cs b/App.xaml.cs
index b14ffbd..bc6b951 100644
--- a/App.xaml.cs
+++ b/App.xaml.cs
@@ -47,12 +47,14 @@ namespace SunlightCentralizedControlManagement_SCCM_
return Assembly.Load(assemblyRawBytes);
}
}
+ private UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "SCCM.ini");
+
public App()
{
this.Startup += new StartupEventHandler(App_Startup);
this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);
- // SunlightCentralizedControlManagement_SCCM_.Properties.Resources.Culture = new System.Globalization.CultureInfo(Configini.IniReadvalue("SYS", "Language"));//设定语言
+ SunlightCentralizedControlManagement_SCCM_.Properties.Resources.Culture = new System.Globalization.CultureInfo(Configini.IniReadvalue("SYS", "Language"));//设定语言
}
System.Threading.Mutex mutex;
diff --git a/MainWindow.xaml b/MainWindow.xaml
index 5c308df..47a1b65 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -45,11 +45,11 @@
-
+
-
-
+
+
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index d180f19..7084b7d 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -89,6 +89,9 @@ namespace SunlightCentralizedControlManagement_SCCM_
help_page.Show();
}
-
+ private void ButtonSYS_Click(object sender, RoutedEventArgs e)
+ {
+ Picture.Content =new View.EngineerSetView();
+ }
}
}
diff --git a/SunlightCentralizedControlManagement_SCCM_.csproj b/SunlightCentralizedControlManagement_SCCM_.csproj
index 23c0d82..c62f3a5 100644
--- a/SunlightCentralizedControlManagement_SCCM_.csproj
+++ b/SunlightCentralizedControlManagement_SCCM_.csproj
@@ -96,6 +96,9 @@
+
+ EngineerSetView.xaml
+
info.xaml
@@ -123,6 +126,10 @@
MainWindow.xaml
Code
+
+ MSBuild:Compile
+ Designer
+
Designer
MSBuild:Compile
diff --git a/UserClass/IniFile.cs b/UserClass/IniFile.cs
index c14ea3e..2344bd1 100644
--- a/UserClass/IniFile.cs
+++ b/UserClass/IniFile.cs
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using System.Text;
-namespace DyeingComputer.UserClass
+namespace SunlightCentralizedControlManagement_SCCM_.UserClass
{
internal class IniFile
{
diff --git a/View/EngineerSetView.xaml b/View/EngineerSetView.xaml
new file mode 100644
index 0000000..0a756ce
--- /dev/null
+++ b/View/EngineerSetView.xaml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/View/EngineerSetView.xaml.cs b/View/EngineerSetView.xaml.cs
new file mode 100644
index 0000000..4979509
--- /dev/null
+++ b/View/EngineerSetView.xaml.cs
@@ -0,0 +1,56 @@
+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;
+
+namespace SunlightCentralizedControlManagement_SCCM_.View
+{
+ ///
+ /// EngineerSetView.xaml 的交互逻辑
+ ///
+ public partial class EngineerSetView : UserControl
+ {
+ public EngineerSetView()
+ {
+ InitializeComponent();
+ // 获取所有可用串口端口,并添加到comboBoxCOM
+ string[] ports = System.IO.Ports.SerialPort.GetPortNames();
+ comboBoxCOM0.ItemsSource = ports;
+ comboBoxCOM0.Text = Configini.IniReadvalue("SYS", "COM");
+
+ comboBoxCOM1.ItemsSource = ports;
+ comboBoxCOM1.Text = Configini.IniReadvalue("SYS", "COM");
+
+ comboBoxCOM2.ItemsSource = ports;
+ comboBoxCOM2.Text = Configini.IniReadvalue("SYS", "COM");
+
+ string[] Language = {"en-US","zh-CN","zh -TW" };
+ comboBoxLanguage.ItemsSource = Language;
+ comboBoxLanguage.Text = Configini.IniReadvalue("SYS", "Language");
+ }
+ //调用配置文件
+ private UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "SCCM.ini");
+
+ private void comboBoxCOM_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ Configini.IniWritevalue("SYS", "COM0", comboBoxCOM0.SelectedValue.ToString());
+ Configini.IniWritevalue("SYS", "COM1", comboBoxCOM1.SelectedValue.ToString());
+ Configini.IniWritevalue("SYS", "COM2", comboBoxCOM2.SelectedValue.ToString());
+ }
+
+ private void comboBoxLanguage_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ Configini.IniWritevalue("SYS", "Language", comboBoxLanguage.SelectedValue.ToString());
+ }
+ }
+}
diff --git a/View/Whole.xaml.cs b/View/Whole.xaml.cs
index ef086c9..5f8621b 100644
--- a/View/Whole.xaml.cs
+++ b/View/Whole.xaml.cs
@@ -37,15 +37,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
textBox.Margin = new Thickness( 5,5,0,0);
WholeView.Children.Add(textBox);
- TextBox textBox1 = new TextBox();
- textBox1.Text = "12431414";
- textBox1.Margin = new Thickness(5,5,0,0);
- // textBox1.HorizontalAlignment = HorizontalAlignment.Left;
- // textBox1.VerticalAlignment = VerticalAlignment.Top;
- textBox1.Background = new SolidColorBrush(Color.FromRgb(100, 100, 100));
- textBox1.Width = 100;
- textBox1.Height = 100;
- WholeView.Children.Add(textBox1);
+