Exemplo n.º 1
0
        private void WriteNodeV2(Node node)
        {
            var nodeInfo = new NodeEntryV2();

            if (node.Parent == null)
            {
                nodeInfo.ParentIndex = -1;
            }
            else
            {
                nodeInfo.ParentIndex = NodeIndices[node.Parent];
            }

            nodeInfo.NameHashTableIndex = AddStaticString(node.Name);

            if (node.Attributes.Count > 0)
            {
                nodeInfo.FirstAttributeIndex = NextAttributeIndex;
                WriteNodeAttributes(node);
            }
            else
            {
                nodeInfo.FirstAttributeIndex = -1;
            }

            BinUtils.WriteStruct <NodeEntryV2>(NodeWriter, ref nodeInfo);
            NodeIndices[node] = NextNodeIndex;
            NextNodeIndex++;

            WriteNodeChildren(node);
        }
Exemplo n.º 2
0
        private void WriteNodeV2(Node node)
        {
            var nodeInfo = new NodeEntryV2();
            if (node.Parent == null)
            {
                nodeInfo.ParentIndex = -1;
            }
            else
            {
                nodeInfo.ParentIndex = NodeIndices[node.Parent];
            }

            nodeInfo.NameHashTableIndex = AddStaticString(node.Name);

            if (node.Attributes.Count > 0)
            {
                nodeInfo.FirstAttributeIndex = NextAttributeIndex;
                WriteNodeAttributesV2(node);
            }
            else
            {
                nodeInfo.FirstAttributeIndex = -1;
            }

            BinUtils.WriteStruct<NodeEntryV2>(NodeWriter, ref nodeInfo);
            NodeIndices[node] = NextNodeIndex;
            NextNodeIndex++;

            WriteNodeChildren(node);
        }