示例#1
0
        public string FetchValueFromNodeForChild(EngineNodeHolder node, XElement childNode)
        {
            switch (node.engineNodeOptions)
            {
            case EngineNodeOptions.CallbackValue: return(FetchValueForCallbackValue(node.Value));

            default: return(FetchValueForOtherOptions(node, childNode.ConvertToString()));
            }
        }
示例#2
0
        public string FetchValueFromNodeForParent(EngineNodeHolder node)
        {
            switch (node.engineNodeOptions)
            {
            case EngineNodeOptions.CallbackValue: return(FetchValueForCallbackValue(node.Value));

            default: return(FetchValueForOtherOptions(node));
            }
        }
示例#3
0
        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);
                }
            }
        }