コード例 #1
0
 /// <summary>
 /// Tertiary constructor used for twin/duplicate XML Definitions within a file.
 /// </summary>
 /// <param name="xmlElement">The differing XML Element for this twin.</param>
 /// <param name="parentTree">he parent XML tree.</param>
 /// <param name="twinTree">The original XML tree.</param>
 private XmlCookedTree(XmlCookedElement xmlElement, XmlCookedTree parentTree, XmlCookedTree twinTree)
 {
     _element   = xmlElement;
     Parent     = parentTree;
     Definition = twinTree.Definition;
     _twinTree  = twinTree;
 }
コード例 #2
0
ファイル: XmlCookedTree.cs プロジェクト: khadoran/reanimator
 /// <summary>
 /// Tertiary constructor used for twin/duplicate XML Definitions within a file.
 /// </summary>
 /// <param name="xmlElement">The differing XML Element for this twin.</param>
 /// <param name="parentTree">he parent XML tree.</param>
 /// <param name="twinTree">The original XML tree.</param>
 private XmlCookedTree(XmlCookedElement xmlElement, XmlCookedTree parentTree, XmlCookedTree twinTree)
 {
     _element = xmlElement;
     Parent = parentTree;
     Definition = twinTree.Definition;
     _twinTree = twinTree;
 }
コード例 #3
0
 /// <summary>
 /// Secondary constructor used for child node types.
 /// </summary>
 /// <param name="xmlDefinition">The child tree XML Definition.</param>
 /// <param name="xmlElement">The XML Element type (should be of .ElementType = Table or TableCount).</param>
 /// <param name="parentTree">The parent XML tree.</param>
 /// <param name="elementCount">Count of elements in this definition in this XML File.</param>
 public XmlCookedTree(XmlCookedDefinition xmlDefinition, XmlCookedElement xmlElement, XmlCookedTree parentTree, int elementCount)
 {
     Definition = xmlDefinition;
     _element   = xmlElement;
     Parent     = parentTree;
     Count      = elementCount;
     _elements  = new Dictionary <uint, Branch>();
 }
コード例 #4
0
ファイル: XmlCookedTree.cs プロジェクト: khadoran/reanimator
 /// <summary>
 /// Secondary constructor used for child node types.
 /// </summary>
 /// <param name="xmlDefinition">The child tree XML Definition.</param>
 /// <param name="xmlElement">The XML Element type (should be of .ElementType = Table or TableCount).</param>
 /// <param name="parentTree">The parent XML tree.</param>
 /// <param name="elementCount">Count of elements in this definition in this XML File.</param>
 public XmlCookedTree(XmlCookedDefinition xmlDefinition, XmlCookedElement xmlElement, XmlCookedTree parentTree, int elementCount)
 {
     Definition = xmlDefinition;
     _element = xmlElement;
     Parent = parentTree;
     Count = elementCount;
     _elements = new Dictionary<uint, Branch>();
 }
コード例 #5
0
        /// <summary>
        /// Replaces last added element with tree. Automatically links the XML Element to tree.
        /// </summary>
        /// <param name="definitionHash">The element name hash of the existing tree.</param>
        public void AddExistingTree(UInt32 definitionHash)
        {
            XmlCookedTree tree = _GetExistingTree(Root, definitionHash);

            Debug.Assert(tree != null, "AddExistingTree: tree not found!");
            tree = tree.TwinRoot;
            Debug.Assert(tree != null, "AddExistingTree: tree not found!");

            XmlCookedElement xmlElement = _elements.Last().Value.Element;
            XmlCookedTree    newTree    = new XmlCookedTree(xmlElement, this, tree);

            AddTree(newTree);
        }
コード例 #6
0
 /// <summary>
 /// Add an element to the tree.
 /// </summary>
 /// <param name="xmlElement">The XML Element to add to the tree.</param>
 public void AddElement(XmlCookedElement xmlElement)
 {
     _elements.Add(xmlElement.NameHash, new Branch(xmlElement));
 }
コード例 #7
0
 public Branch(XmlCookedElement element, XmlCookedTree tree = null)
 {
     Element = element;
     Tree    = tree;
 }
コード例 #8
0
ファイル: XmlCookedTree.cs プロジェクト: khadoran/reanimator
 public Branch(XmlCookedElement element, XmlCookedTree tree=null)
 {
     Element = element;
     Tree = tree;
 }
コード例 #9
0
ファイル: XmlCookedTree.cs プロジェクト: khadoran/reanimator
 /// <summary>
 /// Add an element to the tree.
 /// </summary>
 /// <param name="xmlElement">The XML Element to add to the tree.</param>
 public void AddElement(XmlCookedElement xmlElement)
 {
     _elements.Add(xmlElement.NameHash, new Branch(xmlElement));
 }