コード例 #1
0
        private static RawMemberNode ToRawNode(XElement ele)
        {
            if (ele == null)
            {
                return(null);
            }

            var node = new RawMemberNode();

            if (ele.HasAttributes)
            {
                node.Attributes = ele.Attributes().ToDictionary(att => att.Name.LocalName, att => att.Value);
            }
            if (ele.HasElements)
            {
                node.ChildNodes = ele.Elements().Select(child => ToRawNode(child));
            }
            else
            {
                node.Value = ele.Value;
            }
            node.TagName = ele.Name.LocalName;
            return(node);
        }
コード例 #2
0
        public static GeneralRawMemberNode Init(RawMemberNode node)
        {
            var model = new GeneralRawMemberNode(node);

            return(node.ToModel <GeneralRawMemberNode>(model));
        }
コード例 #3
0
 private GeneralRawMemberNode(RawMemberNode node)
 {
     this.node = node;
 }