public static XmlLog getOrCreateXmlLog(String varName) { if (LogProcessor.variables.ContainsKey(varName)) { LogProcessor.variables.TryGetValue(varName, out LogVar logVar); if (logVar.GetType().IsInstanceOfType(new XmlLog())) { XmlLog xmlLog = ((XmlLog)logVar); xmlLog.varName = varName; return((XmlLog)logVar); } else { XmlLog xmlLog = new XmlLog(); xmlLog.varName = varName; LogProcessor.variables.Add(varName, xmlLog); } return(null); } else { XmlLog xmlLog = new XmlLog(); xmlLog.varName = varName; LogProcessor.variables.Add(varName, xmlLog); return(xmlLog); } }
public static XmlLog getOrCreateXmlLog(string varName, XmlDocument doc) { XmlLog xmlLog = getOrCreateXmlLog(varName); xmlLog.xmlDocument = doc; return(xmlLog); }
//TODO add min length check? public override string calculate(string input) { String rtrn = ""; XmlLog xmlLog = getOrCreateXmlLog(varName); rtrn = xmlLog.xmlDocument.FirstChild.Name; return(rtrn); }