Exemple #1
0
        public override bool Equals(object obj)
        {
            NumberOrString other = obj as NumberOrString;

            return(other == null ? false : Equals(other));
        }
Exemple #2
0
 public bool Equals(NumberOrString other) =>
 (IsLeft && other.IsLeft) ? (Left == other.Left) :
 (IsRight && other.IsRight) ? (Right == other.Right) :
 (!IsLeft && !IsRight && !other.IsLeft && !other.IsRight);     // None == None
Exemple #3
0
 public bool Equals(NumberOrString other)
 {
     return(IsLeft && other.IsLeft ? Left == other.Left :
            IsRight && other.IsRight ? Right == other.Right :
            !IsLeft && !IsRight && !other.IsLeft && !other.IsRight);
 }