/// <summary>Loads the domain data from the given JSON string.</summary> public void LoadFromJson(string data) { if (string.IsNullOrEmpty(data)) { return; } // Load the JSON: JSObject json = JSON.Parse(data); if (json == null) { return; } // Setup content and cookies: JSObject cookies = json["cookies"]; if (cookies != null) { // Setup: Cookies = new CookieJar(this); Cookies.LoadFromJson(cookies); } // Content: JSObject content = json["files"]; if (content != null) { // Setup: Content = new CachedContentSet(this); Content.LoadFromJson(content); } }
public CachedContent(CachedContentSet set, string path) { SavedAt = DateTime.Now; Set = set; Path = path; Changed = true; }
public CachedContent(CachedContentSet set, string path, JSObject obj) { Set = set; Path = path; LoadFromJson(obj); }