예제 #1
0
        public bool Has(System.IConvertible tag)
        {
            ulong otherLiteralValue = tag.ToUInt64(System.Globalization.CultureInfo.InvariantCulture);

            return((LiteralValue & otherLiteralValue) == otherLiteralValue);
        }
예제 #2
0
        public static bool eq(object v1, object v2)
        {
            if (System.Object.ReferenceEquals(v1, v2))
            {
                return(true);
            }
            if (v1 == null || v2 == null)
            {
                return(false);
            }

            System.IConvertible v1c = v1 as System.IConvertible;

            if (v1c != null)
            {
                System.IConvertible v2c = v2 as System.IConvertible;

                if (v2c == null)
                {
                    return(false);
                }

                System.TypeCode t1 = v1c.GetTypeCode();
                System.TypeCode t2 = v2c.GetTypeCode();
                if (t1 == t2)
                {
                    return(v1c.Equals(v2c));
                }

                switch (t1)
                {
                case System.TypeCode.Int64:
                case System.TypeCode.UInt64:
                    return(v1c.ToUInt64(null) == v2c.ToUInt64(null));

                default:
                    return(v1c.ToDouble(null) == v2c.ToDouble(null));
                }
            }

            System.ValueType v1v = v1 as System.ValueType;
            if (v1v != null)
            {
                return(v1.Equals(v2));
            }
            else
            {
                System.Type v1t = v1 as System.Type;
                if (v1t != null)
                {
                    System.Type v2t = v2 as System.Type;
                    if (v2t != null)
                    {
                        return(typeEq(v1t, v2t));
                    }
                    return(false);
                }
            }

            return(false);
        }
예제 #3
0
 public bool HasAny(System.IConvertible tag)
 {
     return((LiteralValue & tag.ToUInt64(System.Globalization.CultureInfo.InvariantCulture)) != 0UL);
 }