public RuntimeVariables() { string filename = "settings.xml"; persistence = new XMLPersistenceDictionary(logger, filename, false); if (!System.IO.File.Exists(filename)) { persistence.save(); } }
public SteamToys(OnyLib.BotStuff _bstuff) { BotStuff = _bstuff; persistence = BotStuff.OnyVariables.persistence; }
public Toys(OnyLib.BotStuff _bstuff) { BotStuff = _bstuff; persistence = BotStuff.OnyVariables.persistence; logger = BotStuff.OnyVariables.logger; }
savenode[] SearchNodesByObject(string Obj, XMLPersistenceDictionary dict, bool recursive) { List<savenode> returnnodes = new List<savenode>(); foreach (var item in dict) { if (item.obj.ToLower().Contains(Obj.ToLower())) { returnnodes.Add(item); if (!checkedlistnodelinks.ContainsKey(item.ToString())) checkedlistnodelinks.Add(item.ToString(), item); } if (recursive) returnnodes.AddRange(SearchNodesByObject(Obj, item.childnodes, true)); } return returnnodes.ToArray(); }
XMLPersistenceDictionary readOnymityXML() { OpenFileDialog ofd = new OpenFileDialog(); ofd.CheckFileExists = true; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { OnymityDatasaving.OnymityDatasaving onymityxml = new OnymityDatasaving.OnymityDatasaving(); try { onymityxml.load(ofd.FileName); } catch (Exception ex) { MessageBox.Show("Failed to read the XML!\n" + ex.Message); cedlibxml = null; return null; } XMLPersistenceDictionary dict = new XMLPersistenceDictionary("cedlibxml.xml", false); foreach (var item in onymityxml.xmldict.innerdict) { savenode cursnode = new savenode(item.name, item.obj); cedlibxml.Add(cursnode); fillCedLibXMLTree(cursnode, item); } onymityxml = null; return dict; } else return null; }
private void openCedLibXMLToolStripMenuItem_Click(object sender, EventArgs e) { groupBox_edit.Enabled = false; cedlibxml = readCedLibXML(); if (cedlibxml == null) return; CreateTreeview(); }
void Mergedicts(XMLPersistenceDictionary foreigndict, XMLPersistenceDictionary curdict) { foreach (var item in foreigndict) { curdict.Add(item); Mergedicts(item.childnodes, curdict[item.name].childnodes); } }
void deletenode(XMLPersistenceDictionary dict, savenode node) { foreach (var item in dict) { if (dict.Contains(node)) { dict.Remove(node); return; } deletenode(item.childnodes, node); } }
public RuntimeVariables() { persistence = new XMLPersistenceDictionary(logger, "funcpersistence.xml", false); }
public PriviligedFunctions(OnyLib.BotStuff.RuntimeVariables _runvars) { RunVars = _runvars; logger = RunVars.logger; persistence = RunVars.persistence; }
public RuntimeVariables() { string filename = "settings.xml"; persistence = new XMLPersistenceDictionary(logger, filename, false); if (!System.IO.File.Exists(filename)) persistence.save(); }