public IOperation OperationFuer(string kommando) { IOperation operationResult = null; List <IBefehl> befehle = _befehle.Befehle(); IBefehl gefundenerBefehl = befehle.Find(befehl => ((kommando == befehl.Kommando) || (kommando == befehl.KurzKommando))); if (gefundenerBefehl != null) { operationResult = gefundenerBefehl.Operation; } return(operationResult); }
private string HilfstextFuer(IBefehl befehl) { var kommandoText = befehl.Kommando; // Alias im Kommando suchen und mit [] wrappen var aliasPosition = kommandoText.IndexOf(befehl.Alias, StringComparison.InvariantCultureIgnoreCase); var textBisAlias = kommandoText.Substring(0, aliasPosition); var textNachAlias = kommandoText.Substring(aliasPosition + befehl.Alias.Length); var result = $" * \"{textBisAlias}[{befehl.Alias}]{textNachAlias}\" {befehl.Erklaerung}"; // Default Befehl kennzeichnen if (befehl.Kommando == Konfiguration.DefaultBefehl) { result += " (default bei ENTER)"; } return(result); }
public string HilfstextFuer(IBefehl befehl) { return(string.Format(" * \"{0}\" [{1}] {2}", befehl.Kommando, befehl.KurzKommando, befehl.Erklaerung)); }