/// <summary> /// Remove command by using specific condition. /// </summary> /// <param name="condition"></param> public void RemoveCommand(Func <TerminalMessage, bool> condition) { var command = CommandsQueue.FirstOrDefault(condition); if (command != null) { CommandsQueue.Remove(command); } }
/// <summary> /// Remove command from cache. /// </summary> /// <param name="commandSequence"></param> /// <param name="commandIndex"></param> public void RemoveCommand(string commandSequence, string commandIndex) { var command = CommandsQueue.FirstOrDefault( x => x.CommandSequence.Equals(commandSequence, StringComparison.InvariantCultureIgnoreCase) && x.CommandIndex.Equals(commandIndex, StringComparison.InvariantCultureIgnoreCase)); if (command != null) { CommandsQueue.Remove(command); } }
/// <summary> /// Delete terminal message from queue. /// </summary> /// <param name="terminalMessage"></param> public void Delete(TerminalMessage terminalMessage) { CommandsQueue.Remove(terminalMessage); }