Example #1
0
 internal PacketNode(PacketDocument doc)
 {
     if (this is PacketDocument)
     {
         this.doc = this as PacketDocument;
     }
     else
     {
         this.doc = doc;
     }
     _packet                = new Packet();
     _context               = new PackectContext(this);
     this.nodeType          = NodeType.Node;
     this.context.valueType = NodeValueType.None;
 }
Example #2
0
        public void BeginComplexType(string name, Type type, out PackectContext context)
        {
            var child = FindChildNode(_cur, name, type, NodeValueType.ComplexType);

            if (child == null)
            {
                throw new Exception(string.Format("The Node Can't Find  Name : {0} ,Type : {1}", name, type));
            }
            if (child.nodeType == NodeType.Element)
            {
                _cur = child as PacketElement;
            }
            else
            {
                throw new Exception("The Child is Not Element Node");
            }
            context = _cur.context;
        }