private void 添加ToolStripMenuItem_Click(object sender, EventArgs e) { AreaSetting areaSetting = new AreaSetting(); if (areaSetting.ShowDialog() == DialogResult.OK) { if (_areas != null) { foreach (UserArea area in _areas) { if (area.Name == areaSetting.AreaName) { Helper.ShowMessageBox("提示", "已存在相同名称!"); return; } } UserArea command = new UserArea(areaSetting.AreaName); AddCommand(command); } else { UserArea command = new UserArea(areaSetting.AreaName); _areas.Add(command); RefreshAreaList(); } } }
private void 添加ToolStripMenuItem_Click(object sender, EventArgs e) { AreaSetting _userActionName = new AreaSetting(); _userActionName.LbName = "命令名称"; if (_userActionName.ShowDialog() == DialogResult.OK) { if (_definedNames != null) { foreach (UserDefinedOperation area in _definedNames) { if (area.Name == _userActionName.AreaName) { Helper.ShowMessageBox("提示", "已存在相同名称!"); return; } } UserDefinedOperation command = new UserDefinedOperation(_userActionName.AreaName); AddCommand(command); } else { UserDefinedOperation command = new UserDefinedOperation(_userActionName.AreaName); _definedNames = new List <UserDefinedOperation>(); _definedNames.Add(command); RefreshAreaList(); } } }
private void 设置ToolStripMenuItem_Click(object sender, EventArgs e) { if (_currentArea != null) { AreaSetting cs = new AreaSetting(); cs.AreaName = _currentArea.Name; if (cs.ShowDialog() == DialogResult.OK) { foreach (UserArea area in _areas) { if (area.Name == cs.AreaName && area != _currentArea) { Helper.ShowMessageBox("提示", "已存在相同名称!"); return; } } _currentArea.Name = cs.AreaName; RefreshAreaList(); } } }
private void 设置ToolStripMenuItem_Click(object sender, EventArgs e) { if (_currentUserDefinedName != null) { AreaSetting _userActionName = new AreaSetting(); _userActionName.AreaName = _currentUserDefinedName.Name; _userActionName.LbName = "命令名称"; if (_userActionName.ShowDialog() == DialogResult.OK) { foreach (UserDefinedOperation area in _definedNames) { if (area.Name == _userActionName.AreaName && area != _currentUserDefinedName) { Helper.ShowMessageBox("提示", "已存在相同名称!"); return; } } _currentUserDefinedName.Name = _userActionName.AreaName; RefreshAreaList(); } } }