public void RemoveCommand(LanguageCommand command) { var idx = CommandsList.FindIndex(com => com.ObjectId == command.ObjectId); if (idx >= 0) { CommandsList.RemoveAt(idx); } }
protected LanguageCommand AddCommandBeforeCommand(LanguageCommand existingCommand, LanguageCommand addedCommand) { var index = CommandsList.FindIndex(command => command.ObjectId == existingCommand.ObjectId); if (index < 0) { CommandsList.Add(addedCommand); } else { CommandsList.Insert(index, addedCommand); } return(addedCommand); }
public virtual LanguageCommand AddCommandBeforeCommand_Assign(LanguageCommand existingCommand, LanguageValueAccess lhsValue, ILanguageExpression rhsExpr) { return(AddCommandBeforeCommand(existingCommand, new CommandAssign(ChildCommandBlockScope, lhsValue, rhsExpr))); }
public LanguageCommand AddCommand(LanguageCommand command) { CommandsList.Add(command); return(command); }