public PacketElement CreateElement() { PacketElement node = new PacketElement(this); _nodes.Add(node); return(node); }
private PacketNode FindChildNode(PacketElement element, string name, Type type, NodeValueType valueType) { var children = _cur.children; return(children.Find((c) => { return c.context.name == name && c.context.type == Framework.Assembly.GetTypeName(type) && c.context.valueType == valueType; })); }
public void BeginComplexType(string name, Type type, Type realtype, Guid guid) { var element = _doc.CreateElement(); _cur.Append(element); element.context.name = name; element.context.type = Framework.Assembly.GetTypeName(type); element.context.realType = Framework.Assembly.GetTypeName(realtype); element.context.valueType = NodeValueType.ComplexType; element.context.guid = guid; _cur = element; }
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; }
internal List <PacketNode> GetChildren(PacketElement ele_node) { return(_nodes.FindAll((node) => { return node.parent == ele_node; })); }
public DataWriter() { _doc = new PacketDocument(); _cur = _doc; refContext = new RefrenceCollection(); }
public void EndComplexType() { _cur = _cur.parent as PacketElement; }