Ejemplo n.º 1
0
 public override string ToString()
 {
     return(PlayFabSimpleJson.SerializeObject(this, null) ?? string.Empty);
 }
Ejemplo n.º 2
0
        private static bool SerializeValue(IJsonSerializerStrategy jsonSerializerStrategy, object value, StringBuilder builder)
        {
            bool   flag = true;
            string text = value as string;

            if (value == null)
            {
                builder.Append("null");
            }
            else if (text != null)
            {
                flag = PlayFabSimpleJson.SerializeString(text, builder);
            }
            else
            {
                IDictionary <string, object> dictionary = value as IDictionary <string, object>;
                Type   type = value.GetType();
                Type[] genericTypeArguments = ReflectionUtils.GetGenericTypeArguments(type);
                bool   flag2 = type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary <, >) && genericTypeArguments[0] == typeof(string);
                if (flag2)
                {
                    IDictionary dictionary2 = value as IDictionary;
                    flag = PlayFabSimpleJson.SerializeObject(jsonSerializerStrategy, dictionary2.Keys, dictionary2.Values, builder);
                }
                else if (dictionary != null)
                {
                    flag = PlayFabSimpleJson.SerializeObject(jsonSerializerStrategy, dictionary.Keys, dictionary.Values, builder);
                }
                else
                {
                    IDictionary <string, string> dictionary3 = value as IDictionary <string, string>;
                    if (dictionary3 != null)
                    {
                        flag = PlayFabSimpleJson.SerializeObject(jsonSerializerStrategy, dictionary3.Keys, dictionary3.Values, builder);
                    }
                    else
                    {
                        IEnumerable enumerable = value as IEnumerable;
                        if (enumerable != null)
                        {
                            flag = PlayFabSimpleJson.SerializeArray(jsonSerializerStrategy, enumerable, builder);
                        }
                        else if (PlayFabSimpleJson.IsNumeric(value))
                        {
                            flag = PlayFabSimpleJson.SerializeNumber(value, builder);
                        }
                        else if (value is bool)
                        {
                            builder.Append((!(bool)value) ? "false" : "true");
                        }
                        else
                        {
                            object value2;
                            flag = jsonSerializerStrategy.TrySerializeNonPrimitiveObject(value, out value2);
                            if (flag)
                            {
                                PlayFabSimpleJson.SerializeValue(jsonSerializerStrategy, value2, builder);
                            }
                        }
                    }
                }
            }
            return(flag);
        }
Ejemplo n.º 3
0
 public string SerializeObject(object json, object jsonSerializerStrategy)
 {
     return(PlayFabSimpleJson.SerializeObject(json, (IJsonSerializerStrategy)jsonSerializerStrategy));
 }
Ejemplo n.º 4
0
 public string SerializeObject(object json)
 {
     return(PlayFabSimpleJson.SerializeObject(json));
 }
Ejemplo n.º 5
0
 public override string ToString()
 {
     return(PlayFabSimpleJson.SerializeObject(this._members, null));
 }
Ejemplo n.º 6
0
 public string SerializeObject(object json)
 {
     return(PlayFabSimpleJson.SerializeObject(json, SimpleJsonInstance.ApiSerializerStrategy));
 }