private void 添加ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OprationSetting os = new OprationSetting();

            if (os.ShowDialog() == DialogResult.OK)
            {
                CommunicationType opType = CommunicationType.Com;
                if (os.CommunicationType.ToLower() == "tcp")
                {
                    opType = CommunicationType.TCP;
                }
                else if (os.CommunicationType.ToLower() == "udp")
                {
                    opType = CommunicationType.UDP;
                }
                else if (os.CommunicationType.ToLower() == "串口")
                {
                    opType = CommunicationType.Com;
                }

                DataType dType = DataType.Character;
                if (os.DataType.ToLower() == "十六进制")
                {
                    dType = DataType.Hex;
                }
                else if (os.DataType.ToLower() == "字符串")
                {
                    dType = DataType.Character;
                }

                UserOperation opration = new UserOperation(os.OprationName, opType, dType, os.Setting, os.Data, os.DelayTime);
                AddOpration(opration);
            }
        }
        private void dgOprationList_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (_currentOperation != null)
            {
                OprationSetting os = new OprationSetting();
                os.OprationName      = _currentOperation.Name;
                os.CommunicationType = GetOperationTypeString(_currentOperation.OpreationType);
                os.DataType          = GetDataTypeString(_currentOperation.DataType);
                os.Data      = _currentOperation.Data;
                os.DelayTime = _currentOperation.DelayTime;
                os.Setting   = _currentOperation.Setting;

                if (os.ShowDialog() == DialogResult.OK)
                {
                    CommunicationType opType = CommunicationType.Com;
                    if (os.CommunicationType.ToLower() == "tcp")
                    {
                        opType = CommunicationType.TCP;
                    }
                    else if (os.CommunicationType.ToLower() == "udp")
                    {
                        opType = CommunicationType.UDP;
                    }
                    else if (os.CommunicationType.ToLower() == "串口")
                    {
                        opType = CommunicationType.Com;
                    }

                    DataType dType = DataType.Character;
                    if (os.DataType.ToLower() == "十六进制")
                    {
                        dType = DataType.Hex;
                    }
                    else if (os.DataType.ToLower() == "字符串")
                    {
                        dType = DataType.Character;
                    }

                    _currentOperation.Name          = os.OprationName;
                    _currentOperation.OpreationType = opType;
                    _currentOperation.DataType      = dType;
                    _currentOperation.Setting       = os.Setting;
                    _currentOperation.Data          = os.Data;
                    _currentOperation.DelayTime     = os.DelayTime;

                    RefreshOprations();
                }
            }
        }