예제 #1
0
 internal PoolIssuer(object key, Newtonsoft.Rules.UnicodeCategory ord)
 {
     //Discarded unreachable code: IL_0002, IL_0006
     //IL_0003: Incompatible stack heights: 0 vs 1
     //IL_0007: Incompatible stack heights: 0 vs 1
     SingletonReader.PushGlobal();
     base._002Ector();
     m_InvocationIssuer = key;
     _ValIssuer         = ord;
 }
예제 #2
0
 private static Newtonsoft.Rules.UnicodeCategory MoveRequest(Newtonsoft.Rules.UnicodeCategory?def)
 {
     //Discarded unreachable code: IL_0002
     //IL_0003: Incompatible stack heights: 0 vs 1
     if (!def.HasValue)
     {
         return(Newtonsoft.Rules.UnicodeCategory.String);
     }
     Newtonsoft.Rules.UnicodeCategory valueOrDefault = def.GetValueOrDefault();
     if (valueOrDefault == Newtonsoft.Rules.UnicodeCategory.Comment || valueOrDefault == Newtonsoft.Rules.UnicodeCategory.String || valueOrDefault == Newtonsoft.Rules.UnicodeCategory.Raw)
     {
         return(def.GetValueOrDefault());
     }
     return(Newtonsoft.Rules.UnicodeCategory.String);
 }
예제 #3
0
        internal static int StopRequest(Newtonsoft.Rules.UnicodeCategory key, object attr, object pool)
        {
            //Discarded unreachable code: IL_0002
            //IL_0003: Incompatible stack heights: 0 vs 1
            if (attr == pool)
            {
                return(0);
            }
            if (pool == null)
            {
                return(1);
            }
            if (attr == null)
            {
                return(-1);
            }
            switch (key)
            {
            case Newtonsoft.Rules.UnicodeCategory.Integer:
                if (attr is BigInteger)
                {
                    BigInteger value3 = (BigInteger)attr;
                    return(CreateRequest(value3, pool));
                }
                if (pool is BigInteger)
                {
                    BigInteger value4 = (BigInteger)pool;
                    return(-CreateRequest(value4, attr));
                }
                if (attr is ulong || pool is ulong || attr is decimal || pool is decimal)
                {
                    return(Convert.ToDecimal(attr, CultureInfo.InvariantCulture).CompareTo(Convert.ToDecimal(pool, CultureInfo.InvariantCulture)));
                }
                if (attr is float || pool is float || attr is double || pool is double)
                {
                    return(CloneRequest(attr, pool));
                }
                return(Convert.ToInt64(attr, CultureInfo.InvariantCulture).CompareTo(Convert.ToInt64(pool, CultureInfo.InvariantCulture)));

            case Newtonsoft.Rules.UnicodeCategory.Float:
                if (attr is BigInteger)
                {
                    BigInteger value7 = (BigInteger)attr;
                    return(CreateRequest(value7, pool));
                }
                if (pool is BigInteger)
                {
                    BigInteger value8 = (BigInteger)pool;
                    return(-CreateRequest(value8, attr));
                }
                if (attr is ulong || pool is ulong || attr is decimal || pool is decimal)
                {
                    return(Convert.ToDecimal(attr, CultureInfo.InvariantCulture).CompareTo(Convert.ToDecimal(pool, CultureInfo.InvariantCulture)));
                }
                return(CloneRequest(attr, pool));

            case Newtonsoft.Rules.UnicodeCategory.Comment:
            case Newtonsoft.Rules.UnicodeCategory.String:
            case Newtonsoft.Rules.UnicodeCategory.Raw:
            {
                string strA = Convert.ToString(attr, CultureInfo.InvariantCulture);
                string strB = Convert.ToString(pool, CultureInfo.InvariantCulture);
                return(string.CompareOrdinal(strA, strB));
            }

            case Newtonsoft.Rules.UnicodeCategory.Boolean:
            {
                bool flag   = Convert.ToBoolean(attr, CultureInfo.InvariantCulture);
                bool value2 = Convert.ToBoolean(pool, CultureInfo.InvariantCulture);
                return(flag.CompareTo(value2));
            }

            case Newtonsoft.Rules.UnicodeCategory.Date:
            {
                if (attr is DateTime)
                {
                    DateTime dateTime = (DateTime)attr;
                    DateTime value5   = (!(pool is DateTimeOffset)) ? Convert.ToDateTime(pool, CultureInfo.InvariantCulture) : ((DateTimeOffset)pool).DateTime;
                    return(dateTime.CompareTo(value5));
                }
                DateTimeOffset dateTimeOffset = (DateTimeOffset)attr;
                DateTimeOffset other          = (pool is DateTimeOffset) ? ((DateTimeOffset)pool) : new DateTimeOffset(Convert.ToDateTime(pool, CultureInfo.InvariantCulture));
                return(dateTimeOffset.CompareTo(other));
            }

            case Newtonsoft.Rules.UnicodeCategory.Bytes:
            {
                byte[] array = pool as byte[];
                if (array == null)
                {
                    throw new ArgumentException("Object must be of type byte[].");
                }
                return(CustomerListAnnotation.PrintIssuer(attr as byte[], array));
            }

            case Newtonsoft.Rules.UnicodeCategory.Guid:
            {
                if (!(pool is Guid))
                {
                    throw new ArgumentException("Object must be of type Guid.");
                }
                Guid guid   = (Guid)attr;
                Guid value6 = (Guid)pool;
                return(guid.CompareTo(value6));
            }

            case Newtonsoft.Rules.UnicodeCategory.Uri:
            {
                Uri uri = pool as Uri;
                if (uri == null)
                {
                    throw new ArgumentException("Object must be of type Uri.");
                }
                Uri uri2 = (Uri)attr;
                return(Comparer <string> .Default.Compare(uri2.ToString(), uri.ToString()));
            }

            case Newtonsoft.Rules.UnicodeCategory.TimeSpan:
            {
                if (!(pool is TimeSpan))
                {
                    throw new ArgumentException("Object must be of type TimeSpan.");
                }
                TimeSpan timeSpan = (TimeSpan)attr;
                TimeSpan value    = (TimeSpan)pool;
                return(timeSpan.CompareTo(value));
            }

            default:
                throw CustomerListAnnotation.ConcatIssuer("valueType", key, "Unexpected value type: {0}".ListReader(CultureInfo.InvariantCulture, key));
            }
        }