Woopsa.WoopsaValue.Equals C# (CSharp) Method

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
        public override bool Equals(object obj)
        {
            if (obj is IWoopsaValue)
            {
                IWoopsaValue right = (IWoopsaValue)obj;
                return right.Type == _type && right.AsText == _text;
            }
            else if (obj == null && _type == WoopsaValueType.Null)
                return true;
            else if (obj is bool && _type == WoopsaValueType.Logical)
                return ((bool)obj) == (bool)this;
            else if (obj is sbyte || obj is Int16 || obj is Int32 || obj is Int64)
                return Convert.ToInt64(obj) == (Int64)this;
            else if (obj is Byte || obj is UInt16 || obj is UInt32 || obj is UInt64)
                return Convert.ToUInt64(obj) == (UInt64)this;
            else if (obj is float || obj is double || obj is decimal)
                return Convert.ToDouble(obj) == (double)this;
            else if (obj is DateTime)
                return ((DateTime)obj) == (DateTime)this;
            else if (obj is TimeSpan)
                return ((TimeSpan)obj) == (TimeSpan)this;
            else if (obj is string)
                return (string)obj == _text;
            return base.Equals(obj);
        }