void Loaded(PageResult res, string origUrl) { OrigUrl = origUrl; setResult(res); AssignOwners(this, null); if (myResult.Version == Guid.Empty) myResult.Version = Version; //prvni sparovani cviceni s vysledkem else if (myResult.Version != Version) myResult.Reset(); //nesouhlasi verze AssignUniqueIds(); }
public static CoursePage CreatePage(Stream str, string origUrl, PageResult result) { return CreatePage(() => Exercise.FromStream(str), origUrl, result); }
public static CoursePage CreatePage(byte[] data, string origUrl, PageResult result, string nameSpace) { return CreatePage(() => { string str = Encoding.UTF8.GetString(data, 0, data.Length); return XmlUtils.StringToObject <Exercise>(str); }, origUrl, result); }
//DB LAYER public static CoursePage CreatePage(Func<Exercise> read, string origUrl, PageResult result) { Exercise ex = read(); if (ex is IExpandable) ex = expandHelper(ex); if (!(ex is CoursePage)) throw new Exception(); CoursePage res = (CoursePage)ex; res.Loaded(result, origUrl); return res; }