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

            if (actionSetting.ShowDialog() == DialogResult.OK)
            {
                if (_actionList != null)
                {
                    if (!CheckReceiveCommand(actionSetting.ActionCode) && !CheckAllArrayReceiveCommand(actionSetting.ActionCode))
                    {
                        UserAction action = new UserAction(actionSetting.ActionName, actionSetting.ActionCode);
                        _actionList.Add(action);
                    }
                    else
                    {
                        Helper.ShowMessageBox("提示", "存在相同接收符!");
                    }

                    RefreshActionList();
                }
                else
                {
                    UserAction action = new UserAction(actionSetting.ActionName, actionSetting.ActionCode);
                    _actionList.Add(action);
                    RefreshActionList();
                }
            }
        }
        private void 设置ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_currentAction != null)
            {
                ActionSetting actionSetting = new ActionSetting();
                actionSetting.ActionName = _currentAction.Name;
                actionSetting.ActionCode = _currentAction.ReceiveCommand;

                if (actionSetting.ShowDialog() == DialogResult.OK)
                {
                    if (!CheckReceiveCommand(actionSetting.ActionCode) || _currentAction.ReceiveCommand == actionSetting.ActionCode || !CheckAllArrayReceiveCommand(actionSetting.ActionCode))
                    {
                        _currentAction.Name           = actionSetting.ActionName;
                        _currentAction.ReceiveCommand = actionSetting.ActionCode;
                    }
                    else
                    {
                        Helper.ShowMessageBox("提示", "存在相同接收符!");
                    }

                    RefreshActionList();
                }
            }
        }
Exemple #3
0
        private void SettingAction()
        {
            if (_currentAction != null)
            {
                ActionSetting actionSetting = new ActionSetting();
                actionSetting.ActionName = _currentAction.Name;
                actionSetting.ActionCode = _currentAction.ReceiveCommand;

                if (actionSetting.ShowDialog() == DialogResult.OK)
                {
                    if (!CheckCurrentArrayReceiveCommand(actionSetting.ActionCode) || _currentAction.ReceiveCommand == actionSetting.ActionCode || !CheckAllArrayReceiveCommand(actionSetting.ActionCode))
                    {
                        _currentAction.Name           = actionSetting.ActionName;
                        _currentAction.ReceiveCommand = actionSetting.ActionCode;
                    }
                    else
                    {
                        Helper.ShowMessageBox("提示", "存在相同接收符!");
                    }

                    RefreshActionList();
                }
            }
        }