public override void GetData (object data) { var fwcoreDic = data as Dictionary<string, object>; var location = fwcoreDic ["location"] as Dictionary<string, object>; this.Location = new Location (location); this.Category = (string)fwcoreDic ["category"]; this.Name = ((Dictionary<string, object>)fwcoreDic ["name"]) [string.Empty] as string; if (fwcoreDic.ContainsKey("description")) { var descDic = (Dictionary<string, object>)fwcoreDic ["description"]; if (descDic.ContainsKey(string.Empty)) this.Description = descDic [string.Empty] as string; } if (fwcoreDic.ContainsKey ("source")) { var source = fwcoreDic ["source"] as Dictionary<string, object>; this.Source = new Source (source); } if (fwcoreDic.ContainsKey ("last_update")) { this.LastUpdate = new LastUpdate (fwcoreDic ["last_update"]); } }
public override void GetData (object data) { var fwcoreDic = data as Dictionary<string, object>; this.Type = (string)fwcoreDic ["type"]; this.Schedule = fwcoreDic["schedule"] as List<object>; if (fwcoreDic.ContainsKey ("last_update")) this.LastUpdate = new LastUpdate ((Dictionary<string, object>)fwcoreDic ["last_update"]); }
public void TestLastUpdate () { var lastupdate = new LastUpdate (); lastupdate.TimeStamp = 1234; lastupdate.Responsible = "x"; string lastUpdateJson = @"{""timestamp"":1234,""responsible"":""x""}"; var lastupdateObject = MiniJSON.Json.Deserialize (lastUpdateJson); var lastupdateDeserialized = new LastUpdate (lastupdateObject); Assert.AreEqual (lastupdateDeserialized, lastupdate); var lastupdateMarshalled = lastupdate.ToDictionary (); var lastupdateJsonSerialized = MiniJSON.Json.Serialize (lastupdateMarshalled); Assert.AreEqual (lastUpdateJson, lastupdateJsonSerialized); }
public FwTime () { this.LastUpdate = new LastUpdate(); this.Schedule = new List<object>(); }