public static FuncRefInfo FromXML(XmlElement elem, ScriptInfo si) { string sfDefinitionPath = elem.GetAttribute("sfPath"); string name = elem.GetAttribute("name"); int charIndex = Int32.Parse(elem.GetAttribute("charIndex")); int charLength = Int32.Parse(elem.GetAttribute("charLength")); string codePart = elem.GetAttribute("codePart"); bool isCall = Boolean.Parse(elem.GetAttribute("isCall")); ScriptFile sfDefinition = si.SF.Manager.GetSF(sfDefinitionPath); if (sfDefinition == null) { si.SF.Manager.Trace.TraceEvent(TraceEventType.Warning, 0, "Could not find SF '{0}', reference '{1}' in '{2}' at '{3}'", sfDefinitionPath, name, si.SF.SFPath, charIndex); return(null); } FuncRefInfo funcRef = new FuncRefInfo(si.SF, sfDefinition, name, charIndex, charLength, codePart, isCall); if (isCall) { foreach (XmlNode node in elem.ChildNodes) { if (node is XmlElement && node.Name == "funcRefArg") { funcRef.AddArgument(FuncRefArgInfo.FromXML((XmlElement)node, si)); } } } return(funcRef); }
public void AddArgument(FuncRefArgInfo arg) { if (Arguments == null) { throw new InvalidOperationException("isCall"); } Arguments.Add(arg); }