瀏覽代碼

添加窗体将资源文件C++窗体升级到C#

sunyi 5 年之前
父節點
當前提交
dfcc884f59

+ 225 - 0
OTS/OTSModelSharp/Measure/GetStageInfo/DlgLicenseInfo.Designer.cs

@@ -0,0 +1,225 @@
+namespace OTSModelSharp.Measure.GetStageInfo
+{
+    partial class DlgLicenseInfo
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.textBox2 = new System.Windows.Forms.TextBox();
+            this.comboBox1 = new System.Windows.Forms.ComboBox();
+            this.comboBox2 = new System.Windows.Forms.ComboBox();
+            this.m_dateTime = new System.Windows.Forms.DateTimePicker();
+            this.textBox3 = new System.Windows.Forms.TextBox();
+            this.button1 = new System.Windows.Forms.Button();
+            this.button2 = new System.Windows.Forms.Button();
+            this.button3 = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(63, 21);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(53, 12);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "计算机名";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(39, 61);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(77, 12);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "计算机硬件ID";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(63, 101);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(53, 12);
+            this.label3.TabIndex = 2;
+            this.label3.Text = "软件包ID";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(51, 146);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(65, 12);
+            this.label4.TabIndex = 3;
+            this.label4.Text = "通行证种类";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(75, 189);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(41, 12);
+            this.label5.TabIndex = 4;
+            this.label5.Text = "有效期";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(39, 239);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(77, 12);
+            this.label6.TabIndex = 5;
+            this.label6.Text = "通行证代码串";
+            // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(149, 12);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(296, 21);
+            this.textBox1.TabIndex = 6;
+            this.textBox1.TextChanged += new System.EventHandler(this.OnEnChangeEditNickname);
+            // 
+            // textBox2
+            // 
+            this.textBox2.Location = new System.Drawing.Point(149, 52);
+            this.textBox2.Name = "textBox2";
+            this.textBox2.Size = new System.Drawing.Size(296, 21);
+            this.textBox2.TabIndex = 7;
+            this.textBox2.TextChanged += new System.EventHandler(this.OnEnChangeEditMacheineid);
+            // 
+            // comboBox1
+            // 
+            this.comboBox1.FormattingEnabled = true;
+            this.comboBox1.Location = new System.Drawing.Point(149, 93);
+            this.comboBox1.Name = "comboBox1";
+            this.comboBox1.Size = new System.Drawing.Size(296, 20);
+            this.comboBox1.TabIndex = 8;
+            this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.OnCbnSelchangeComboPackid);
+            // 
+            // comboBox2
+            // 
+            this.comboBox2.FormattingEnabled = true;
+            this.comboBox2.Location = new System.Drawing.Point(149, 138);
+            this.comboBox2.Name = "comboBox2";
+            this.comboBox2.Size = new System.Drawing.Size(296, 20);
+            this.comboBox2.TabIndex = 9;
+            this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.OnCbnSelchangeComboLicensetype);
+            // 
+            // m_dateTime
+            // 
+            this.m_dateTime.Location = new System.Drawing.Point(149, 180);
+            this.m_dateTime.Name = "m_dateTime";
+            this.m_dateTime.Size = new System.Drawing.Size(296, 21);
+            this.m_dateTime.TabIndex = 10;
+            this.m_dateTime.ValueChanged += new System.EventHandler(this.OnDtnDatetimechangeDatetimeExpiredate);
+            // 
+            // textBox3
+            // 
+            this.textBox3.Location = new System.Drawing.Point(149, 230);
+            this.textBox3.Name = "textBox3";
+            this.textBox3.Size = new System.Drawing.Size(296, 21);
+            this.textBox3.TabIndex = 11;
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(149, 272);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(75, 23);
+            this.button1.TabIndex = 12;
+            this.button1.Text = "加载";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.OnBnClickedButtonLoad);
+            // 
+            // button2
+            // 
+            this.button2.Location = new System.Drawing.Point(260, 272);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(75, 23);
+            this.button2.TabIndex = 13;
+            this.button2.Text = "保存";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Click += new System.EventHandler(this.OnBnClickedOk);
+            // 
+            // button3
+            // 
+            this.button3.Location = new System.Drawing.Point(370, 272);
+            this.button3.Name = "button3";
+            this.button3.Size = new System.Drawing.Size(75, 23);
+            this.button3.TabIndex = 14;
+            this.button3.Text = "放弃";
+            this.button3.UseVisualStyleBackColor = true;
+            // 
+            // DlgLicenseInfo
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(463, 310);
+            this.Controls.Add(this.button3);
+            this.Controls.Add(this.button2);
+            this.Controls.Add(this.button1);
+            this.Controls.Add(this.textBox3);
+            this.Controls.Add(this.m_dateTime);
+            this.Controls.Add(this.comboBox2);
+            this.Controls.Add(this.comboBox1);
+            this.Controls.Add(this.textBox2);
+            this.Controls.Add(this.textBox1);
+            this.Controls.Add(this.label6);
+            this.Controls.Add(this.label5);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Name = "DlgLicenseInfo";
+            this.Text = "通行证信息";
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.TextBox textBox2;
+        private System.Windows.Forms.ComboBox comboBox1;
+        private System.Windows.Forms.ComboBox comboBox2;
+        private System.Windows.Forms.DateTimePicker m_dateTime;
+        private System.Windows.Forms.TextBox textBox3;
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.Button button2;
+        private System.Windows.Forms.Button button3;
+    }
+}

+ 258 - 0
OTS/OTSModelSharp/Measure/GetStageInfo/DlgLicenseInfo.cs

@@ -0,0 +1,258 @@
+using OTSDataType;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Management.Instrumentation;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using static OTSDataType.COTSLicenseInfo;
+using static OTSDataType.otsdataconst;
+
+namespace OTSModelSharp.Measure.GetStageInfo
+{
+    public partial class DlgLicenseInfo : Form
+    {
+
+        Button m_ctrlButtonSave;
+
+        String m_strEditLicenseKey;
+
+        String m_strEditComputerNickName;
+
+        String m_strEditMachineId;
+
+        int m_nComboSoftPackId;
+        
+        int m_nCombeLicenseType;
+
+        bool m_bRequest;
+
+        DateTime m_oExpireData;
+
+        COTSLicenseInfo m_pLicenseInfo;
+        public DlgLicenseInfo()
+        {
+            InitializeComponent();
+        }
+
+        private void OnEnChangeEditNickname(object sender, EventArgs e)
+        {
+            UpdateControlStatus(false);
+
+            UpdateLicenseKeyStr(false);
+        }
+
+        private void OnEnChangeEditMacheineid(object sender, EventArgs e)
+        {
+            UpdateControlStatus(false);
+
+            UpdateLicenseKeyStr(false);
+        }
+
+        private void OnCbnSelchangeComboPackid(object sender, EventArgs e)
+        {
+            UpdateControlStatus(false);
+
+            UpdateLicenseKeyStr(false);
+        }
+
+        private void OnCbnSelchangeComboLicensetype(object sender, EventArgs e)
+        {
+            UpdateControlStatus(false);
+
+            UpdateLicenseKeyStr(false);
+        }
+
+        private void OnDtnDatetimechangeDatetimeExpiredate(object sender, EventArgs e)
+        {
+            
+            m_dateTime.Value.ToString("yyyy-MM-dd");
+
+            UpdateControlStatus(false);
+
+            UpdateLicenseKeyStr(false);
+
+           
+        }
+
+        private void OnBnClickedButtonLoad(object sender, EventArgs e)
+        {
+            // dialog is from request call
+            if (m_bRequest)
+            {
+
+                // get control data from dialog
+                UpdateData();
+
+                // generate license info string
+                COTSLicenseInfo a_pOTSLicenseInfo = new COTSLicenseInfo();
+                a_pOTSLicenseInfo.SetComputerNickName(m_strEditComputerNickName);
+                a_pOTSLicenseInfo.SetMachineId(m_strEditMachineId);
+                a_pOTSLicenseInfo.SetPackId((COTSLicenseInfo.OTS_SOFT_PACKAGE_ID)m_nComboSoftPackId);
+                a_pOTSLicenseInfo.SetLicType((COTSLicenseInfo.OTS_LICENSE_TYPE)m_nCombeLicenseType);
+                a_pOTSLicenseInfo.SetExpireDate(m_oExpireData);
+
+                String strEmail = COTSLicMgr::GetLicenseInfoTextBody(a_pOTSLicenseInfo);//升级完COTSLicMgr再修改此处
+                strEmail.Trim();
+                if (strEmail == "")
+                {
+                    //invalid email body
+
+                    return;
+                }
+                // email license info string
+                if (!SendEmail(SUPPORT_EMAIL_ADDRESS, SUPPORT_EMAIL_TITLE, strEmail))//此方法做成接口
+                {
+                    // email license info string, return if send email fails
+
+                    return;
+                }
+
+                // get control data for the license info
+                GetControlData(false);
+
+                // close dialog, DoModel() return IDOK
+               // CDialog::OnOK();
+
+            }
+            else
+            {
+                    // load a license info text file              
+                    
+                    OpenFileDialog openFileDialog = new OpenFileDialog();
+                    if (openFileDialog.ShowDialog() != DialogResult.OK)
+                    {
+                    // read all string lines from the file
+                    String strPathName = openFileDialog.FileName;
+
+                    // try to load license info from a text file
+                    COTSLicenseInfo pOTSLicenseInfo = COTSLicMgr::LoadLicenseInfoFromTextFile(strPathName);
+                    kkkk
+
+                    // set control data with the license info
+                    if (pOTSLicenseInfo)
+                    {
+                        SetControlData(pOTSLicenseInfo);
+
+                        UpdateControlStatus(false);
+                    }
+                }
+            
+            }
+        }
+
+      
+        // get control data for the license info
+        public void GetControlData(bool m_bUpdate /*= TRUE*/)
+        {
+            // get control data from dialog
+            if (m_bUpdate)
+            {
+                UpdateData();
+            }
+
+            // set license info with control data
+            m_pLicenseInfo.SetComputerNickName(m_strEditComputerNickName);
+            m_pLicenseInfo.SetMachineId(m_strEditMachineId);
+            m_pLicenseInfo.SetPackId((COTSLicenseInfo.OTS_SOFT_PACKAGE_ID)m_nComboSoftPackId);
+            m_pLicenseInfo.SetLicType((COTSLicenseInfo.OTS_LICENSE_TYPE)m_nCombeLicenseType);
+            m_pLicenseInfo.SetExpireDate(m_oExpireData);
+        }
+
+        // set control data
+       public void SetControlData(COTSLicenseInfo a_pLicenseInfo)
+        {
+           
+
+            // set control data with the license info
+            m_strEditComputerNickName = a_pLicenseInfo.GetComputerNickName();
+            m_strEditMachineId = a_pLicenseInfo.GetMachineId();
+            m_nComboSoftPackId = (int)a_pLicenseInfo.GetPackId();
+            m_nCombeLicenseType = (int)a_pLicenseInfo.GetLicType();
+            m_oExpireData = a_pLicenseInfo.GetExpireDate();
+
+            UpdateLicenseKeyStr(false);
+
+            // send control data to dialog
+            UpdateData(false);
+        }
+        // send email
+        public bool SendEmail(string a_strEmailAddress, string a_strTitle, string a_strBody)
+        {
+            // form email string
+            String strEmail = "";
+            string.Format("mailto:%s?Subject=%s&body=%s", a_strEmailAddress, a_strTitle, a_strBody);
+
+            // send email
+            // int result = ShellExecute(null, "open", strEmail, null, null, SW_SHOW);
+
+            // From MSDN Documentation, ShellExecute returns >32 on success, or an error code <= 32 otherwise
+
+            // int nResult = reinterpret_cast<int>(result);
+
+
+            //return nResult > 32;
+            return true;
+        }
+
+        private void OnBnClickedOk(object sender, EventArgs e)
+        {
+
+        }
+
+        // update control status
+      public  void UpdateControlStatus(bool a_bStatus /*= TRUE*/)
+        {
+          
+            m_ctrlButtonSave.Enabled = a_bStatus;
+        }
+
+        // update license key string
+      public  void UpdateLicenseKeyStr(bool a_bUpdateData /*= TRUE*/)
+        {
+            // get control data from dialog
+            if (a_bUpdateData)
+            {
+                UpdateData();
+            }
+
+            // get license key string =========================
+            String strEditLicenseKey = m_strEditLicenseKey;
+
+            // create a license info with dialog parameters
+            COTSLicenseInfo pOTSLicenseInfo=new COTSLicenseInfo();
+            pOTSLicenseInfo.SetComputerNickName(m_strEditComputerNickName);
+            pOTSLicenseInfo.SetMachineId(m_strEditMachineId);
+            pOTSLicenseInfo.SetPackId((COTSLicenseInfo.OTS_SOFT_PACKAGE_ID)m_nComboSoftPackId);
+            pOTSLicenseInfo.SetLicType((COTSLicenseInfo.OTS_LICENSE_TYPE)m_nCombeLicenseType);
+
+            // test the license info
+            otsdataconst.OTS_LICENSE_STATUS nLicStatus = otsdataconst.OTS_LICENSE_STATUS.INVALID;
+            COTSLicMgr licMgr = new COTSLicMgr();
+            licMgr.IsValidLicense(Convert.ToInt32(pOTSLicenseInfo.GetPackId()), pOTSLicenseInfo, ref Convert.ToInt32(nLicStatus), false, false);
+            if (nLicStatus >= OTS_LICENSE_STATUS.OTS_LICENSE_STATUS_CAN_HAVEKEY && nLicStatus <= OTS_LICENSE_STATUS.MAX)
+            {
+                strEditLicenseKey = COTSLicMgr.EncryptLicenseInfo(pOTSLicenseInfo);//升级完COTSLicMgr再修改此处
+            }
+            // get license key string =========================
+
+            // license key string changed?
+            if (m_strEditLicenseKey.CompareTo(strEditLicenseKey) != 0)
+            {
+                // yes, update
+                m_strEditLicenseKey = strEditLicenseKey;
+                if (a_bUpdateData)
+                {
+                    // send control data to dialog
+                    UpdateData(false);
+                }
+            }
+        }
+
+        public bool UpdateData(bool bSaveAndValidate = true) { return false; }
+    }
+}

+ 120 - 0
OTS/OTSModelSharp/Measure/GetStageInfo/DlgLicenseInfo.resx

@@ -0,0 +1,120 @@
+<?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>

+ 85 - 0
OTS/OTSModelSharp/Measure/GetStageInfo/DlgStageRename.Designer.cs

@@ -0,0 +1,85 @@
+namespace OTSModelSharp.Measure.GetStageInfo
+{
+    partial class DlgStageRename
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.button1 = new System.Windows.Forms.Button();
+            this.button2 = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(12, 12);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(422, 21);
+            this.textBox1.TabIndex = 0;
+            this.textBox1.TextChanged += new System.EventHandler(this.OnChangeEditName);
+            // 
+            // button1
+            // 
+            this.button1.Location = new System.Drawing.Point(273, 39);
+            this.button1.Name = "button1";
+            this.button1.Size = new System.Drawing.Size(75, 23);
+            this.button1.TabIndex = 1;
+            this.button1.Text = "确定";
+            this.button1.UseVisualStyleBackColor = true;
+            this.button1.Click += new System.EventHandler(this.OnBnClickedOk);
+            // 
+            // button2
+            // 
+            this.button2.Location = new System.Drawing.Point(354, 39);
+            this.button2.Name = "button2";
+            this.button2.Size = new System.Drawing.Size(75, 23);
+            this.button2.TabIndex = 2;
+            this.button2.Text = "取消";
+            this.button2.UseVisualStyleBackColor = true;
+            this.button2.Click += new System.EventHandler(this.OnBnClickedCancel);
+            // 
+            // DlgStageRename
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(441, 67);
+            this.Controls.Add(this.button2);
+            this.Controls.Add(this.button1);
+            this.Controls.Add(this.textBox1);
+            this.Name = "DlgStageRename";
+            this.Text = "样品台重命名";
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.Button button2;
+    }
+}

+ 120 - 0
OTS/OTSModelSharp/Measure/GetStageInfo/DlgStageRename.resx

@@ -0,0 +1,120 @@
+<?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>