namespace Calculator { internal class OperationElement : CalculationElement { public Operation Operation { get; } public OperationElement(Operation operation) { Operation = operation; } public override string ToString() { switch (Operation) { case Operation.Add: return "+"; case Operation.Subtract: return "-"; case Operation.Muliply: return "*"; case Operation.Divide: return "/"; default: return "Null"; } } public override bool Equals(object obj) { return Equals(obj as OperationElement); } public bool Equals(OperationElement other) { return other != null && Operation == other.Operation; } public override int GetHashCode() { return 1706920598 + Operation.GetHashCode(); } } internal enum Operation { Add, Subtract, Muliply, Divide } }