Exemple #1
0
 public void refreshMeta(XElement root = null) {
   _meta = null;
   if (root != null) _meta = getMeta(root);
 }
Exemple #2
0
 //********** meta informace (obsah <script type="text/meta" tagu v .lmdata souboru)
 public void workerOper(workers w, wOper oper) {
   var lmd = XElement.Load(fileName());
   //adjust script a lmdataMeta
   var script = lmd.Element(html + "head").Elements(html + "script").Where(s => s.AttributeValue("type") == "text/meta").FirstOrDefault();
   lmdataMeta mt = null;
   if (script == null) lmd.Element(html + "head").Add(script = new XElement(html + "script", new XAttribute("type", "text/meta")));
   else mt = LMJson.Decode<lmdataMeta>(script.Value);
   if (mt == null) mt = new lmdataMeta();
   if (mt.history == null) mt.history = new List<lmdataMeta.item>();
   //add to history
   DateTime dt = DateTime.Now;
   mt.history.Add(new lmdataMeta.item { date = LowUtils.dateToNum(dt), oper = oper, worker = w, fileGroup = _actFileGroup });
   //save history
   script.Value = LMJson.Encode(mt, true);
   lmd.Save(fileName());
   refreshMeta(lmd);
 }