diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9491a2f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,363 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Oo]ut/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
\ No newline at end of file
diff --git a/CopyCode.sln b/CopyCode.sln
new file mode 100644
index 0000000..a328905
--- /dev/null
+++ b/CopyCode.sln
@@ -0,0 +1,46 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.33027.164
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XKRS.UI.Main", "CopyCode\XKRS.UI.Main.csproj", "{9E42B387-BB80-4808-B9AB-4CE5F819A675}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{A4083DEF-5596-46B5-8100-E67DCFFA14DA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XKRS.Common.Model", "XKRS.Common.Model\XKRS.Common.Model.csproj", "{46D35E44-A2B1-403C-9E12-93759F91143F}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI", "UI", "{116AB5E1-0706-4E01-A99C-3F2B103961BA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XKRS.UI.Model.Winform", "XKRS.UI.Model.Winform\XKRS.UI.Model.Winform.csproj", "{0EABA88A-9DB3-46EA-B810-4F4FA6D2DFEA}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {9E42B387-BB80-4808-B9AB-4CE5F819A675}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9E42B387-BB80-4808-B9AB-4CE5F819A675}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9E42B387-BB80-4808-B9AB-4CE5F819A675}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9E42B387-BB80-4808-B9AB-4CE5F819A675}.Release|Any CPU.Build.0 = Release|Any CPU
+ {46D35E44-A2B1-403C-9E12-93759F91143F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {46D35E44-A2B1-403C-9E12-93759F91143F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {46D35E44-A2B1-403C-9E12-93759F91143F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {46D35E44-A2B1-403C-9E12-93759F91143F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0EABA88A-9DB3-46EA-B810-4F4FA6D2DFEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0EABA88A-9DB3-46EA-B810-4F4FA6D2DFEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0EABA88A-9DB3-46EA-B810-4F4FA6D2DFEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0EABA88A-9DB3-46EA-B810-4F4FA6D2DFEA}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {9E42B387-BB80-4808-B9AB-4CE5F819A675} = {116AB5E1-0706-4E01-A99C-3F2B103961BA}
+ {46D35E44-A2B1-403C-9E12-93759F91143F} = {A4083DEF-5596-46B5-8100-E67DCFFA14DA}
+ {0EABA88A-9DB3-46EA-B810-4F4FA6D2DFEA} = {116AB5E1-0706-4E01-A99C-3F2B103961BA}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {27D8466D-FF59-4412-AF2F-6F25C396BBD1}
+ EndGlobalSection
+EndGlobal
diff --git a/CopyCode/AdvancedPwdFrm.Designer.cs b/CopyCode/AdvancedPwdFrm.Designer.cs
new file mode 100644
index 0000000..1b60ea5
--- /dev/null
+++ b/CopyCode/AdvancedPwdFrm.Designer.cs
@@ -0,0 +1,122 @@
+
+namespace XKRS.UI.Main
+{
+ partial class AdvancedPwdFrm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.btnExitLogin = new System.Windows.Forms.Button();
+ this.txtPwd = new System.Windows.Forms.TextBox();
+ this.btnCancel = new System.Windows.Forms.Button();
+ this.btnOK = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold);
+ this.label1.Location = new System.Drawing.Point(32, 32);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(52, 14);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "密码:";
+ //
+ // btnExitLogin
+ //
+ this.btnExitLogin.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnExitLogin.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold);
+ this.btnExitLogin.Location = new System.Drawing.Point(12, 63);
+ this.btnExitLogin.Name = "btnExitLogin";
+ this.btnExitLogin.Size = new System.Drawing.Size(75, 23);
+ this.btnExitLogin.TabIndex = 2;
+ this.btnExitLogin.Text = "退出登录";
+ this.btnExitLogin.UseVisualStyleBackColor = true;
+ this.btnExitLogin.Click += new System.EventHandler(this.btnExitLogin_Click);
+ //
+ // txtPwd
+ //
+ this.txtPwd.Font = new System.Drawing.Font("宋体", 10F);
+ this.txtPwd.Location = new System.Drawing.Point(126, 28);
+ this.txtPwd.Name = "txtPwd";
+ this.txtPwd.PasswordChar = '*';
+ this.txtPwd.Size = new System.Drawing.Size(236, 23);
+ this.txtPwd.TabIndex = 0;
+ this.txtPwd.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtPwd_KeyDown);
+ //
+ // btnCancel
+ //
+ this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnCancel.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold);
+ this.btnCancel.Location = new System.Drawing.Point(208, 63);
+ this.btnCancel.Name = "btnCancel";
+ this.btnCancel.Size = new System.Drawing.Size(75, 23);
+ this.btnCancel.TabIndex = 2;
+ this.btnCancel.Text = "Cancel";
+ this.btnCancel.UseVisualStyleBackColor = true;
+ this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+ //
+ // btnOK
+ //
+ this.btnOK.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold);
+ this.btnOK.Location = new System.Drawing.Point(289, 63);
+ this.btnOK.Name = "btnOK";
+ this.btnOK.Size = new System.Drawing.Size(75, 23);
+ this.btnOK.TabIndex = 2;
+ this.btnOK.Text = "OK";
+ this.btnOK.UseVisualStyleBackColor = true;
+ this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
+ //
+ // AdvancedPwdFrm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(388, 98);
+ this.ControlBox = false;
+ this.Controls.Add(this.btnOK);
+ this.Controls.Add(this.btnCancel);
+ this.Controls.Add(this.txtPwd);
+ this.Controls.Add(this.btnExitLogin);
+ this.Controls.Add(this.label1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.Name = "AdvancedPwdFrm";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "用户验证";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Button btnExitLogin;
+ private System.Windows.Forms.TextBox txtPwd;
+ private System.Windows.Forms.Button btnCancel;
+ private System.Windows.Forms.Button btnOK;
+ }
+}
\ No newline at end of file
diff --git a/CopyCode/AdvancedPwdFrm.cs b/CopyCode/AdvancedPwdFrm.cs
new file mode 100644
index 0000000..054521a
--- /dev/null
+++ b/CopyCode/AdvancedPwdFrm.cs
@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Configuration;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace XKRS.UI.Main
+{
+ public partial class AdvancedPwdFrm : Form
+ {
+ public static Action OnLoginOK { get; set; }//内置泛型委托,以参数形式传递方法
+ string pwd = "";//定义一个字符串字段存储密码
+ string PWD//属性
+ {
+ get
+ {
+ if (string.IsNullOrEmpty(pwd))
+ {
+ var pwdSetting = ConfigurationManager.AppSettings["Pwd"];//获取当前默认的数据
+ if (!string.IsNullOrEmpty(pwdSetting))//如果输入非空且不是null
+ {
+ pwd = pwdSetting.ToString();
+ }
+ else
+ {
+ pwd = "p@ssw0rd";
+ }
+ }
+ return pwd;
+ }
+ }
+ public AdvancedPwdFrm()
+ {
+ InitializeComponent();
+ }
+
+ private void btnCancel_Click(object sender, EventArgs e)
+ {
+ DialogResult = DialogResult.Cancel;
+ }
+
+ private void btnOK_Click(object sender, EventArgs e)
+ {
+ CheckInputPassword();
+ }
+ private void CheckInputPassword()
+ {
+ string input = txtPwd.Text.Trim();//移出当前字符串前导与结尾空白字符串
+ if (string.IsNullOrWhiteSpace(input))
+ {
+ MessageBox.Show("Please input password");
+ return;
+ }
+ if (input == PWD)
+ {
+ OnLoginOK?.Invoke(true);
+ DialogResult = DialogResult.OK;
+ }
+ else
+ {
+ MessageBox.Show("Wrong Password");
+ DialogResult = DialogResult.Cancel;
+ }
+
+ }
+
+ private void txtPwd_KeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.Enter)
+ {
+ CheckInputPassword();
+ }
+ }
+
+ private void btnExitLogin_Click(object sender, EventArgs e)
+ {
+ OnLoginOK?.Invoke(false);
+ this.DialogResult = DialogResult.Abort;
+ }
+ }
+}
diff --git a/CopyCode/AdvancedPwdFrm.resx b/CopyCode/AdvancedPwdFrm.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/CopyCode/AdvancedPwdFrm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/CopyCode/App.config b/CopyCode/App.config
new file mode 100644
index 0000000..56efbc7
--- /dev/null
+++ b/CopyCode/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CopyCode/MainFrm.Designer.cs b/CopyCode/MainFrm.Designer.cs
new file mode 100644
index 0000000..25caff5
--- /dev/null
+++ b/CopyCode/MainFrm.Designer.cs
@@ -0,0 +1,232 @@
+
+namespace XKRS.UI.Main
+{
+ partial class MainFrm
+ {
+ ///
+ /// 必需的设计器变量。
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// 清理所有正在使用的资源。
+ ///
+ /// 如果应释放托管资源,为 true;否则为 false。
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows 窗体设计器生成的代码
+
+ ///
+ /// 设计器支持所需的方法 - 不要修改
+ /// 使用代码编辑器修改此方法的内容。
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainFrm));
+ this.menuMain = new System.Windows.Forms.MenuStrip();
+ this.ststripDevices = new System.Windows.Forms.StatusStrip();
+ this.tsslLoginStatus = new System.Windows.Forms.ToolStripStatusLabel();
+ this.stsStripLayout = new System.Windows.Forms.StatusStrip();
+ this.tssBtnLayout = new System.Windows.Forms.ToolStripSplitButton();
+ this.保存布局ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.重置布局ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.布局另存为ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.stsStripWarning = new System.Windows.Forms.StatusStrip();
+ this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
+ this.ctmsExit = new System.Windows.Forms.ContextMenuStrip(this.components);
+ this.tsmiExitProgram = new System.Windows.Forms.ToolStripMenuItem();
+ this.dockPanelMain = new WeifenLuo.WinFormsUI.Docking.DockPanel();
+ this.ststripDevices.SuspendLayout();
+ this.stsStripLayout.SuspendLayout();
+ this.ctmsExit.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // menuMain
+ //
+ this.menuMain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.menuMain.AutoSize = false;
+ this.menuMain.Dock = System.Windows.Forms.DockStyle.None;
+ this.menuMain.Location = new System.Drawing.Point(0, 0);
+ this.menuMain.Name = "menuMain";
+ this.menuMain.Padding = new System.Windows.Forms.Padding(6, 1, 0, 1);
+ this.menuMain.Size = new System.Drawing.Size(728, 24);
+ this.menuMain.TabIndex = 1;
+ this.menuMain.Text = "menuStrip1";
+ //
+ // ststripDevices
+ //
+ this.ststripDevices.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.ststripDevices.AutoSize = false;
+ this.ststripDevices.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(96)))), ((int)(((byte)(130)))));
+ this.ststripDevices.Dock = System.Windows.Forms.DockStyle.None;
+ this.ststripDevices.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.tsslLoginStatus});
+ this.ststripDevices.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
+ this.ststripDevices.Location = new System.Drawing.Point(0, 333);
+ this.ststripDevices.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+ this.ststripDevices.Name = "ststripDevices";
+ this.ststripDevices.Size = new System.Drawing.Size(651, 25);
+ this.ststripDevices.SizingGrip = false;
+ this.ststripDevices.TabIndex = 5;
+ this.ststripDevices.Text = "statusStrip1";
+ //
+ // tsslLoginStatus
+ //
+ this.tsslLoginStatus.ForeColor = System.Drawing.SystemColors.Control;
+ this.tsslLoginStatus.Name = "tsslLoginStatus";
+ this.tsslLoginStatus.Size = new System.Drawing.Size(44, 20);
+ this.tsslLoginStatus.Text = "未登录";
+ //
+ // stsStripLayout
+ //
+ this.stsStripLayout.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.stsStripLayout.AutoSize = false;
+ this.stsStripLayout.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(96)))), ((int)(((byte)(130)))));
+ this.stsStripLayout.Dock = System.Windows.Forms.DockStyle.None;
+ this.stsStripLayout.GripMargin = new System.Windows.Forms.Padding(0);
+ this.stsStripLayout.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.tssBtnLayout});
+ this.stsStripLayout.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
+ this.stsStripLayout.Location = new System.Drawing.Point(612, 333);
+ this.stsStripLayout.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
+ this.stsStripLayout.Name = "stsStripLayout";
+ this.stsStripLayout.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.stsStripLayout.Size = new System.Drawing.Size(186, 25);
+ this.stsStripLayout.SizingGrip = false;
+ this.stsStripLayout.TabIndex = 8;
+ this.stsStripLayout.Text = "statusStrip1";
+ //
+ // tssBtnLayout
+ //
+ this.tssBtnLayout.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.tssBtnLayout.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.保存布局ToolStripMenuItem,
+ this.重置布局ToolStripMenuItem,
+ this.布局另存为ToolStripMenuItem});
+ this.tssBtnLayout.ForeColor = System.Drawing.SystemColors.Control;
+ this.tssBtnLayout.Image = ((System.Drawing.Image)(resources.GetObject("tssBtnLayout.Image")));
+ this.tssBtnLayout.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.tssBtnLayout.Name = "tssBtnLayout";
+ this.tssBtnLayout.Size = new System.Drawing.Size(72, 23);
+ this.tssBtnLayout.Text = "布局配置";
+ this.tssBtnLayout.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage;
+ //
+ // 保存布局ToolStripMenuItem
+ //
+ this.保存布局ToolStripMenuItem.Name = "保存布局ToolStripMenuItem";
+ this.保存布局ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
+ this.保存布局ToolStripMenuItem.Text = "保存布局";
+ //
+ // 重置布局ToolStripMenuItem
+ //
+ this.重置布局ToolStripMenuItem.Name = "重置布局ToolStripMenuItem";
+ this.重置布局ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
+ this.重置布局ToolStripMenuItem.Text = "重置布局";
+ //
+ // 布局另存为ToolStripMenuItem
+ //
+ this.布局另存为ToolStripMenuItem.Name = "布局另存为ToolStripMenuItem";
+ this.布局另存为ToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
+ this.布局另存为ToolStripMenuItem.Text = "布局另存为";
+ //
+ // stsStripWarning
+ //
+ this.stsStripWarning.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.stsStripWarning.Dock = System.Windows.Forms.DockStyle.None;
+ this.stsStripWarning.Location = new System.Drawing.Point(596, 0);
+ this.stsStripWarning.MinimumSize = new System.Drawing.Size(100, 24);
+ this.stsStripWarning.Name = "stsStripWarning";
+ this.stsStripWarning.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
+ this.stsStripWarning.Size = new System.Drawing.Size(202, 24);
+ this.stsStripWarning.SizingGrip = false;
+ this.stsStripWarning.TabIndex = 11;
+ this.stsStripWarning.Text = "statusStrip1";
+ //
+ // notifyIcon
+ //
+ this.notifyIcon.BalloonTipTitle = "asdasd";
+ this.notifyIcon.ContextMenuStrip = this.ctmsExit;
+ this.notifyIcon.Text = "notifyIcon1";
+ //
+ // ctmsExit
+ //
+ this.ctmsExit.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.tsmiExitProgram});
+ this.ctmsExit.Name = "ctmsExit";
+ this.ctmsExit.Size = new System.Drawing.Size(125, 26);
+ //
+ // tsmiExitProgram
+ //
+ this.tsmiExitProgram.Name = "tsmiExitProgram";
+ this.tsmiExitProgram.Size = new System.Drawing.Size(124, 22);
+ this.tsmiExitProgram.Text = "退出程序";
+ //
+ // dockPanelMain
+ //
+ this.dockPanelMain.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.dockPanelMain.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World);
+ this.dockPanelMain.Location = new System.Drawing.Point(0, 24);
+ this.dockPanelMain.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+ this.dockPanelMain.Name = "dockPanelMain";
+ this.dockPanelMain.Size = new System.Drawing.Size(800, 310);
+ this.dockPanelMain.TabIndex = 2;
+ //
+ // MainFrm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(798, 358);
+ this.Controls.Add(this.dockPanelMain);
+ this.Controls.Add(this.stsStripWarning);
+ this.Controls.Add(this.stsStripLayout);
+ this.Controls.Add(this.ststripDevices);
+ this.Controls.Add(this.menuMain);
+ this.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World);
+ this.IsMdiContainer = true;
+ this.KeyPreview = true;
+ this.MainMenuStrip = this.menuMain;
+ this.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+ this.Name = "MainFrm";
+ this.Text = "MainFrm";
+ this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+ this.Load += new System.EventHandler(this.MainFrm_Load);
+ this.ststripDevices.ResumeLayout(false);
+ this.ststripDevices.PerformLayout();
+ this.stsStripLayout.ResumeLayout(false);
+ this.stsStripLayout.PerformLayout();
+ this.ctmsExit.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.MenuStrip menuMain;
+ private System.Windows.Forms.StatusStrip ststripDevices;
+ private System.Windows.Forms.ToolStripStatusLabel tsslLoginStatus;
+ private System.Windows.Forms.StatusStrip stsStripLayout;
+ private System.Windows.Forms.ToolStripSplitButton tssBtnLayout;
+ private System.Windows.Forms.ToolStripMenuItem 保存布局ToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem 重置布局ToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem 布局另存为ToolStripMenuItem;
+ private System.Windows.Forms.StatusStrip stsStripWarning;
+ private System.Windows.Forms.NotifyIcon notifyIcon;
+ private System.Windows.Forms.ContextMenuStrip ctmsExit;
+ private System.Windows.Forms.ToolStripMenuItem tsmiExitProgram;
+ private WeifenLuo.WinFormsUI.Docking.DockPanel dockPanelMain;
+ }
+}
+
diff --git a/CopyCode/MainFrm.cs b/CopyCode/MainFrm.cs
new file mode 100644
index 0000000..e611d68
--- /dev/null
+++ b/CopyCode/MainFrm.cs
@@ -0,0 +1,260 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using WeifenLuo.WinFormsUI.Docking;
+using XKRS.Common.Factory;
+using XKRS.Common.Interface;
+using XKRS.Common.Model.Helper;
+using XKRS.UI.Model.Winform;
+
+namespace XKRS.UI.Main
+{
+ public partial class MainFrm : Form
+ {
+ IProcess _process = null;
+ System.Diagnostics.Process process = new System.Diagnostics.Process();
+ System.Diagnostics.Process processB = new System.Diagnostics.Process();
+ System.Diagnostics.Process processC = new System.Diagnostics.Process();
+ public MainFrm()
+ {
+ InitializeComponent();
+ System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.RealTime;
+ var theme = new VS2015LightTheme();
+ stsStripLayout.BackColor = ststripDevices.BackColor = Color.FromArgb(64, 64, 64);
+ dockPanelMain.Theme = theme;
+ VisualStudioToolStripExtender extender = new VisualStudioToolStripExtender();
+ extender.SetStyle(menuMain, VisualStudioToolStripExtender.VsVersion.Vs2015, theme);
+ InitialMenu()
+
+ }
+
+ readonly ManualResetEvent _allMenuLoadDoneHandle = new ManualResetEvent(false);
+
+
+
+
+ private void MainFrm_Load(object sender, EventArgs e)
+ {
+ LoadLayoutFromXML(m_deserializeMenuFrm);
+ _allMenuLoadDoneHandle.Set();
+
+ AdvancedPwdFrm.OnLoginOK = OnLoginOK;
+
+ LoadProcess();
+ LoadLayoutFromXML(m_deserializeDeviceRunFrm);
+ LoadProcess(false);
+ Openexe();
+ }
+
+ private void Openexe()
+ {
+ string strPathExe = Environment.CurrentDirectory + "\\BDebug2022110201_5" + "\\NJJ-ZK.exe";
+ process.StartInfo.WorkingDirectory = Environment.CurrentDirectory + "\\BDebug2022110201_5";
+ process.StartInfo.FileName = strPathExe;
+ process.StartInfo.Arguments = null;//-s -t 可以用来关机或重启
+ process.StartInfo.UseShellExecute = false;
+ process.StartInfo.RedirectStandardInput = false;//true
+ process.StartInfo.RedirectStandardOutput = false;
+ process.StartInfo.RedirectStandardError = false;
+ process.StartInfo.CreateNoWindow = false;
+ process.Start();//启动
+
+ string strPathExe2 = Environment.CurrentDirectory + "\\CDebug2022110201_4" + "\\NJJ-ZK.exe";
+ processB.StartInfo.WorkingDirectory = Environment.CurrentDirectory + "\\CDebug2022110201_4";
+ processB.StartInfo.FileName = strPathExe2;
+ processB.StartInfo.Arguments = null;//-s -t 可以用来关机、开机或重启
+ processB.StartInfo.UseShellExecute = false;
+ processB.StartInfo.RedirectStandardInput = false; //true
+ processB.StartInfo.RedirectStandardOutput = false; //true
+ processB.StartInfo.RedirectStandardError = false;
+ processB.StartInfo.CreateNoWindow = false;
+ processB.Start();//启动
+
+ string strPathExe3 = Environment.CurrentDirectory + "\\ADebug2022110201_2" + "\\NJJ-ZK.exe";
+ processC.StartInfo.WorkingDirectory = Environment.CurrentDirectory + "\\ADebug2022110201_2";
+ processC.StartInfo.FileName = strPathExe3;
+ processC.StartInfo.Arguments = null;//-s -t 可以用来关机、开机或重启
+ processC.StartInfo.UseShellExecute = false;
+ processC.StartInfo.RedirectStandardInput = false; //true
+ processC.StartInfo.RedirectStandardOutput = false; //true
+ processC.StartInfo.RedirectStandardError = false;
+ processC.StartInfo.CreateNoWindow = false;
+ processC.Start();//启动
+ }
+ private void Killexe()
+ {
+ try
+ {
+ process.CloseMainWindow();//通过向进程的主窗口发送关闭消息来关闭拥有用户界面的进程
+ process.Close();//释放与此组件关联的所有资源
+ processB.CloseMainWindow();//通过向进程的主窗口发送关闭消息来关闭拥有用户界面的进程
+ processB.Close();//释放与此组件关联的所有资源
+ processC.CloseMainWindow();//通过向进程的主窗口发送关闭消息来关闭拥有用户界面的进程
+ processC.Close();//释放与此组件关联的所有资源
+ }
+ catch
+ {
+
+ }
+ }
+
+ private List LoadProcessCode()
+ {
+ var systemProcessCodes = ProcessFactory.GetProcessCodes();
+ var avaiableProcessCodes = SettingHelper.GetProcessCodes();
+ List pCodes = new List();
+ if (avaiableProcessCodes.Count > 0)
+ {
+ pCodes = avaiableProcessCodes.Intersect(systemProcessCodes).ToList();
+ }
+ else
+ {
+ pCodes = systemProcessCodes;
+ }
+ if (pCodes.Count > 1)
+ {
+ pCodes.RemoveAll(u => u == "");
+ }
+ return pCodes;
+ }
+ private List LoadProductionCode()
+ {
+ return SettingHelper.GetProductionCodes();
+ }
+
+ ///
+ /// 载入流程
+ ///
+ /// 是否为初始化流程
+ private void LoadProcess(bool isInitialProcess = true)
+ {
+ if(isInitialProcess)//初次创建流程
+ {
+ var processCodes = LoadProcessCode();
+ var productionCodes = LoadProductionCode();
+ _process = ProcessFactory.CreateStationProcess(processCodes[0], productionCodes[0], out string msg);
+ if (!string.IsNullOrWhiteSpace(msg))
+ {
+ _process = null;
+
+ throw new ProcessException($"创建失败,{msg}", null, ExceptionLevel.Fatal);
+ }
+ _process.InitialProcess("");
+ }
+
+ }
+
+
+ #region Login
+ bool isLogin = false;
+ bool IsLogin
+ {
+ get => isLogin;
+ set
+ {
+ isLogin = value;
+ tsslLoginStatus.Text = isLogin ? "已登录" : "未登录";
+ foreach(var dock in dockPanelMain.Contents)
+ {
+ var menuFrm = dock as MenuFrmBase;
+ if (menuFrm != null)
+ {
+ menuFrm.SetLoginStatus(isLogin);
+ }
+ }
+ }
+ }
+
+ private void OnLoginOK(bool isLogin)
+ {
+ IsLogin = isLogin;
+ }
+ #endregion
+
+
+ #region Layout布局
+
+ string _layoutFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"{SettingHelper.GetSelectLayout()}.layout");//路径
+ private DeserializeDockContent m_deserializeMenuFrm;
+ private DeserializeDockContent m_deserializeDeviceRunFrm;
+
+
+
+
+
+ private void LoadLayoutFromXML(DeserializeDockContent dContent)
+ {
+ if (!File.Exists(_layoutFile))
+ return;
+ dockPanelMain.SuspendLayout(true);//悬挂式布局
+
+ CloseAllDeviceFrm();
+ while (dockPanelMain.Contents.Count > 0)
+ {
+ dockPanelMain.Contents[0].DockHandler.DockPanel = null;
+ }
+ using (FileStream stream = new FileStream(_layoutFile, FileMode.Open))
+ {
+ dockPanelMain.LoadFromXml(stream, dContent);
+ stream.Close();
+ }
+ dockPanelMain.ResumeLayout(true, true);
+ }
+ #endregion
+
+ #region CloseForm
+ private void DeviceDisplayFrm_FormClosed(object sender,FormClosedEventArgs e)
+ {
+ string id = (sender as DeviceRunFrmBase).Device.Id;
+ if(showedDeviceUIDict.ContainsKey(id))
+ {
+ showedDeviceUIDict.Remove(id);
+ }
+ }
+
+ private void CloseAllDeviceFrm()
+ {
+ this.Invoke(new Action(() =>
+ {
+ this.SuspendLayout();
+ dockPanelMain.Contents.Select(u =>
+ {
+ if (u is DeviceRunFrmBase runFrmBase)
+ {
+ return runFrmBase;
+ }
+ else
+ {
+ return null;
+ }
+ }).ToList().ForEach(u =>
+ {
+ if (u == null)
+ return;
+ if (_process.DeviceCollection.Any(d => d.Id == u.Device.Id))
+ return;
+ u.DockPanel = null;
+ u.Close();
+ });
+ this.ResumeLayout();
+ }));
+ }
+
+ #endregion
+
+ #region Device Display 设备展示到底部状态栏
+ readonly Dictionary showedDeviceUIDict = new Dictionary();
+
+ #endregion
+
+
+ }
+}
diff --git a/CopyCode/MainFrm.resx b/CopyCode/MainFrm.resx
new file mode 100644
index 0000000..c462719
--- /dev/null
+++ b/CopyCode/MainFrm.resx
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
+ 132, 17
+
+
+ 265, 17
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+ 400, 17
+
+
+ 546, 17
+
+
+ 657, 17
+
+
\ No newline at end of file
diff --git a/CopyCode/Program.cs b/CopyCode/Program.cs
new file mode 100644
index 0000000..7f7e8aa
--- /dev/null
+++ b/CopyCode/Program.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace XKRS.UI.Main
+{
+ static class Program
+ {
+ ///
+ /// 应用程序的主入口点。
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new MainFrm());
+ }
+ }
+}
diff --git a/CopyCode/Properties/AssemblyInfo.cs b/CopyCode/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..e854bfc
--- /dev/null
+++ b/CopyCode/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("框架")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HP Inc.")]
+[assembly: AssemblyProduct("XKRS.UI.Main")]
+[assembly: AssemblyCopyright("Copyright © HP Inc. 2023")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("9e42b387-bb80-4808-b9ab-4ce5f819a675")]
+
+// 程序集的版本信息由下列四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/CopyCode/Properties/Resources.Designer.cs b/CopyCode/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..bb47573
--- /dev/null
+++ b/CopyCode/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace XKRS.UI.Main.Properties {
+ using System;
+
+
+ ///
+ /// 一个强类型的资源类,用于查找本地化的字符串等。
+ ///
+ // 此类是由 StronglyTypedResourceBuilder
+ // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+ // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // (以 /str 作为命令选项),或重新生成 VS 项目。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// 返回此类使用的缓存的 ResourceManager 实例。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("XKRS.UI.Main.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 重写当前线程的 CurrentUICulture 属性,对
+ /// 使用此强类型资源类的所有资源查找执行重写。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/CopyCode/Properties/Resources.resx b/CopyCode/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/CopyCode/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/CopyCode/Properties/Settings.Designer.cs b/CopyCode/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..4301681
--- /dev/null
+++ b/CopyCode/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace XKRS.UI.Main.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/CopyCode/Properties/Settings.settings b/CopyCode/Properties/Settings.settings
new file mode 100644
index 0000000..3964565
--- /dev/null
+++ b/CopyCode/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/CopyCode/XKRS.UI.Main.csproj b/CopyCode/XKRS.UI.Main.csproj
new file mode 100644
index 0000000..0a27134
--- /dev/null
+++ b/CopyCode/XKRS.UI.Main.csproj
@@ -0,0 +1,113 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {9E42B387-BB80-4808-B9AB-4CE5F819A675}
+ WinExe
+ XKRS.UI.Main
+ XKRS.UI.Main
+ v4.7.2
+ 512
+ true
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ x64
+ pdbonly
+ false
+ ..\Release\
+ DEBUG;TRACE
+ prompt
+ 4
+ false
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ..\packages\DockPanelSuite.3.1.0\lib\net40\WeifenLuo.WinFormsUI.Docking.dll
+
+
+ ..\packages\DockPanelSuite.ThemeVS2015.3.1.0\lib\net40\WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll
+
+
+
+
+ Form
+
+
+ AdvancedPwdFrm.cs
+
+
+ Form
+
+
+ MainFrm.cs
+
+
+
+
+ AdvancedPwdFrm.cs
+
+
+ MainFrm.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+ True
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
+ {46D35E44-A2B1-403C-9E12-93759F91143F}
+ XKRS.Common.Model
+
+
+ {0EABA88A-9DB3-46EA-B810-4F4FA6D2DFEA}
+ XKRS.UI.Model.Winform
+
+
+
+
\ No newline at end of file
diff --git a/CopyCode/packages.config b/CopyCode/packages.config
new file mode 100644
index 0000000..6f4caeb
--- /dev/null
+++ b/CopyCode/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/XKRS.Common.Model/App.config b/XKRS.Common.Model/App.config
new file mode 100644
index 0000000..56efbc7
--- /dev/null
+++ b/XKRS.Common.Model/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/XKRS.Common.Model/Exception/ExceptionHelper.cs b/XKRS.Common.Model/Exception/ExceptionHelper.cs
new file mode 100644
index 0000000..16a8eb8
--- /dev/null
+++ b/XKRS.Common.Model/Exception/ExceptionHelper.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XKRS.Common.Model.Helper
+{
+ public enum ExceptionLevel
+ {
+ Info=0,
+ Warning=1,
+ Fatal=2,
+ }
+
+ public class ProcessException : Exception
+ {
+ public ExceptionLevel Level { get; set; } = ExceptionLevel.Warning;
+
+ public ProcessException(string error, Exception ex = null, ExceptionLevel lvl = ExceptionLevel.Warning)
+ {
+ Level = lvl;
+ ExceptionNotice();
+ }
+ public void ExceptionNotice()
+ {
+
+ }
+ }
+
+
+
+
+ public static class ExceptionHelper
+ {
+
+ public static string GetExceptionMessage(this Exception ex)
+ {
+ string msg = "异常信息:" + ex.Message;
+ //当前异常不为空
+ if (ex.InnerException != null)
+ {
+ msg += ";\t内部异常信息:" + ex.InnerException.GetExceptionMessage();
+ }
+ return msg;
+ }
+ }
+}
diff --git a/XKRS.Common.Model/Factory/FactoryHelper.cs b/XKRS.Common.Model/Factory/FactoryHelper.cs
new file mode 100644
index 0000000..a8cb34b
--- /dev/null
+++ b/XKRS.Common.Model/Factory/FactoryHelper.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.IO;
+using System.Reflection;
+
+namespace XKRS.Common.Factory
+{
+ public static class FactoryHelper
+ {
+ const string DLLPATTERN = "XKRS.*.dll";
+ //readonly指示只能在声明期间或在同一个类的构造函数中向字段赋值
+ //可以在字段声明和构造函数中多次分配和重新分配只读字段。
+ //构造函数退出后,不能分配 readonly 字段。
+ private static readonly string[] DLLPATTERNS = { "XKRS." };
+
+
+
+ public static Dictionary GetAttributeType() where T : Attribute
+ {
+ Dictionary attrTyprDict = new Dictionary();//创建一个键值对集合
+ var dllFiles = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory)
+ .GetFiles("*.dll")
+ .Where(fi => DLLPATTERNS.Any(pattern => fi.Name.StartsWith(pattern)))
+ .Select(u =>
+ {
+ try
+ {
+ return u.FullName;//获取完整目录
+ }
+ catch { }
+ return string.Empty;//返回一个只读的空字符串,
+ })
+ .Where(s => !string.IsNullOrEmpty(s))
+ .ToList();
+ dllFiles.ForEach(f =>
+ {
+ try
+ {
+ Assembly assm = Assembly.LoadFrom(f);
+ if (assm != null)
+ {
+ assm.GetTypes().ToList().ForEach(t =>
+ {
+ T attr = t.GetCustomAttribute();
+ if (attr != null)
+ {
+ attrTyprDict[attr] = t;
+ }
+ });
+ }
+ }
+ catch(Exception)
+ {
+
+ }
+ });
+ return attrTyprDict;
+ }
+ }
+}
diff --git a/XKRS.Common.Model/Factory/ProcessFactory.cs b/XKRS.Common.Model/Factory/ProcessFactory.cs
new file mode 100644
index 0000000..f404e53
--- /dev/null
+++ b/XKRS.Common.Model/Factory/ProcessFactory.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XKRS.Common.Interface;
+using XKRS.Common.Model.Helper;
+
+namespace XKRS.Common.Factory
+{
+ public static class ProcessFactory
+ {
+ ///
+ /// 获取项目中所有流程,即寻找所有带有[Process]的
+ ///
+ /// 返回流程名称列表
+ public static List GetProcessCodes()
+ {
+ var attrs = FactoryHelper.GetAttributeType().Keys;
+ List processCodes = attrs.Select(u => u.ProcessCode).Distinct().ToList();
+ return processCodes;
+ }
+ ///
+ /// 获取StationProcess
+ ///
+ /// 流程代码
+ ///
+ /// 异常信息
+ ///
+ public static IProcess CreateStationProcess(string processCode,string productionCode,out string msg)
+ {
+ IProcess proc = null;
+ msg = "";
+
+ try
+ {
+ var typeDict = FactoryHelper.GetAttributeType();
+ foreach(KeyValuePairpair in typeDict)
+ {
+ if (typeof(IProcess).IsAssignableFrom(pair.Value) && pair.Key.ProcessCode == processCode)
+ {
+ proc = Activator.CreateInstance(pair.Value, productionCode) as IProcess;
+ break;
+ }
+ }
+ }
+ catch(Exception ex)
+ {
+ msg = ex.GetExceptionMessage();
+ }
+ return proc;
+ }
+
+
+ }
+}
diff --git a/XKRS.Common.Model/Helper/AttributeHelper.cs b/XKRS.Common.Model/Helper/AttributeHelper.cs
new file mode 100644
index 0000000..fde5141
--- /dev/null
+++ b/XKRS.Common.Model/Helper/AttributeHelper.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using static XKRS.Common.Model.Helper.EnumHelper;
+
+namespace XKRS.Common.Model.Helper
+{
+ public class AttributeHelper:Attribute
+ {
+
+ }
+
+ public class ProcessAttribute : Attribute
+ {
+ public string ProcessCode { get; set; }
+ public DeviceAttributeType AttrType { get; set; }
+ public ProcessAttribute(string stationCode,DeviceAttributeType attrType)
+ {
+ ProcessCode = stationCode;
+ AttrType = attrType;
+ }
+ }
+}
diff --git a/XKRS.Common.Model/Helper/EnumHelper.cs b/XKRS.Common.Model/Helper/EnumHelper.cs
new file mode 100644
index 0000000..9968062
--- /dev/null
+++ b/XKRS.Common.Model/Helper/EnumHelper.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XKRS.Common.Model.Helper
+{
+ public static class EnumHelper
+ {
+ public enum DeviceState
+ {
+
+ }
+
+ [Flags]//将枚举视为位域
+ public enum DeviceAttributeType
+ {
+
+ }
+ }
+}
diff --git a/XKRS.Common.Model/Helper/SettingHelper.cs b/XKRS.Common.Model/Helper/SettingHelper.cs
new file mode 100644
index 0000000..5d9e1d0
--- /dev/null
+++ b/XKRS.Common.Model/Helper/SettingHelper.cs
@@ -0,0 +1,92 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XKRS.Common.Model.Helper
+{
+ public static class SettingHelper
+ {
+ const string SETTINGFILE = "Setting.json";
+ //声明一个SettingInfo类型的字段
+ public static SettingInfo SettingInfo;
+ public static string SettingPath => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, SETTINGFILE);
+
+
+
+
+
+
+ ///
+ /// 声明一个静态方法,获取选择的布局
+ ///
+ /// 返回当前布局
+ public static string GetSelectLayout()
+ {
+ return SettingInfo.CurrLayout;
+ }
+ ///
+ /// 获取生产代码,
+ ///
+ /// 字符串类型的集合
+ public static List GetProductionCodes()
+ {
+ if (SettingInfo.ProductionCodes.Count == 0)
+ {
+ SettingInfo.ProductionCodes.Add("Default");
+ }
+ if (!string.IsNullOrWhiteSpace(SettingInfo.DefaultProduction))
+ {
+ if (SettingInfo.ProductionCodes.Contains(SettingInfo.DefaultProduction))
+ {
+ SettingInfo.ProductionCodes.Remove(SettingInfo.DefaultProduction);
+ SettingInfo.ProductionCodes.Insert(0, SettingInfo.DefaultProduction);
+ }
+ }
+ return SettingInfo.ProductionCodes;
+
+ }
+
+ ///
+ /// 获取过程代码
+ ///
+ ///
+ public static List GetProcessCodes()
+ {
+ if (!string.IsNullOrWhiteSpace(SettingInfo.DefaultProcess))
+ {
+ if (SettingInfo.ProcessCodes.Contains(SettingInfo.DefaultProcess))
+ {
+ SettingInfo.ProcessCodes.Remove(SettingInfo.DefaultProcess);
+ SettingInfo.ProcessCodes.Insert(0, SettingInfo.DefaultProcess);
+ }
+ }
+ return SettingInfo.ProcessCodes;
+ }
+
+
+
+
+
+
+
+
+ }
+
+ ///
+ /// 设置信息类,声明自动属性
+ ///
+ public class SettingInfo
+ {
+ public List ProcessCodes { get; set; } = new List();
+ public List ProductionCodes { get; set; } = new List();
+
+ public string DefaultProcess { get; set; }
+ public string DefaultProduction { get; set; }
+ public string CurrLayout { get; set; } = "";
+
+
+ }
+}
diff --git a/XKRS.Common.Model/Interface/IDevice.cs b/XKRS.Common.Model/Interface/IDevice.cs
new file mode 100644
index 0000000..52379ec
--- /dev/null
+++ b/XKRS.Common.Model/Interface/IDevice.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using static XKRS.Common.Model.Helper.EnumHelper;
+
+namespace XKRS.Common.Interface
+{
+ public interface IDevice:IDisposable,INotifyPropertyChanged,ISimpleDevice,ILogger,IExceptionHandler
+ {
+
+ event Action OnDeviceStateChanged;
+ }
+
+
+ public interface ISimpleDevice
+ {
+ string Id { get; set; }
+ }
+ public class SimpleDevice : ISimpleDevice
+ {
+ public string Id { get; set; }
+ }
+
+}
diff --git a/XKRS.Common.Model/Interface/IExceptionHandler.cs b/XKRS.Common.Model/Interface/IExceptionHandler.cs
new file mode 100644
index 0000000..017f814
--- /dev/null
+++ b/XKRS.Common.Model/Interface/IExceptionHandler.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XKRS.Common.Interface
+{
+ public interface IExceptionHandler
+ {
+
+ }
+}
diff --git a/XKRS.Common.Model/Interface/ILogger.cs b/XKRS.Common.Model/Interface/ILogger.cs
new file mode 100644
index 0000000..c82c456
--- /dev/null
+++ b/XKRS.Common.Model/Interface/ILogger.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XKRS.Common.Interface
+{
+ public interface ILogger
+ {
+ //event Action OnLog;
+
+ }
+}
diff --git a/XKRS.Common.Model/Interface/IProcess.cs b/XKRS.Common.Model/Interface/IProcess.cs
new file mode 100644
index 0000000..9bfae90
--- /dev/null
+++ b/XKRS.Common.Model/Interface/IProcess.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+
+namespace XKRS.Common.Interface
+{
+ public interface IProcess:ILogger,IExceptionHandler
+ {
+
+
+ ///
+ /// 流程使用的硬件设备集合
+ ///
+ List DeviceCollection { get; set; }
+
+
+ ///
+ /// 初始化Process
+ ///
+ ///
+ void InitialProcess(string configPath);
+
+
+
+ }
+}
diff --git a/XKRS.Common.Model/XKRS.Common.Model.csproj b/XKRS.Common.Model/XKRS.Common.Model.csproj
new file mode 100644
index 0000000..cbf8627
--- /dev/null
+++ b/XKRS.Common.Model/XKRS.Common.Model.csproj
@@ -0,0 +1,57 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {46D35E44-A2B1-403C-9E12-93759F91143F}
+ Library
+ XKRS.Common.Model
+ XKRS.Common.Model
+ v4.7.2
+ 512
+ false
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ x64
+ pdbonly
+ true
+ ..\Release\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/XKRS.UI.Model.Winform/App.config b/XKRS.UI.Model.Winform/App.config
new file mode 100644
index 0000000..56efbc7
--- /dev/null
+++ b/XKRS.UI.Model.Winform/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/XKRS.UI.Model.Winform/UI/DockContent/DeviceRunFrmBase.Designer.cs b/XKRS.UI.Model.Winform/UI/DockContent/DeviceRunFrmBase.Designer.cs
new file mode 100644
index 0000000..822ca37
--- /dev/null
+++ b/XKRS.UI.Model.Winform/UI/DockContent/DeviceRunFrmBase.Designer.cs
@@ -0,0 +1,45 @@
+
+namespace XKRS.UI.Model.Winform
+{
+ partial class DeviceRunFrmBase
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.SuspendLayout();
+ //
+ // DeviceRunFrmBase
+ //
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+ this.ClientSize = new System.Drawing.Size(284, 261);
+ this.Name = "DeviceRunFrmBase";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/XKRS.UI.Model.Winform/UI/DockContent/DeviceRunFrmBase.cs b/XKRS.UI.Model.Winform/UI/DockContent/DeviceRunFrmBase.cs
new file mode 100644
index 0000000..d7d2b2c
--- /dev/null
+++ b/XKRS.UI.Model.Winform/UI/DockContent/DeviceRunFrmBase.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using WeifenLuo.WinFormsUI.Docking;
+using XKRS.Common.Interface;
+
+namespace XKRS.UI.Model.Winform
+{
+ public partial class DeviceRunFrmBase : DockContent
+ {
+ public IDevice Device { get; set; }
+
+ public DeviceRunFrmBase()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/XKRS.UI.Model.Winform/UI/DockContent/DeviceRunFrmBase.resx b/XKRS.UI.Model.Winform/UI/DockContent/DeviceRunFrmBase.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/XKRS.UI.Model.Winform/UI/DockContent/DeviceRunFrmBase.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/XKRS.UI.Model.Winform/UI/DockContent/MenuFrmBase.Designer.cs b/XKRS.UI.Model.Winform/UI/DockContent/MenuFrmBase.Designer.cs
new file mode 100644
index 0000000..fe4eea8
--- /dev/null
+++ b/XKRS.UI.Model.Winform/UI/DockContent/MenuFrmBase.Designer.cs
@@ -0,0 +1,48 @@
+
+namespace XKRS.UI.Model.Winform
+{
+ partial class MenuFrmBase
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.SuspendLayout();
+ //
+ // MenuFrmBase
+ //
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+ this.ClientSize = new System.Drawing.Size(474, 344);
+ this.DoubleBuffered = true;
+ this.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World);
+ this.Name = "MenuFrmBase";
+ this.Text = "MenuFrmBase";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/XKRS.UI.Model.Winform/UI/DockContent/MenuFrmBase.cs b/XKRS.UI.Model.Winform/UI/DockContent/MenuFrmBase.cs
new file mode 100644
index 0000000..24a1054
--- /dev/null
+++ b/XKRS.UI.Model.Winform/UI/DockContent/MenuFrmBase.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using WeifenLuo.WinFormsUI.Docking;
+using XKRS.Common.Interface;
+
+namespace XKRS.UI.Model.Winform
+{
+ public partial class MenuFrmBase : DockContent
+ {
+ public Action OnUploadProcess { get; set; }
+ public event Action OnIsLoginChanged;
+
+ public string Id { get; set; } = Guid.NewGuid().ToString();
+
+ public MenuFrmBase()
+ {
+ InitializeComponent();
+ }
+ protected virtual bool IsLogin { get; set; }
+ public virtual void SetLoginStatus(bool isLogin)
+ {
+ IsLogin = isLogin;
+ OnIsLoginChanged?.Invoke(IsLogin);
+ }
+
+
+
+ }
+}
diff --git a/XKRS.UI.Model.Winform/UI/DockContent/MenuFrmBase.resx b/XKRS.UI.Model.Winform/UI/DockContent/MenuFrmBase.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/XKRS.UI.Model.Winform/UI/DockContent/MenuFrmBase.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/XKRS.UI.Model.Winform/XKRS.UI.Model.Winform.csproj b/XKRS.UI.Model.Winform/XKRS.UI.Model.Winform.csproj
new file mode 100644
index 0000000..c38258b
--- /dev/null
+++ b/XKRS.UI.Model.Winform/XKRS.UI.Model.Winform.csproj
@@ -0,0 +1,83 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {0EABA88A-9DB3-46EA-B810-4F4FA6D2DFEA}
+ Library
+ XKRS.UI.Model.Winform
+ XKRS.UI.Model.Winform
+ v4.7.2
+ 512
+ false
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ false
+ ..\Release\
+ DEBUG;TRACE
+ prompt
+ 4
+ false
+
+
+
+
+
+
+
+
+
+
+ DeviceRunFrmBase.cs
+
+
+ MenuFrmBase.cs
+
+
+
+
+
+
+
+
+
+
+ ..\packages\DockPanelSuite.3.1.0\lib\net40\WeifenLuo.WinFormsUI.Docking.dll
+
+
+
+
+ Form
+
+
+ DeviceRunFrmBase.cs
+
+
+ Form
+
+
+ MenuFrmBase.cs
+
+
+
+
+ {46D35E44-A2B1-403C-9E12-93759F91143F}
+ XKRS.Common.Model
+
+
+
+
\ No newline at end of file
diff --git a/XKRS.UI.Model.Winform/packages.config b/XKRS.UI.Model.Winform/packages.config
new file mode 100644
index 0000000..0f715e2
--- /dev/null
+++ b/XKRS.UI.Model.Winform/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file