Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
6e7b279807
8 files changed
+94
-15
No files matched your search
+3
-1
@@ -47,12 +47,14 @@ namespace SunlightCentralizedControlManagement_SCCM_
|
|||||||
return Assembly.Load(assemblyRawBytes);
|
return Assembly.Load(assemblyRawBytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private UserClass.IniFile.IniFiles Configini = new UserClass.IniFile.IniFiles(Convert.ToString(System.AppDomain.CurrentDomain.BaseDirectory) + "SCCM.ini");
|
||||||
|
|
||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
this.Startup += new StartupEventHandler(App_Startup);
|
this.Startup += new StartupEventHandler(App_Startup);
|
||||||
this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);
|
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;
|
System.Threading.Mutex mutex;
|
||||||
|
|||||||
+3
-3
@@ -45,11 +45,11 @@
|
|||||||
<materialDesign:PopupBox Foreground="White" Margin="10" PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
|
<materialDesign:PopupBox Foreground="White" Margin="10" PlacementMode="BottomAndAlignRightEdges" StaysOpen="False">
|
||||||
<StackPanel Width="150">
|
<StackPanel Width="150">
|
||||||
<Button Content="账号"/>
|
<Button Content="账号"/>
|
||||||
<Button Content="{x:Static lang:Resources.SysSet}"/>
|
<Button Content="{x:Static lang:Resources.SysSet}" Click="ButtonSYS_Click"/>
|
||||||
<Button Content="{x:Static lang:Resources.Help}" Click="Buttonhelp_Click"/>
|
<Button Content="{x:Static lang:Resources.Help}" Click="Buttonhelp_Click"/>
|
||||||
<Separator/>
|
<Separator/>
|
||||||
<Button x:Name="ButtonMinimize" Content="最小化" Click="ButtonMinimize_Click"/>
|
<Button x:Name="ButtonMinimize" Content="{x:Static lang:Resources.Minimize}" Click="ButtonMinimize_Click"/>
|
||||||
<Button x:Name="ButtonMaximize" Content="最大化" Click="ButtonMaximize_Click"/>
|
<Button x:Name="ButtonMaximize" Content="{x:Static lang:Resources.Maximize}" Click="ButtonMaximize_Click"/>
|
||||||
<Button x:Name="ButtonPopUpLogout" Content="{x:Static lang:Resources.PopUpLogout}" Click="ButtonPopUpLogout_Click"/>
|
<Button x:Name="ButtonPopUpLogout" Content="{x:Static lang:Resources.PopUpLogout}" Click="ButtonPopUpLogout_Click"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</materialDesign:PopupBox>
|
</materialDesign:PopupBox>
|
||||||
|
|||||||
+4
-1
@@ -89,6 +89,9 @@ namespace SunlightCentralizedControlManagement_SCCM_
|
|||||||
help_page.Show();
|
help_page.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ButtonSYS_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Picture.Content =new View.EngineerSetView();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -96,6 +96,9 @@
|
|||||||
<Compile Include="UserClass\UserControlMenuItem.cs" />
|
<Compile Include="UserClass\UserControlMenuItem.cs" />
|
||||||
<Compile Include="ViewModel\MainWindowViewModel.cs" />
|
<Compile Include="ViewModel\MainWindowViewModel.cs" />
|
||||||
<Compile Include="ViewModel\ViewModelLocator.cs" />
|
<Compile Include="ViewModel\ViewModelLocator.cs" />
|
||||||
|
<Compile Include="View\EngineerSetView.xaml.cs">
|
||||||
|
<DependentUpon>EngineerSetView.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="View\info.xaml.cs">
|
<Compile Include="View\info.xaml.cs">
|
||||||
<DependentUpon>info.xaml</DependentUpon>
|
<DependentUpon>info.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -123,6 +126,10 @@
|
|||||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Page Include="View\EngineerSetView.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Include="View\info.xaml">
|
<Page Include="View\info.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace DyeingComputer.UserClass
|
namespace SunlightCentralizedControlManagement_SCCM_.UserClass
|
||||||
{
|
{
|
||||||
internal class IniFile
|
internal class IniFile
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<UserControl x:Class="SunlightCentralizedControlManagement_SCCM_.View.EngineerSetView"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:SunlightCentralizedControlManagement_SCCM_.View"
|
||||||
|
xmlns:lang="clr-namespace:SunlightCentralizedControlManagement_SCCM_.Properties"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="630" d:DesignWidth="1280" VerticalAlignment="Top">
|
||||||
|
<Grid>
|
||||||
|
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,10,0,0" x:Name="comboBoxCOM0" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxCOM_SelectionChanged" FontSize="20" IsEditable="True" IsReadOnly="True"/>
|
||||||
|
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,10,0,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.Port}" VerticalAlignment="Top" Width="120" FontSize="25"/>
|
||||||
|
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,50,0,0" x:Name="comboBoxCOM1" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxCOM_SelectionChanged" FontSize="20" IsEditable="True" IsReadOnly="True"/>
|
||||||
|
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,90,0,0" x:Name="comboBoxCOM2" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxCOM_SelectionChanged" FontSize="20" IsEditable="True" IsReadOnly="True"/>
|
||||||
|
<ComboBox HorizontalAlignment="Left" Height="30" Margin="150,130,0,0" x:Name="comboBoxLanguage" VerticalAlignment="Top" Width="200" SelectionChanged="comboBoxLanguage_SelectionChanged" FontSize="20" IsEditable="True" IsReadOnly="True"/>
|
||||||
|
<TextBlock HorizontalAlignment="Left" Height="40" Margin="10,130,0,0" TextWrapping="Wrap" Text="{x:Static lang:Resources.Language}" VerticalAlignment="Top" Width="120" FontSize="25"/>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// EngineerSetView.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-9
@@ -37,15 +37,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
textBox.Margin = new Thickness( 5,5,0,0);
|
textBox.Margin = new Thickness( 5,5,0,0);
|
||||||
WholeView.Children.Add(textBox);
|
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);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user