This will do what you want I think -
public class JsonSerializer
{
private static readonly JsonSerializerSettings SerializationSettings =
new
JsonSerializerSettings
{
ContractResolver = new using
Newtonsoft.Json.Serialization.LowercaseContractResolver()
};
private static readonly JsonSerializerSettings DeserializationSettings =
new JsonSerializerSettings
{
ContractResolver = new using
Newtonsoft.Json.Serialization.LowercaseContractResolver()
};
public static string SerializeObject(object o)
{
return JsonConvert.SerializeObject(o, Formatting.None,
SerializationSettings);
}
public static object DeserializeObject (string json, Type type)
{
return JsonConvert.DeserializeObject(json, type,
DeserializationSettings);
}
}
public class LowercaseContractResolver : using
Newtonsoft.Json.Serialization.DefaultContractResolver
{
protected override string ResolvePropertyName(string propertyName)
{
return propertyName.Substring(0, 1).ToLower() +
propertyName.Substring(1);
}
}
public class UppercaseContractResolver : using
Newtonsoft.Json.Serialization.DefaultContractResolver
{
protected override string ResolvePropertyName(string propertyName)
{
return propertyName.Substring(0, 1).ToUpper() +
propertyName.Substring(1);
}
}
--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/parse-facebook-friend-list-in-josn-tp5712133p5712817.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid