本文整理汇总了C#中ICommand.execute方法的典型用法代码示例。如果您正苦于以下问题:C# ICommand.execute方法的具体用法?C# ICommand.execute怎么用?C# ICommand.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICommand
的用法示例。
在下文中一共展示了ICommand.execute方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnDelete_Click
private void btnDelete_Click(object sender, EventArgs e)
{
if (_operNumlst.Count == 0)
return;
this.Enabled = false;
foreach (var item in _operNumlst)
{
_deleteLabourNormCmd = new DeleteLabourNormCommand(item);
_deleteLabourNormCmd.execute();
}
UpdateDataGrids();
_operNumlst.Clear();
this.Enabled = true;
}
示例2: btApplyDel_Click
private void btApplyDel_Click(object sender, EventArgs e)
{
if (_operNumlst.Count > 0)
{
foreach (var item in _operNumlst)
{
_whereOperationUseItem = new WhereOperationUse(item, 1, 1, _selectProductChiper);
_delWhereOperUseCmd = new DeleteWhereOperUseCommand(_whereOperationUseItem);
_delWhereOperUseCmd.execute();
}
this.UpdateDataGrids();
_operNumlst.Clear();
}
else
{
_delWhereOperUseCmd = new DeleteWhereOperUseCommand(_whereOperationUseItem);
_delWhereOperUseCmd.execute();
this.UpdateApplyDataGrid();
}
}
示例3: btAddApply_Click
private void btAddApply_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow dgrow in dgOperApply.Rows)
{
if (dgrow.Cells[0].Value.ToString() == vtbProdName.ValueTxt)
return;
}
if (!vtbProdName.IsValid || !vtbSeriaFrom.IsValid)
{
return;
}
if (!FillTrudoyomkostDB.DcMaxApply.ContainsKey(vtbProdName.ValueTxt))
{
return;
}
int seriaFrom = MathFunctionForSeries.GetIntSeriaNumber(vtbSeriaFrom.ValueTxt);
int seriaTo = MathFunctionForSeries.GetIntSeriaNumber(vtbSeriaTo.ValueTxt);
short prodChipher = _dcInfProducts[vtbProdName.ValueTxt];
_updateOldLabourCard = new UpdateOldNormCardCommand(seriaFrom, prodChipher);
_updateOldLabourCard.execute();
if (_operNumlst.Count == 0 && _dtLabourNorm.Rows.Count > 0)
{
foreach (DataRow tRow in _dtLabourNorm.Rows)
{
_operNumlst.Add((int)tRow[0]);
}
}
foreach (var item in _operNumlst)
{
bool IsApplyProduct = true;
foreach (DataRow itemrow in _dcApplyOper[item].Rows)
{
if (vtbProdName.ValueTxt.Equals(itemrow[0]))
{
IsApplyProduct = false;
break;
}
}
if (IsApplyProduct)
{
_whereOperationUseItem = new WhereOperationUse(item, seriaFrom, seriaTo, prodChipher);
_addWhereOperUseCmd = new AddWhereOperUseCommand(_whereOperationUseItem);
_addWhereOperUseCmd.execute();
}
}
UpdateDataGrids();
CheckDelOper();
_operNumlst.Clear();
}
示例4: execute
public object execute(ICommand command, string line)
{
Match match = Regex.Match(line, @"([d|m|c]-\d+)", RegexOptions.IgnoreCase);
string process = "p";
if (match.Success)
{
process = match.Groups[1].Value;
}
char code = process[0];
object result = null;
switch (code)
{
case 'm':
IMetadataServer ms_server = (IMetadataServer)Activator.GetObject(typeof(IMetadataServer), processes[process]);
result = command.execute(ms_server, line);
break;
case 'd':
IDataServer ds_server = (IDataServer)Activator.GetObject(typeof(IDataServer), processes[process]);
result = command.execute(ds_server, line);
break;
case 'c':
IClient client = (IClient)Activator.GetObject(typeof(IClient), processes[process]);
result = command.execute(client, line);
break;
default:
break;
}
return result;
}
示例5: StoreAndExecute
public void StoreAndExecute(ICommand command)
{
_commands.Add(command);
command.execute();
}
示例6: executeCommand
// PUBLIC
/// <summary>
/// Executes the command.
/// </summary>
/// <returns>
/// The command.
/// </returns>
/// <param name='aICommand'>
/// A I command.
/// </param>
public void executeCommand (ICommand aICommand)
{
aICommand.execute();
if (aICommand is IUndoableCommand) {
_iUndoableCommands.Add (aICommand as IUndoableCommand);
}
}