Deserialize() public method

Converts the provided dictionary into an object of the specified type.
dictionary
public Deserialize ( object>.IDictionary dictionary ) : GameInfo
dictionary object>.IDictionary An instance of property data stored as name/value pairs.
return GameInfo
Ejemplo n.º 1
0
 /// <summary>
 /// Parses the specified json.
 /// </summary>
 /// <param name="json">The json.</param>
 /// <returns>A game info object</returns>
 /// <example>
 /// <code language="C#">
 /// string json = @"
 /// {
 ///    ""Game"": ""Ages"",
 ///    ""GameID"": 14129,
 ///    ""Hero"": ""Link"",
 ///    ""Child"": ""Pip"",
 ///    ""Animal"": ""Dimitri"",
 ///    ""Behavior"": ""BouncyD"",
 ///    ""IsLinkedGame"": true,
 ///    ""IsHeroQuest"": false,
 ///    ""Rings"": -9222246136947933182
 /// }";
 /// GameInfo info = GameInfo.Parse(json);
 /// </code>
 /// </example>
 public static GameInfo Parse(string json)
 {
     var dict = (IDictionary<string, object>)SimpleJson.SimpleJson.DeserializeObject(json);
     var converter = new GameInfoJsonConverter();
     return converter.Deserialize(dict);
 }