Commit 778796a7 authored by surukun's avatar surukun

konkedemo

parents
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
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;
namespace KonkeDemo
{
public partial class Configure : Form
{
public static Configure Configure_interface = null;
private string MyDepartment = "";//工厂信息
public string MyToolName = "";
public Configure()
{
InitializeComponent();
Configure_interface = this;
MyDepartment = LoadForm.Load_interface.GetRootDepartment();
InitControl();
}
private void InitControl()
{
btnConfigSerialPort.Click += BtnConfigSerialPort_Click;
btnConfigSerialPort.Visible = false;
FormComboBox.SelectedValueChanged += FormComboBox_SelectedValueChanged;
}
private void BtnConfigSerialPort_Click(object sender, EventArgs e)
{
try
{
}
catch (Exception ex)
{
MessageBox.Show("串口设置失败:" + ex.ToString());
}
}
#region 传递值
public string GetTempbatchNumber() //传递sap订单号
{
//return DEVName.Text;
return SAPDDH.Text.ToUpper();
}
public string GetMySAPB() //传递SAP编号
{
return SAPBH.Text.ToUpper();
}
public string GetMyToolName()
{
return MyToolName;
}
public string GetTempfactoryId() //传递工厂ID
{
return factoryIdText.Text;
}
public string GetTempfactoryLineId() //传递产线ID
{
return factoryLineIdText.Text;
}
public string GetProductModel() //传递设备型号
{
return ProductModel.Text;
}
public string GetProductName() //传递设备名称
{
return DevNameText.Text;
}
public string GetTempSVNumber() //传递sv
{
return SVNumber.Text;
}
public string GetTempHVNumber() //传递hv
{
return HVNumber.Text;
}
public string GetSerialSlogan1() //传递辅助串口1
{
return SerialSlogan1.Text;
}
public string GetproductID() //传递产品ID
{
return productID.Text;
}
public string GetMyRssi() //传递RSSI
{
return RSSIText.Text;
}
public int GetMyPowerH() //传递Power
{
string MyhighP = System.Text.RegularExpressions.Regex.Replace(HighPower.Text, @"[^0-9]+", "");
return Convert.ToInt16(MyhighP);
}
public int GetMyPowerL() //传递Power
{
string MyLowP = System.Text.RegularExpressions.Regex.Replace(LowPower.Text, @"[^0-9]+", "");
return Convert.ToInt16(MyLowP);
}
public string GetMyForm() //传递界面
{
return FormComboBox.Text;
}
public string GetJHH() //传递计划号
{
//return DEVName.Text;
return SAPDDH.Text.ToUpper();
}
public string GetWIFIName() //传递wifi名称
{
return SSIDName.Text;
}
public string GetLayout()
{
return comboBox1.Text;
}
#endregion
#region 窗口最大化控件变化
ControlChangesWithWindows ConfigureWindows = new ControlChangesWithWindows(); //随窗口改变大小类的实例化
private static int ConfigureColseAll = 1; //是否关闭所有窗口 1-关闭所有 0-关闭当前
//将控件的宽,高,左边距,顶边距和字体大小暂存到tag属性中
private void Configure_Load(object sender, EventArgs e)
{
try
{
btnLogWindow.Click += ConsoleShow_Click;
ConfigureWindows.MethodForLoad(this);//调用方法
}
catch (Exception ex)
{
MessageBox.Show("界面Load-操作失败:" + ex.ToString());
}
}
//根据窗体大小调整控件大小
private void Configure_Resize(object sender, EventArgs e)
{
try
{
int Width = this.Width;
int Height = this.Height;
if (Width >= 816 && Height >= 528)
{
this.AutoScroll = false;
ConfigureWindows.MethodForResize(this);//
}
else
this.AutoScroll = true;
}
catch (Exception ex)
{
MessageBox.Show("窗口改变大小-操作失败:" + ex.ToString());
}
}
#endregion
#region 页面切换
private void BackToLoad_Click(object sender, EventArgs e)
{
ConfigureColseAll = 0;
this.Close();
}
private void SerialSlogan1_MouseClick(object sender, MouseEventArgs e)
{
}
private void SerialSlogan2_MouseClick(object sender, MouseEventArgs e)
{
}
#endregion
#region 事件
//关闭时显示登陆界面
private void Configure_Closing(object sender, FormClosingEventArgs e)
{
try
{
if (ConfigureColseAll == 1)
System.Environment.Exit(0);
else
{
ConfigureColseAll = 1;
this.DialogResult = DialogResult.OK;
}
}
catch (Exception ex)
{
MessageBox.Show("操作界面关闭-操作失败:" + ex.ToString());
}
}
//点击确定,进入测试界面
private void ConfigureOK_Click(object sender, EventArgs e)
{
try
{
ConfigureText.Visible = false;
CreatePvtForm();
//验证正确,登陆配置界面
this.Hide(); //隐藏主界面
FormMain FCTest = new FormMain();
if (FCTest.ShowDialog() == DialogResult.OK) //以对话框形式显示配置界面
{
this.Show(); //显示主界面
}
}
catch (Exception ex)
{
MessageBox.Show("确定按钮-操作失败:" + ex.ToString());
}
}
private void DEVName_SelectedIndexChanged(object sender, EventArgs e)
{
GetSelectedItem();
}
private void GetSelectedItem()
{
try
{
if (DEVName.Text.Contains("请选择"))
{
return;
}
}
catch (Exception ex)
{
MessageBox.Show("选择工单-操作失败:" + ex.ToString());
}
}
#endregion
#region 测试阶段 + 测试界面的配置选择
private void XMLComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
BindProcessStepOption();
}
private void BindProcessStepOption(string Str = "")
{
FormComboBox.Items.Clear();
if (Str == "")
Str = XMLComboBox.Text;
}
private void FormComboBox_SelectedValueChanged(object sender, EventArgs e)
{
CreatePvtForm();
}
private void CreatePvtForm()
{
}
#endregion
private void DEVName_TextChanged(object sender, EventArgs e)
{
//Console.WriteLine("DEVName_TextChanged:{0}, [SelectedValue:{1}]", DEVName.Text, UtilControlDataBind.GetSelectedItemValue(DEVName));
GetSelectedItem();
}
private void ConsoleShow_Click(object sender, EventArgs e)
{
}
}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace KonkeDemo
{
public class ControlChangesWithWindows
{
private float TempFormX;//当前窗体的宽度
private float TempFormY;//当前窗体的高度
// 将控件的宽,高,左边距,顶边距和字体大小暂存到tag属性中
// <param name="cons">递归控件中的控件</param>
//传入参数当前窗口
private void setTag(Control cons)
{
foreach (Control con in cons.Controls)
{
con.Tag = con.Width + ":" + con.Height + ":" + con.Left + ":" + con.Top + ":" + con.Font.Size;
if (con.Controls.Count > 0)
{
setTag(con);
}
}
}
//根据窗体大小调整控件大小
//传入参数,窗体宽度缩放比例,窗体高度缩放比例,当前窗口
private void setControls(float newx, float newy, Control cons)
{
//遍历窗体中的控件,重新设置控件的值
foreach (Control con in cons.Controls)
{
if (con != null)
{
string[] mytag = con.Tag?.ToString().Split(new char[] { ':' });//获取控件的Tag属性值,并分割后存储字符串数组
if (mytag != null && mytag.Length >= 5)
{
float a = System.Convert.ToSingle(mytag[0]) * newx;//根据窗体缩放比例确定控件的值,宽度
con.Width = (int)a;//宽度
a = System.Convert.ToSingle(mytag[1]) * newy;//高度
con.Height = (int)(a);
a = System.Convert.ToSingle(mytag[2]) * newx;//左边距离
con.Left = (int)(a);
a = System.Convert.ToSingle(mytag[3]) * newy;//上边缘距离
con.Top = (int)(a);
Single currentSize = System.Convert.ToSingle(mytag[4]) * newy;//字体大小
con.Font = new Font(con.Font.Name, currentSize, con.Font.Style, con.Font.Unit);
if (con.Controls.Count > 0)
{
setControls(newx, newy, con);
}
}
}
}
}
//传入参数:当前窗口
//用于窗口load事件调用
public void MethodForLoad(Control cons)
{
TempFormX = cons.Width;//获取窗体的宽度
TempFormY = cons.Height;//获取窗体的高度
setTag(cons);
}
/// <summary>
/// 窗口load事件调用,设置控件初始大小
/// </summary>
/// <param name="cons">当前窗口</param>
/// <param name="ctlSizeReferent">大小变化的参考控件</param>
public void MethodForLoad(Control cons, Control ctlSizeReferent)
{
TempFormX = ctlSizeReferent.Width;//获取窗体的宽度
TempFormY = ctlSizeReferent.Height;//获取窗体的高度
setTag(cons);
}
//引用SendMessage函数
[DllImport("user32.dll", EntryPoint = "SendMessage")]
private static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, IntPtr lParam);
//传入参数:当前窗口
//用于窗口Resize事件调用
public void MethodForResize(Control cons)
{
float newx = (cons.Width) / TempFormX; //窗体宽度缩放比例
float newy = (cons.Height) / TempFormY;//窗体高度缩放比例
SendMessage(cons.Handle, 0xB, 0, IntPtr.Zero); //解决控件较多时,改变大小闪一下问题
setControls(newx, newy, cons);
SendMessage(cons.Handle, 0XB, 1, IntPtr.Zero);
cons.Invalidate(true);
}
/// <summary>
/// 窗口Resize事件调用
/// </summary>
/// <param name="cons">当前窗口</param>
/// <param name="ctlSizeReferent">大小变化的参考控件</param>
public void MethodForResize(Control cons, Control ctlSizeReferent)
{
float newx = (ctlSizeReferent.Width) / TempFormX; //窗体宽度缩放比例
float newy = (ctlSizeReferent.Height) / TempFormY;//窗体高度缩放比例
SendMessage(cons.Handle, 0xB, 0, IntPtr.Zero); //解决控件较多时,改变大小闪一下问题
setControls(newx, newy, cons);
SendMessage(cons.Handle, 0XB, 1, IntPtr.Zero);
cons.Invalidate(true);
}
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
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;
namespace KonkeDemo
{
public partial class FormConfigure : Form
{
public FormConfigure()
{
InitializeComponent();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
This diff is collapsed.
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace KonkeDemo
{
public partial class FormMain : Form
{
ControlChangesWithWindows LoadFormWindows = new ControlChangesWithWindows(); //随窗口改变大小类的实例化
private ConcurrentDictionary<int, UserControlmodular> ModularDictionary = new ConcurrentDictionary<int, UserControlmodular>();//双向链表
private bool[] UpdateError;
public FormMain()
{
InitializeComponent();
}
private void Form7_Load(object sender, EventArgs e)
{
//Control.CheckForIllegalCrossThreadCalls = false;
this.WindowState = FormWindowState.Maximized;
string Layout = Configure.Configure_interface.GetLayout();
System.Windows.Forms.TableLayoutPanel tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
tableLayoutPanel1.AutoScroll = true;
tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
tableLayoutPanel1.Name = "tableLayoutPanel1";
tableLayoutPanel1.Size = new System.Drawing.Size(1663, 571);
tableLayoutPanel1.TabIndex = 2;
panel2.Controls.Add(tableLayoutPanel1);
int iColumnCount = 3;
int iRowCount = 2;
iRowCount = int.Parse(Layout.Split(new string[] { "*" }, StringSplitOptions.RemoveEmptyEntries)[0]);
iColumnCount = int.Parse(Layout.Split(new string[] { "*" }, StringSplitOptions.RemoveEmptyEntries)[1]);
ThreadRun = new Thread[iRowCount * iColumnCount];
tableLayoutPanel1.ColumnCount = iColumnCount;
tableLayoutPanel1.RowCount = iRowCount;
UserControlmodular usermodular = new UserControlmodular();
float width = this.Width / iColumnCount;
if (width >= usermodular.Width)
{
for (int i = 0; i < iColumnCount; i++)
{
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
}
}
else
{
for (int i = 0; i < iColumnCount; i++)
{
tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, usermodular.Width));
}
}
for (int k = 0; k < iRowCount; k++)
{
tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, usermodular.Height));
}
int position = 0;
for (int i = 0; i < iRowCount; i++)
{
for (int j = 0; j < iColumnCount; j++)
{
usermodular = new UserControlmodular();
usermodular.BackColor = System.Drawing.Color.Aqua;
usermodular.Process = 0;
usermodular.iconclusion = 2;
usermodular.position = (++position);
usermodular.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
usermodular.Dock = System.Windows.Forms.DockStyle.Fill;
tableLayoutPanel1.Controls.Add(usermodular, j, i);
ModularDictionary.TryAdd(position, usermodular);
}
}
}
private void ucBtnExt3_BtnClick(object sender, EventArgs e)
{
Process.Start(AppDomain.CurrentDomain.BaseDirectory.ToString() + "Beacon.chm");
}
private void FormMain_Resize(object sender, EventArgs e)
{
LoadFormWindows.MethodForResize(this);
}
private void FillSN()
{
for (int i = 0; i < ModularDictionary.Count; i++)
{
if (string.IsNullOrEmpty(ModularDictionary[i + 1].SN))
{
ModularDictionary[i + 1].SN = textEdit1.Text.Trim();
textEdit1.Text = "";
break;
}
}
}
private void checkSN(out string ErrorMessage)
{
string errorlog = "";
for (int i = 0; i < ModularDictionary.Count; i++)
{
if (string.IsNullOrEmpty(ModularDictionary[i + 1].SN))
{
errorlog = string.Format("工站{0}请输入SN", i + 1);
break;
}
}
ErrorMessage = errorlog;
}
private void textEdit1_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
FillSN();
}
private void ucBtnExt2_BtnClick(object sender, EventArgs e)
{
for (int i = 0; i < ModularDictionary.Count; i++)
{
ModularDictionary[i + 1].SN = "";
}
}
private Thread[] ThreadRun;
protected bool isAllTestThreadsFinished()
{
for (int i = 0; i < ThreadRun.Length; i++)
{
if (ThreadRun[i] != null
&& (ThreadRun[i].ThreadState != System.Threading.ThreadState.Aborted
&& ThreadRun[i].ThreadState != System.Threading.ThreadState.Stopped
&& ThreadRun[i].ThreadState != System.Threading.ThreadState.Unstarted))
{
}
else
{
if (!UpdateError[i])
{
ModularDictionary[i + 1].fnUpdate();
UpdateError[i] = true;
}
}
}
foreach (Thread thread in ThreadRun)
if (thread != null
&& (thread.ThreadState != System.Threading.ThreadState.Aborted
&& thread.ThreadState != System.Threading.ThreadState.Stopped
&& thread.ThreadState != System.Threading.ThreadState.Unstarted))
return false;
return true;
}
private void ucBtnExt1_BtnClick(object sender, EventArgs e)
{
if (ucBtnExt1.BtnText == "开始")
{
string ErrorMessage = "";
checkSN(out ErrorMessage);
if (string.IsNullOrEmpty(ErrorMessage))
{
UpdateError = new bool[ModularDictionary.Count];
for (int i = 0; i < ModularDictionary.Count; i++)
{
ModularDictionary[i + 1].Init();
object obj = new object();
ThreadRun[i] = new Thread(new ParameterizedThreadStart(ModularDictionary[i + 1].Run));
ThreadRun[i].Start(obj);
}
ucBtnExt1.BtnText = "停止";
textEdit1.Enabled = false;
ucBtnExt2.Enabled = false;
ucBtnExt4.Enabled = false;
ucBtnExt3.Enabled = false;
while (!isAllTestThreadsFinished())
{
System.Threading.Thread.Sleep(100);
Application.DoEvents();
}
for (int i = 0; i < ModularDictionary.Count; i++)
{
if (!UpdateError[i])
ModularDictionary[i + 1].fnUpdate();
ModularDictionary[i + 1].Finished();
}
ucBtnExt1.BtnText = "开始";
ucBtnExt2.Enabled = true;
ucBtnExt4.Enabled = true;
ucBtnExt3.Enabled = true;
textEdit1.Enabled = true;
}
else
{
MessageBox.Show(ErrorMessage);
}
}
else if (ucBtnExt1.BtnText == "停止")
{
ucBtnExt1.BtnText = "开始";
ucBtnExt2.Enabled = true;
ucBtnExt4.Enabled = true;
ucBtnExt3.Enabled = true;
}
}
private void ucBtnExt4_BtnClick(object sender, EventArgs e)
{
FormConfigure configure = new FormConfigure();
configure.ShowDialog(this);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KonkeDemo
{
public static class Helper
{
public enum CustomMessage
{
ViewLog,
QuerySN,
Alarm,
Stop,
Result,
Progress,
}
private static bool bstop;
public static bool Stop
{
get { return bstop; }
set { bstop = value; }
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7A9E2491-A48C-4BD9-A537-E7F5A2B2D1E8}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>KonkeDemo</RootNamespace>
<AssemblyName>KonkeDemo</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="DevExpress.Data.v10.2">
<HintPath>..\..\..\workplace(管理客户端)\konkemanufactureclient\About\Libs\DevExpress\DevExpress.Data.v10.2.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Design.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=365ac3cecbd70e0e, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\workplace(管理客户端)\konkemanufactureclient\About\Libs\DevExpress\DevExpress.Design.v10.2.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Utils.v10.2">
<HintPath>..\..\..\workplace(管理客户端)\konkemanufactureclient\About\Libs\DevExpress\DevExpress.Utils.v10.2.dll</HintPath>
</Reference>
<Reference Include="DevExpress.XtraBars.v10.2">
<HintPath>..\..\..\workplace(管理客户端)\konkemanufactureclient\About\Libs\DevExpress\DevExpress.XtraBars.v10.2.dll</HintPath>
</Reference>
<Reference Include="DevExpress.XtraEditors.v10.2">
<HintPath>..\..\..\workplace(管理客户端)\konkemanufactureclient\About\Libs\DevExpress\DevExpress.XtraEditors.v10.2.dll</HintPath>
</Reference>
<Reference Include="DevExpress.XtraEditors.v10.2.Design">
<HintPath>..\..\..\workplace(管理客户端)\konkemanufactureclient\About\Libs\DevExpress\DevExpress.XtraEditors.v10.2.Design.dll</HintPath>
</Reference>
<Reference Include="DevExpress.XtraGrid.v10.2">
<HintPath>..\..\..\workplace(管理客户端)\konkemanufactureclient\About\Libs\DevExpress\DevExpress.XtraGrid.v10.2.dll</HintPath>
</Reference>
<Reference Include="DevExpress.XtraLayout.v10.2">
<HintPath>..\..\..\workplace(管理客户端)\konkemanufactureclient\About\Libs\DevExpress\DevExpress.XtraLayout.v10.2.dll</HintPath>
</Reference>
<Reference Include="DevExpress.XtraLayout.v10.2.Design">
<HintPath>..\..\..\workplace(管理客户端)\konkemanufactureclient\About\Libs\DevExpress10.2All\DevExpress.XtraLayout.v10.2.Design.dll</HintPath>
</Reference>
<Reference Include="DevExpress.XtraNavBar.v10.2">
<HintPath>..\..\..\workplace(管理客户端)\konkemanufactureclient\About\Libs\DevExpress\DevExpress.XtraNavBar.v10.2.dll</HintPath>
</Reference>
<Reference Include="DevExpress.XtraTreeList.v10.2">
<HintPath>..\..\..\workplace(管理客户端)\konkemanufactureclient\About\Libs\DevExpress\DevExpress.XtraTreeList.v10.2.dll</HintPath>
</Reference>
<Reference Include="HZH_Controls, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\HZH_Controls.1.0.14\lib\net40\HZH_Controls.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AutoTestService.cs" />
<Compile Include="ControlChangesWithWindows.cs" />
<Compile Include="Configure.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Configure.Designer.cs">
<DependentUpon>Configure.cs</DependentUpon>
</Compile>
<Compile Include="FormConfigure.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormConfigure.Designer.cs">
<DependentUpon>FormConfigure.cs</DependentUpon>
</Compile>
<Compile Include="FormMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormMain.Designer.cs">
<DependentUpon>FormMain.cs</DependentUpon>
</Compile>
<Compile Include="Helper.cs" />
<Compile Include="Load.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Load.Designer.cs">
<DependentUpon>Load.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UCNavigationMenuExt.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UCNavigationMenuExt.Designer.cs">
<DependentUpon>UCNavigationMenuExt.cs</DependentUpon>
</Compile>
<Compile Include="UCPanelTitle.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UCPanelTitle.Designer.cs">
<DependentUpon>UCPanelTitle.cs</DependentUpon>
</Compile>
<Compile Include="UCPanelTitleInfo.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UCPanelTitleInfo.Designer.cs">
<DependentUpon>UCPanelTitleInfo.cs</DependentUpon>
</Compile>
<Compile Include="UCProcessLine.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="UserControlmodular.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserControlmodular.Designer.cs">
<DependentUpon>UserControlmodular.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="FormConfigure.resx">
<DependentUpon>FormConfigure.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FormMain.resx">
<DependentUpon>FormMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<EmbeddedResource Include="UserControlmodular.resx">
<DependentUpon>UserControlmodular.cs</DependentUpon>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30320.27
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonkeDemo", "KonkeDemo.csproj", "{7A9E2491-A48C-4BD9-A537-E7F5A2B2D1E8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7A9E2491-A48C-4BD9-A537-E7F5A2B2D1E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A9E2491-A48C-4BD9-A537-E7F5A2B2D1E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A9E2491-A48C-4BD9-A537-E7F5A2B2D1E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A9E2491-A48C-4BD9-A537-E7F5A2B2D1E8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C0CC0C9A-0878-4D3C-8B6B-5A952C19C0B4}
EndGlobalSection
EndGlobal
namespace KonkeDemo
{
partial class LoadForm
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoadForm));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.PassnameText = new System.Windows.Forms.TextBox();
this.PasswordText = new System.Windows.Forms.TextBox();
this.LoadButton = new System.Windows.Forms.Button();
this.LoadErrorText = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.SignOut = new System.Windows.Forms.Button();
this.LoadTextShow = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(455, 86);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(52, 15);
this.label1.TabIndex = 0;
this.label1.Text = "账号:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(455, 154);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(52, 15);
this.label2.TabIndex = 1;
this.label2.Text = "密码:";
//
// PassnameText
//
this.PassnameText.BackColor = System.Drawing.Color.Lavender;
this.PassnameText.Location = new System.Drawing.Point(547, 82);
this.PassnameText.Margin = new System.Windows.Forms.Padding(4);
this.PassnameText.Name = "PassnameText";
this.PassnameText.Size = new System.Drawing.Size(191, 25);
this.PassnameText.TabIndex = 2;
this.PassnameText.Text = "surukun";
this.PassnameText.KeyUp += new System.Windows.Forms.KeyEventHandler(this.PassNameEnter);
//
// PasswordText
//
this.PasswordText.BackColor = System.Drawing.Color.Lavender;
this.PasswordText.Location = new System.Drawing.Point(547, 142);
this.PasswordText.Margin = new System.Windows.Forms.Padding(4);
this.PasswordText.Name = "PasswordText";
this.PasswordText.PasswordChar = '*';
this.PasswordText.Size = new System.Drawing.Size(191, 25);
this.PasswordText.TabIndex = 3;
this.PasswordText.Text = "123456";
this.PasswordText.KeyUp += new System.Windows.Forms.KeyEventHandler(this.PassWordEnter);
//
// LoadButton
//
this.LoadButton.Location = new System.Drawing.Point(457, 290);
this.LoadButton.Margin = new System.Windows.Forms.Padding(4);
this.LoadButton.Name = "LoadButton";
this.LoadButton.Size = new System.Drawing.Size(99, 39);
this.LoadButton.TabIndex = 6;
this.LoadButton.Text = "登陆";
this.LoadButton.UseVisualStyleBackColor = true;
this.LoadButton.Click += new System.EventHandler(this.LoadButton_Click);
//
// LoadErrorText
//
this.LoadErrorText.AutoSize = true;
this.LoadErrorText.ForeColor = System.Drawing.Color.Red;
this.LoadErrorText.Location = new System.Drawing.Point(455, 244);
this.LoadErrorText.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.LoadErrorText.Name = "LoadErrorText";
this.LoadErrorText.Size = new System.Drawing.Size(157, 15);
this.LoadErrorText.TabIndex = 7;
this.LoadErrorText.Text = "账号不存在或密码错误";
this.LoadErrorText.Visible = false;
//
// pictureBox1
//
//this.pictureBox1.Image = global::WindowsFormsApp7.Properties.Resources.KongKe;
this.pictureBox1.Location = new System.Drawing.Point(72, 71);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(4);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(257, 258);
this.pictureBox1.TabIndex = 8;
this.pictureBox1.TabStop = false;
//
// SignOut
//
this.SignOut.Location = new System.Drawing.Point(640, 290);
this.SignOut.Margin = new System.Windows.Forms.Padding(4);
this.SignOut.Name = "SignOut";
this.SignOut.Size = new System.Drawing.Size(99, 39);
this.SignOut.TabIndex = 9;
this.SignOut.Text = "退出";
this.SignOut.UseVisualStyleBackColor = true;
this.SignOut.Click += new System.EventHandler(this.SignOut_Click);
//
// LoadTextShow
//
this.LoadTextShow.AutoSize = true;
this.LoadTextShow.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
this.LoadTextShow.Location = new System.Drawing.Point(544, 190);
this.LoadTextShow.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.LoadTextShow.Name = "LoadTextShow";
this.LoadTextShow.Size = new System.Drawing.Size(160, 15);
this.LoadTextShow.TabIndex = 10;
this.LoadTextShow.Text = "登陆中,请等待......";
this.LoadTextShow.Visible = false;
//
// LoadForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Lavender;
this.ClientSize = new System.Drawing.Size(801, 431);
this.Controls.Add(this.LoadTextShow);
this.Controls.Add(this.SignOut);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.LoadErrorText);
this.Controls.Add(this.LoadButton);
this.Controls.Add(this.PasswordText);
this.Controls.Add(this.PassnameText);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
//this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "LoadForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "登陆 Ver2.2.6";
this.Load += new System.EventHandler(this.LoadForm_Load);
this.Resize += new System.EventHandler(this.LoadForm_Resize);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox PassnameText;
private System.Windows.Forms.TextBox PasswordText;
private System.Windows.Forms.Button LoadButton;
private System.Windows.Forms.Label LoadErrorText;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button SignOut;
private System.Windows.Forms.Label LoadTextShow;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace KonkeDemo
{
public partial class LoadForm : Form //登陆界面
{
public static LoadForm Load_interface = null; //用于将账号类型传给子窗口
public LoadForm()
{
InitializeComponent();
Load_interface = this; //用于将账号类型传给子窗口
}
//窗口最大化控件变化 - start
ControlChangesWithWindows LoadFormWindows = new ControlChangesWithWindows(); //随窗口改变大小类的实例化
private int RootType = 0;
private string RootName = "Unknow";
private string RootPW = "";
private string RootDepartment = "";
private void LoadXmlFile(string URL, string FileName)
{
try
{
}
catch
{
}
}
private void LoadConfigsFile()
{
}
//将控件的宽,高,左边距,顶边距和字体大小暂存到tag属性中
private void LoadForm_Load(object sender, EventArgs e)
{
LoadFormWindows.MethodForLoad(this);//调用方法
}
//根据窗体大小调整控件大小
private void LoadForm_Resize(object sender, EventArgs e)
{
try
{
int Width = this.Width;
int Height = this.Height;
if (Width >= 617 && Height >= 384)
{
this.AutoScroll = false;
LoadFormWindows.MethodForResize(this);//随窗体改变控件大小
}
else
this.AutoScroll = true;
}
catch (Exception ex)
{
MessageBox.Show("窗体大小改变-操作失败:" + ex.ToString());
}
}
//登陆操作 - start
[DllImport(".\\barcodex.ocx")]
public static extern int DllRegisterServer();//用于注册barcodex.OCX文件,用于生成条形码的控件
public int GetTempType() //用于将账号类型传给子窗口
{
return RootType;
}
public string GetRootName() //用于将账号名称传给子窗口
{
return RootName;
}
public string GetRootPW() //用于将账号密码传给子窗口
{
return RootPW;
}
public string GetRootDepartment() //用于将工厂信息传给子窗口
{
return RootDepartment;
}
//登陆按钮,检查账号密码是否正确,是否选择设备类型
private void LoadButton_Click(object sender, EventArgs e)
{
try
{
LoadTextShow.Visible = true; //登录提示
LoadErrorText.Visible = false; //隐藏错误提示框
RootName = PassnameText.Text;
Dictionary<string, object> dicPara = new Dictionary<string, object>
{
{ "item", "loginAccount" },
{ "value", PassnameText.Text.Trim() }
};
if (PassnameText.Text.Trim() == "surukun"
&& PasswordText.Text.Trim() == "123456")
{
this.Hide();
Configure ConfigureWindows = new Configure();
if (ConfigureWindows.ShowDialog() == DialogResult.OK) //以对话框形式显示配置界面
{
//this.Show(); //显示主界面
}
}
LoadTextShow.Visible = false;
LoadErrorText.Visible = true;//显示错误提示框
}
catch (Exception ex)
{
LoadErrorText.Text = "登录异常";
LoadTextShow.Visible = false;
LoadErrorText.Visible = true;//显示错误提示框
MessageBox.Show("登录异常:请检查网络后重试");
}
}
private bool CheckClientKey(string userName, string password)
{
return true;
}
private void PassNameEnter(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
PasswordText.Focus(); //将焦点设置到密码输入框
}
private void PassWordEnter(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
this.LoadButton_Click(sender, e); //点击名为LoadButton按键,即登陆
}
private void SignOut_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace KonkeDemo
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new LoadForm());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("KonkeDemo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("KonkeDemo")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("7a9e2491-a48c-4bd9-a537-e7f5a2b2d1e8")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace KonkeDemo.Properties
{
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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()
{
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("KonkeDemo.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 覆盖当前线程的 CurrentUICulture 属性
/// 使用此强类型的资源类的资源查找。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace KonkeDemo.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.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;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
namespace KonkeDemo
{
partial class UCNavigationMenuExt
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// UCNavigationMenuExt
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Name = "UCNavigationMenuExt";
this.Leave += new System.EventHandler(this.UCNavigationMenuExt_Leave);
this.ResumeLayout(false);
}
#endregion
}
}
This diff is collapsed.
namespace KonkeDemo
{
partial class UCPanelTitle
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.lblTitle = new System.Windows.Forms.Label();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lblTitle
//
this.lblTitle.BackColor = System.Drawing.Color.IndianRed;
this.lblTitle.Dock = System.Windows.Forms.DockStyle.Top;
this.lblTitle.ForeColor = System.Drawing.Color.Black;
this.lblTitle.Location = new System.Drawing.Point(0, 0);
this.lblTitle.Name = "lblTitle";
this.lblTitle.Size = new System.Drawing.Size(432, 34);
this.lblTitle.TabIndex = 0;
this.lblTitle.Text = "错误信息";
this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// richTextBox1
//
this.richTextBox1.ForeColor = System.Drawing.Color.Red;
this.richTextBox1.Location = new System.Drawing.Point(0, 34);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(432, 220);
this.richTextBox1.TabIndex = 1;
this.richTextBox1.Text = "";
//
// button1
//
this.button1.Location = new System.Drawing.Point(169, 260);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 26);
this.button1.TabIndex = 2;
this.button1.Text = "复制";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// UCPanelTitle
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.Transparent;
this.ConerRadius = 10;
this.Controls.Add(this.button1);
this.Controls.Add(this.richTextBox1);
this.Controls.Add(this.lblTitle);
this.FillColor = System.Drawing.Color.White;
this.IsRadius = true;
this.IsShowRect = true;
this.Name = "UCPanelTitle";
this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(160)))), ((int)(((byte)(133)))));
this.Size = new System.Drawing.Size(432, 298);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label lblTitle;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Button button1;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using HZH_Controls.Controls;
namespace KonkeDemo
{
public partial class UCPanelTitle : UCControlBase
{
[Description("边框颜色"), Category("自定义")]
public Color BorderColor
{
get { return this.RectColor; }
set
{
this.RectColor = value;
this.lblTitle.BackColor = value;
}
}
[Description("面板标题"), Category("自定义")]
public string Title
{
get { return lblTitle.Text; }
set { lblTitle.Text = value; }
}
public string Msg
{
get { return richTextBox1.Text.Trim(); }
set { richTextBox1.AppendText(value + "\r\n"); }
}
public UCPanelTitle()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Clipboard.SetText(richTextBox1.Text);
}
public void Clear()
{
if (richTextBox1.IsHandleCreated)
{
richTextBox1.Invoke(new EventHandler(delegate
{
richTextBox1.Clear();
richTextBox1.Refresh();
}));
}
else
{
richTextBox1.Clear();
richTextBox1.Refresh();
}
}
}
}
namespace KonkeDemo
{
partial class UCPanelTitleInfo
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.lblTitle = new System.Windows.Forms.Label();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lblTitle
//
this.lblTitle.BackColor = System.Drawing.Color.SpringGreen;
this.lblTitle.Dock = System.Windows.Forms.DockStyle.Top;
this.lblTitle.ForeColor = System.Drawing.Color.Black;
this.lblTitle.Location = new System.Drawing.Point(0, 0);
this.lblTitle.Name = "lblTitle";
this.lblTitle.Size = new System.Drawing.Size(432, 34);
this.lblTitle.TabIndex = 0;
this.lblTitle.Text = "基本信息";
this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// richTextBox1
//
this.richTextBox1.Location = new System.Drawing.Point(0, 34);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(429, 232);
this.richTextBox1.TabIndex = 1;
this.richTextBox1.Text = "";
//
// button1
//
this.button1.Location = new System.Drawing.Point(171, 272);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 26);
this.button1.TabIndex = 3;
this.button1.Text = "复制";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// UCPanelTitleInfo
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.Transparent;
this.ConerRadius = 10;
this.Controls.Add(this.button1);
this.Controls.Add(this.richTextBox1);
this.Controls.Add(this.lblTitle);
this.FillColor = System.Drawing.Color.White;
this.IsRadius = true;
this.IsShowRect = true;
this.Name = "UCPanelTitleInfo";
this.RectColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(160)))), ((int)(((byte)(133)))));
this.Size = new System.Drawing.Size(432, 301);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label lblTitle;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Button button1;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using HZH_Controls.Controls;
namespace KonkeDemo
{
public partial class UCPanelTitleInfo : UCControlBase
{
[Description("边框颜色"), Category("自定义")]
public Color BorderColor
{
get { return this.RectColor; }
set
{
this.RectColor = value;
this.lblTitle.BackColor = value;
}
}
[Description("面板标题"), Category("自定义")]
public string Title
{
get { return lblTitle.Text; }
set { lblTitle.Text = value; }
}
public string Msg
{
get { return richTextBox1.Text.Trim(); }
set { richTextBox1.AppendText(value + "\r\n"); }
}
public UCPanelTitleInfo()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Clipboard.SetText(richTextBox1.Text);
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using HZH_Controls;
using System.Drawing.Drawing2D;
namespace KonkeDemo
{
public class UCProcessLine : Control
{
[Description("值变更事件"), Category("自定义")]
public event EventHandler ValueChanged;
int m_value = 0;
[Description("当前属性"), Category("自定义")]
public int Value
{
set
{
if (value > m_maxValue)
m_value = m_maxValue;
else if (value < 0)
m_value = 0;
else
m_value = value;
if (ValueChanged != null)
ValueChanged(this, null);
Refresh();
}
get
{
return m_value;
}
}
private int m_maxValue = 100;
[Description("最大值"), Category("自定义")]
public int MaxValue
{
get { return m_maxValue; }
set
{
if (value < m_value)
m_maxValue = m_value;
else
m_maxValue = value;
Refresh();
}
}
Color m_valueColor = Color.FromArgb(73, 119, 232);
[Description("值进度条颜色"), Category("自定义")]
public Color ValueColor
{
get { return m_valueColor; }
set
{
m_valueColor = value;
Refresh();
}
}
private Color m_valueBGColor = Color.White;
[Description("值背景色"), Category("自定义")]
public Color ValueBGColor
{
get { return m_valueBGColor; }
set
{
m_valueBGColor = value;
Refresh();
}
}
private Color m_borderColor = Color.FromArgb(192, 192, 192);
[Description("边框颜色"), Category("自定义")]
public Color BorderColor
{
get { return m_borderColor; }
set
{
m_borderColor = value;
Refresh();
}
}
[Description("值字体"), Category("自定义")]
public override Font Font
{
get
{
return base.Font;
}
set
{
base.Font = value;
Refresh();
}
}
[Description("值字体颜色"), Category("自定义")]
public override System.Drawing.Color ForeColor
{
get
{
return base.ForeColor;
}
set
{
base.ForeColor = value;
Refresh();
}
}
private ValueTextType m_valueTextType = ValueTextType.Percent;
[Description("值显示样式"), Category("自定义")]
public ValueTextType ValueTextType
{
get { return m_valueTextType; }
set
{
m_valueTextType = value;
Refresh();
}
}
public UCProcessLine()
{
Size = new Size(200, 15);
ForeColor = Color.FromArgb(255, 77, 59);
Font = new Font("Arial Unicode MS", 10);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.ResizeRedraw, true);
this.SetStyle(ControlStyles.Selectable, true);
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.SetStyle(ControlStyles.UserPaint, true);
}
protected override void OnPaint(PaintEventArgs e)
{
Console.WriteLine(DateTime.Now);
base.OnPaint(e);
Graphics g = e.Graphics;
g.SetGDIHigh();
Brush sb = new SolidBrush(m_valueBGColor);
g.FillRectangle(sb, new Rectangle(base.ClientRectangle.X, base.ClientRectangle.Y, base.ClientRectangle.Width - 3, base.ClientRectangle.Height - 2));
GraphicsPath path1 = ControlHelper.CreateRoundedRectanglePath(new Rectangle(base.ClientRectangle.X, base.ClientRectangle.Y + 1, base.ClientRectangle.Width - 3, base.ClientRectangle.Height - 4), 3);
g.DrawPath(new Pen(m_borderColor, 1), path1);
LinearGradientBrush lgb = new LinearGradientBrush(new Point(0, 0), new Point(0, base.ClientRectangle.Height - 3), m_valueColor, Color.FromArgb(200, m_valueColor.R, m_valueColor.G, m_valueColor.B));
g.FillPath(lgb, ControlHelper.CreateRoundedRectanglePath(new Rectangle(0, (base.ClientRectangle.Height - (base.ClientRectangle.Height - 3)) / 2, (base.ClientRectangle.Width - 3) * Value / m_maxValue, base.ClientRectangle.Height - 4), 3));
string strValue = string.Empty;
if (m_valueTextType == ValueTextType.Percent)//m_valueTextType == HZH_Controls.Controls.ValueTextType.Percent
strValue = ((float)Value / (float)m_maxValue).ToString("0%");
else if (m_valueTextType == ValueTextType.Absolute)//m_valueTextType == HZH_Controls.Controls.ValueTextType.Absolute
strValue = Value + "/" + m_maxValue;
if (!string.IsNullOrEmpty(strValue))
{
System.Drawing.SizeF sizeF = g.MeasureString(strValue, Font);
g.DrawString(strValue, Font, new SolidBrush(ForeColor), new PointF((this.Width - sizeF.Width) / 2, (this.Height - sizeF.Height) / 2 + 1));
}
}
public static implicit operator UCProcessLine(HZH_Controls.Controls.UCProcessLine v)
{
throw new NotImplementedException();
}
}
public enum ValueTextType
{
None,
/// <summary>
/// 百分比
/// </summary>
Percent,
/// <summary>
/// 数值
/// </summary>
Absolute
}
}
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace KonkeDemo
{
public partial class UserControlmodular : UserControl
{
private UCPanelTitleInfo textinfo = new UCPanelTitleInfo();
private UCPanelTitle texttitle = new UCPanelTitle();
public UserControlmodular()
{
InitializeComponent();
textinfo.Msg = "deviceid: 010203";
textinfo.Msg = "RSSI: -90";
textinfo.Msg = "SoftVersion: 1.0";
textinfo.Msg = "HardVersion: 2.0";
textinfo.Msg = "Installcode: 290001";
textinfo.Msg = "MAC: 123456789";
ucNavigationMenuExt1.Items[0].ShowControl = textinfo;
//ucNavigationMenuExt1.Items[1].TipText = "2";
//ucNavigationMenuExt1.Items[1].ShowTip = true;
//texttitle.Msg = DateTime.Now.ToString("yyyy-mm-dd HH:mm:ss") + ": " + "入网失败";
//text.Text = "读取信号强度失败";
ucNavigationMenuExt1.Items[1].ShowControl = texttitle;
}
public string TipText
{
set
{
ucNavigationMenuExt1.Invoke(new EventHandler(delegate
{
ucNavigationMenuExt1.Items[1].ShowTip = true;
ucNavigationMenuExt1.Items[1].TipText = value;
this.Refresh();
}));
}
}
public string Infomsg
{
set
{
textinfo.Msg = value;
}
}
public string Errormsg
{
set
{
texttitle.Msg = DateTime.Now.ToString("yyyy-mm-dd HH:mm:ss") + ": " + value.ToString();
this.Refresh();
}
}
public string SN
{
get
{
return textEdit1.Text.Trim();
}
set
{
textEdit1.Text = value;
}
}
public int Process
{
set
{
ucProcessLine1.Value = value;
}
}
public int iconclusion
{
set
{
if (value == 1)
{
label2.Text = "测试成功";
panel3.BackColor = Color.SpringGreen;
}
else if (value == 0)
{
label2.Text = "测试失败";
panel3.BackColor = Color.Red;
}
else if (value == 2)
{
label2.Text = "准备";
panel3.BackColor = Color.Gold;
}
}
}
public int position
{
set
{
label3.Text = value.ToString();
}
}
public int ControlWidth
{
get
{
return this.Width;
}
}
public string status
{
set
{
label2.Text = value.ToString();
}
}
private int errorcnt;
public int ErrorCnt
{
get { return errorcnt; }
set { errorcnt = value; }
}
private List<string> TErrorlog = new List<string>();
public virtual void ViewLog(Helper.CustomMessage customMessage, string message)
{
try
{
switch (customMessage)
{
case Helper.CustomMessage.ViewLog:
label2.Invoke(new EventHandler(delegate
{
label2.Text = message;
}));
break;
case Helper.CustomMessage.Alarm:
//texttitle = new UCPanelTitle();
ErrorCnt++;
TErrorlog.Add(message);
//TipText = ErrorCnt.ToString();
//Errormsg = message;
break;
case Helper.CustomMessage.QuerySN:
break;
case Helper.CustomMessage.Stop:
break;
case Helper.CustomMessage.Progress:
int process = 0;
if (int.TryParse(message, out process))
{
ucProcessLine1.Invoke(new EventHandler(delegate
{
ucProcessLine1.Value = process;
}));
}
break;
case Helper.CustomMessage.Result:
if (message.Equals("0"))
{
panel3.Invoke(new EventHandler(delegate
{
panel3.BackColor = Color.Red;
panel3.Refresh();
}));
}
else if (message.Equals("1"))
{
panel3.Invoke(new EventHandler(delegate
{
panel3.BackColor = Color.SpringGreen;
panel3.Refresh();
}));
}
break;
}
}
catch(Exception exc) { }
}
public void fnUpdate()
{
if (ErrorCnt > 0)
{
TipText = ErrorCnt.ToString();
for (int i = 0; i < TErrorlog.Count; i++)
{
Errormsg = TErrorlog[i];
}
}
}
public void Finished()
{
textEdit1.Invoke(new EventHandler(delegate
{
textEdit1.Enabled = true;
}));
}
public void Init()
{
ErrorCnt = 0;
TErrorlog = new List<string>();
ucNavigationMenuExt1.Invoke(new EventHandler(delegate
{
ucNavigationMenuExt1.Items[1].ShowTip = false;
this.Refresh();
}));
this.BackColor = System.Drawing.Color.Aqua;
Process = 0;
iconclusion = 2;
texttitle.Clear();
textEdit1.Invoke(new EventHandler(delegate
{
textEdit1.Enabled = false;
}));
}
public void Run(object obj)
{
bTest = true;
topSeconds = 0;
AutoTestService autoTest = new AutoTestService();
autoTest.SendMessage += ViewLog;
autoTest.Run(new object());
autoTest.SendMessage -= ViewLog;
bTest = false;
topSeconds = 0;
}
private bool bTest = false;
private int topSeconds = 0;
private void timer1_Tick(object sender, EventArgs e)
{
try
{
if (bTest)
{
topSeconds++;
label1.Invoke(new EventHandler(delegate
{
label1.Text = string.Format("耗时: {0} S", topSeconds);
}));
}
}
catch { }
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
\ No newline at end of file
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
E:\test\ModuleTest\KonkeDemo\obj\Debug\KonkeDemo.Properties.Resources.resources
E:\test\ModuleTest\KonkeDemo\obj\Debug\KonkeDemo.csproj.GenerateResource.cache
E:\test\ModuleTest\KonkeDemo\obj\Debug\KonkeDemo.csproj.CoreCompileInputs.cache
E:\test\ModuleTest\KonkeDemo\obj\Debug\KonkeDemo.UserControlmodular.resources
E:\test\ModuleTest\KonkeDemo\bin\Debug\KonkeDemo.exe.config
E:\test\ModuleTest\KonkeDemo\bin\Debug\KonkeDemo.exe
E:\test\ModuleTest\KonkeDemo\bin\Debug\KonkeDemo.pdb
E:\test\ModuleTest\KonkeDemo\bin\Debug\DevExpress.Data.v10.2.dll
E:\test\ModuleTest\KonkeDemo\bin\Debug\DevExpress.Utils.v10.2.dll
E:\test\ModuleTest\KonkeDemo\bin\Debug\DevExpress.XtraEditors.v10.2.Design.dll
E:\test\ModuleTest\KonkeDemo\bin\Debug\DevExpress.XtraEditors.v10.2.dll
E:\test\ModuleTest\KonkeDemo\bin\Debug\HZH_Controls.dll
E:\test\ModuleTest\KonkeDemo\bin\Debug\DevExpress.Design.v10.2.dll
E:\test\ModuleTest\KonkeDemo\obj\Debug\KonkeDemo.csproj.CopyComplete
E:\test\ModuleTest\KonkeDemo\obj\Debug\KonkeDemo.exe
E:\test\ModuleTest\KonkeDemo\obj\Debug\KonkeDemo.pdb
E:\test\ModuleTest\KonkeDemo\obj\Debug\KonkeDemo.FormMain.resources
E:\test\ModuleTest\KonkeDemo\bin\Debug\DevExpress.XtraBars.v10.2.dll
E:\test\ModuleTest\KonkeDemo\bin\Debug\DevExpress.XtraGrid.v10.2.dll
E:\test\ModuleTest\KonkeDemo\bin\Debug\DevExpress.XtraLayout.v10.2.Design.dll
E:\test\ModuleTest\KonkeDemo\bin\Debug\DevExpress.XtraLayout.v10.2.dll
E:\test\ModuleTest\KonkeDemo\bin\Debug\DevExpress.XtraNavBar.v10.2.dll
E:\test\ModuleTest\KonkeDemo\bin\Debug\DevExpress.XtraTreeList.v10.2.dll
E:\test\ModuleTest\KonkeDemo\obj\Debug\KonkeDemo.FormConfigure.resources
E:\test\ModuleTest\KonkeDemo\obj\Debug\KonkeDemo.csprojAssemblyReference.cache
E:\UIDemo\KonkeDemo\bin\Debug\KonkeDemo.exe.config
E:\UIDemo\KonkeDemo\bin\Debug\KonkeDemo.exe
E:\UIDemo\KonkeDemo\bin\Debug\KonkeDemo.pdb
E:\UIDemo\KonkeDemo\bin\Debug\DevExpress.Data.v10.2.dll
E:\UIDemo\KonkeDemo\bin\Debug\DevExpress.Design.v10.2.dll
E:\UIDemo\KonkeDemo\bin\Debug\DevExpress.Utils.v10.2.dll
E:\UIDemo\KonkeDemo\bin\Debug\DevExpress.XtraBars.v10.2.dll
E:\UIDemo\KonkeDemo\bin\Debug\DevExpress.XtraEditors.v10.2.Design.dll
E:\UIDemo\KonkeDemo\bin\Debug\DevExpress.XtraEditors.v10.2.dll
E:\UIDemo\KonkeDemo\bin\Debug\DevExpress.XtraGrid.v10.2.dll
E:\UIDemo\KonkeDemo\bin\Debug\DevExpress.XtraLayout.v10.2.Design.dll
E:\UIDemo\KonkeDemo\bin\Debug\DevExpress.XtraLayout.v10.2.dll
E:\UIDemo\KonkeDemo\bin\Debug\DevExpress.XtraNavBar.v10.2.dll
E:\UIDemo\KonkeDemo\bin\Debug\DevExpress.XtraTreeList.v10.2.dll
E:\UIDemo\KonkeDemo\obj\Debug\KonkeDemo.csprojAssemblyReference.cache
E:\UIDemo\KonkeDemo\obj\Debug\KonkeDemo.FormConfigure.resources
E:\UIDemo\KonkeDemo\obj\Debug\KonkeDemo.FormMain.resources
E:\UIDemo\KonkeDemo\obj\Debug\KonkeDemo.Properties.Resources.resources
E:\UIDemo\KonkeDemo\obj\Debug\KonkeDemo.UserControlmodular.resources
E:\UIDemo\KonkeDemo\obj\Debug\KonkeDemo.csproj.GenerateResource.cache
E:\UIDemo\KonkeDemo\obj\Debug\KonkeDemo.csproj.CoreCompileInputs.cache
E:\UIDemo\KonkeDemo\obj\Debug\KonkeDemo.csproj.CopyComplete
E:\UIDemo\KonkeDemo\obj\Debug\KonkeDemo.exe
E:\UIDemo\KonkeDemo\obj\Debug\KonkeDemo.pdb
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="HZH_Controls" version="1.0.14" targetFramework="net472" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net472" />
</packages>
\ No newline at end of file
This Microsoft .NET Library may incorporate components from the projects listed
below. Microsoft licenses these components under the Microsoft .NET Library
software license terms. The original copyright notices and the licenses under
which Microsoft received such components are set forth below for informational
purposes only. Microsoft reserves all rights not expressly granted herein,
whether by implication, estoppel or otherwise.
1. .NET Core (https://github.com/dotnet/core/)
.NET Core
Copyright (c) .NET Foundation and Contributors
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
\ No newline at end of file
MICROSOFT SOFTWARE LICENSE TERMS
MICROSOFT .NET LIBRARY
These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft
· updates,
· supplements,
· Internet-based services, and
· support services
for this software, unless other terms accompany those items. If so, those terms apply.
BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.
IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE PERPETUAL RIGHTS BELOW.
1. INSTALLATION AND USE RIGHTS.
a. Installation and Use. You may install and use any number of copies of the software to design, develop and test your programs.
b. Third Party Programs. The software may include third party programs that Microsoft, not the third party, licenses to you under this agreement. Notices, if any, for the third party program are included for your information only.
2. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
a. DISTRIBUTABLE CODE. The software is comprised of Distributable Code. “Distributable Code” is code that you are permitted to distribute in programs you develop if you comply with the terms below.
i. Right to Use and Distribute.
· You may copy and distribute the object code form of the software.
· Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.
ii. Distribution Requirements. For any Distributable Code you distribute, you must
· add significant primary functionality to it in your programs;
· require distributors and external end users to agree to terms that protect it at least as much as this agreement;
· display your valid copyright notice on your programs; and
· indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your programs.
iii. Distribution Restrictions. You may not
· alter any copyright, trademark or patent notice in the Distributable Code;
· use Microsoft’s trademarks in your programs’ names or in a way that suggests your programs come from or are endorsed by Microsoft;
· include Distributable Code in malicious, deceptive or unlawful programs; or
· modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that
· the code be disclosed or distributed in source code form; or
· others have the right to modify it.
3. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not
· work around any technical limitations in the software;
· reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;
· publish the software for others to copy;
· rent, lease or lend the software;
· transfer the software or this agreement to any third party; or
· use the software for commercial software hosting services.
4. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall the software.
5. DOCUMENTATION. Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.
6. EXPORT RESTRICTIONS. The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see www.microsoft.com/exporting.
7. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it.
8. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.
9. APPLICABLE LAW.
a. United States. If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.
b. Outside the United States. If you acquired the software in any other country, the laws of that country apply.
10. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.
11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS OR STATUTORY GUARANTEES UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
FOR AUSTRALIA – YOU HAVE STATUTORY GUARANTEES UNDER THE AUSTRALIAN CONSUMER LAW AND NOTHING IN THESE TERMS IS INTENDED TO AFFECT THOSE RIGHTS.
12. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
This limitation applies to
· anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and
· claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.
It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.
Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.
Remarque : Ce logiciel étant distribué au Québec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français.
EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.
LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
Cette limitation concerne :
· tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et
· les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur.
Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Si votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard.
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment