コード例 #1
0
 public object Deserialize(JsonValue json, JsonMapper mapper)
 {
     Photo.Image image = null;
     if (json != null && !json.IsNull)
     {
         image        = new Photo.Image();
         image.Source = json.ContainsName("source") ? json.GetValue <string>("source") : String.Empty;
         image.Width  = json.ContainsName("width") ? json.GetValue <int>("width") : 0;
         image.Height = json.ContainsName("height") ? json.GetValue <int>("height") : 0;
     }
     return(image);
 }
コード例 #2
0
		public object Deserialize(JsonValue json, JsonMapper mapper)
		{
			Photo.Image image = null;
			if ( json != null && !json.IsNull )
			{
				image = new Photo.Image();
				image.Source = json.ContainsName("source") ? json.GetValue<string>("source") : String.Empty;
				image.Width  = json.ContainsName("width" ) ? json.GetValue<int   >("width" ) : 0;
				image.Height = json.ContainsName("height") ? json.GetValue<int   >("height") : 0;
			}
			return image;
		}