Knetik.ItemAsset.Deserialize C# (CSharp) Method

Deserialize() public method

public Deserialize ( KnetikSimpleJSON.KnetikJSONNode json ) : void
json KnetikSimpleJSON.KnetikJSONNode
return void
        public override void Deserialize(KnetikJSONNode json)
        {
            ID = json ["id"].AsInt;
            Description = json ["description"].Value;
            Type = json ["type"].Value;
            Path = json ["path"].Value;
            URL = json ["url"].Value;
        }

Usage Example

Example #1
0
        public override void Deserialize(KnetikJSONNode json)
        {
            base.Deserialize(json);

            Assets = new Dictionary<string, ItemAsset>();
            URLs = new Dictionary<string, string>();

            if (json ["assets"].AsArray != null)
            {
                foreach (KnetikJSONNode node in json["assets"].Children)
                {
                    string slug = node ["slug"].Value;
                    ItemAsset asset = new ItemAsset(Client);
                    asset.Deserialize(node ["asset"]);
                    Assets.Add(slug, asset);
                    URLs.Add(slug, asset.URL);
                }
            } else if (json ["urls"].AsArray != null)
            {
                foreach (KnetikJSONNode node in json["urls"].Children)
                {
                    URLs.Add(node["name"].Value, node["url"].Value);
                }
            }
        }
All Usage Examples Of Knetik.ItemAsset::Deserialize