コード例 #1
0
    static int Equals(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(Newtonsoft.Json.Linq.JValue), typeof(Newtonsoft.Json.Linq.JValue)))
            {
                Newtonsoft.Json.Linq.JValue obj  = (Newtonsoft.Json.Linq.JValue)ToLua.ToObject(L, 1);
                Newtonsoft.Json.Linq.JValue arg0 = (Newtonsoft.Json.Linq.JValue)ToLua.ToObject(L, 2);
                bool o = obj != null?obj.Equals(arg0) : arg0 == null;

                LuaDLL.lua_pushboolean(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(Newtonsoft.Json.Linq.JValue), typeof(object)))
            {
                Newtonsoft.Json.Linq.JValue obj = (Newtonsoft.Json.Linq.JValue)ToLua.ToObject(L, 1);
                object arg0 = ToLua.ToVarObject(L, 2);
                bool   o    = obj != null?obj.Equals(arg0) : arg0 == null;

                LuaDLL.lua_pushboolean(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Newtonsoft.Json.Linq.JValue.Equals"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #2
0
ファイル: JContainer.cs プロジェクト: zha0/Cerberus
        // Token: 0x0600125B RID: 4699 RVA: 0x00064674 File Offset: 0x00062874
        internal static bool IsTokenUnchanged(JToken currentValue, [Nullable(2)] JToken newValue)
        {
            JValue jvalue = currentValue as JValue;

            if (jvalue == null)
            {
                return(false);
            }
            if (newValue == null)
            {
                return(jvalue.Type == JTokenType.Null);
            }
            return(jvalue.Equals(newValue));
        }
コード例 #3
0
        internal static bool IsTokenUnchanged(JToken currentValue, JToken newValue)
        {
            JValue jValue = currentValue as JValue;

            if (jValue != null)
            {
                if (jValue.Type == JTokenType.Null && newValue == null)
                {
                    return(true);
                }
                return(jValue.Equals(newValue));
            }
            return(false);
        }
コード例 #4
0
        internal static bool IsTokenUnchanged(JToken currentValue, JToken newValue)
        {
            JValue v1 = currentValue as JValue;

            if (v1 != null)
            {
                // null will get turned into a JValue of type null
                if (v1.Type == JTokenType.Null && newValue == null)
                {
                    return(true);
                }

                return(v1.Equals(newValue));
            }

            return(false);
        }
コード例 #5
0
ファイル: JsonComparer.cs プロジェクト: vtex/specs-owin-pt
 private static void ComparePrimitives(JValue expected, JValue actual)
 {
     if (!expected.Equals(actual))
         FailValue(expected, actual);
 }
コード例 #6
0
        internal static bool IsTokenUnchanged(JToken currentValue, JToken newValue)
        {
            JValue jValue = currentValue as JValue;

            return(jValue != null && ((jValue.Type == JTokenType.Null && newValue == null) || jValue.Equals(newValue)));
        }
コード例 #7
0
		public Boolean GetBooleanProperty(string key)
		{
			var bv = _tokenInfo.SelectToken(key);
			if ( bv== null )
				return false;
			
			var trueValue = new JValue(true);
			return trueValue.Equals(bv);
		}
コード例 #8
0
ファイル: JContainer.cs プロジェクト: nexywexy/PlatinumClient
        internal static bool IsTokenUnchanged(JToken currentValue, JToken newValue)
        {
            JValue value2 = currentValue as JValue;

            return(((value2?.Type == JTokenType.Null) && (newValue == null)) || value2.Equals(newValue));
        }