public string FetchValueFromNodeForChild(EngineNodeHolder node, XElement childNode) { switch (node.engineNodeOptions) { case EngineNodeOptions.CallbackValue: return(FetchValueForCallbackValue(node.Value)); default: return(FetchValueForOtherOptions(node, childNode.ConvertToString())); } }
public string FetchValueFromNodeForParent(EngineNodeHolder node) { switch (node.engineNodeOptions) { case EngineNodeOptions.CallbackValue: return(FetchValueForCallbackValue(node.Value)); default: return(FetchValueForOtherOptions(node)); } }
private string FetchValueForOtherOptions(EngineNodeHolder node, string nodeString = null) { using (StringReader s = new StringReader(nodeString ?? xmlString)) { XDocument xdoc = XDocument.Load(s); var desc = xdoc.Descendants(node.EngineNode).ToHashSet(); var nodes = desc.Select(x => x.Value); switch (node.engineNodeOptions) { case EngineNodeOptions.Date: return(FetchValueForDate(node.EngineNode, ref nodes)); case EngineNodeOptions.EngineNode: return(FetchValueForEngineNode(ref nodes)); case EngineNodeOptions.LinePosition: return(FetchValueForLinePosition(node.Value, ref nodes)); case EngineNodeOptions.NodeCount: return(FetchValueForNodeCount(ref nodes)); case EngineNodeOptions.NodePosition: return(FetchValueForNodePosition(node.Value, ref nodes)); default: return(String.Empty); } } }