public override string ToString() { if (Operation == '=') { return(Operation + Op1.ToString()); } return(Op1.ToString() + Operation + Op2.ToString()); }
public override String ToString() { String str = ""; switch (CmdName) { case "park": str = "Парковать"; break; case "push": str = "Положить в ячейку " + Op2.ToString(); break; case "take": str = "Взять из ячейки " + Op1.ToString(); break; case "trans": str = "Переместить из ячейки " + Op1.ToString() + " в ячейку " + Op2.ToString(); break; } return(str); }
public override string ToString() { switch (OperationType) { case ArthmeticOperationType.Add: return($"({Op1.ToString()}) + ({Op2.ToString()})"); case ArthmeticOperationType.Div: return($"({Op1.ToString()}) / ({Op2.ToString()})"); case ArthmeticOperationType.Mod: return($"({Op1.ToString()}) % ({Op2.ToString()})"); case ArthmeticOperationType.Mult: return($"({Op1.ToString()}) * ({Op2.ToString()})"); case ArthmeticOperationType.Sub: return($"({Op1.ToString()}) - ({Op2.ToString()})"); default: throw new InvalidEnumArgumentException(nameof(OperationType)); } }
private String SubtractionToString() { return(Op1.ToString() + " - " + Op2.ToString()); }
private String RightShiftToString() { return(Op1.ToString() + " >> " + Op2.ToString()); }
private String OrToString() { return(Op1.ToString() + " | " + Op2.ToString()); }
private String LeftShiftToString() { return(Op1.ToString() + " << " + Op2.ToString()); }
private String CompositeToString() { return(Op1.ToString() + " " + ComparisonOperatorToString() + " " + Op2.ToString()); }
private String AssignmentToString() { return(Op1.ToString() + " = " + Op2.ToString()); }
private String AndToString() { return(Op1.ToString() + " & " + Op2.ToString()); }
private String AdditionToString() { return(Op1.ToString() + " + " + Op2.ToString()); }