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

            return(other == null ? false : Equals(other));
        }
示例#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
示例#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);
 }