/// <summary> /// Initializes a new instance of the <see cref="TreeNode"/> class with the orphan this node encapsulates and the parent to use for this node. /// </summary> /// <param name="orphan">The orphan this node encapsulates.</param> /// <param name="parent">The parent of this node.</param> internal TreeNode(TreeOrphan orphan, TreeNode parent) { if (orphan == null) { throw new ArgumentNullException(nameof(orphan)); } Orphan = orphan; Parent = parent; //Set the generation of this node; used to identify when a node has been reconstructed due to changes in its tree Generation = orphan.Generation; }
/// <summary> /// Initializes a new instance of the <see cref="TreeNode{TTreeNode}"/> class with the orphan this node encapsulates and the parent to use for this node. /// </summary> /// <param name="orphan">The orphan this node encapsulates.</param> /// <param name="parent">The parent of this node.</param> internal TreeNode(TreeOrphan orphan, TreeNode <TTreeNode> parent) : base(orphan, parent) { //Extract the children from our orphan counterpart. //Since we need a reference to "this", we have to do this in our constructor, not in a static //method to our base constructor var orphanList = ((IOrphanListProvider)orphan.Children).GetOrphanList(); var nodeList = orphanList.ToNode <NodeList>(this); var list = new NodeList <TTreeNode>(nodeList); #pragma warning disable 618 SetChildren(list); #pragma warning restore 618 }
internal override CompareNode CreateIndexerGrouping(TreeOrphan orphanGrouping) => new CompareNodeGrouping((CompareOrphanGrouping)orphanGrouping, this);
/// <summary> /// Creates a grouping of multiple matches that should be returned from this node's indexer. /// </summary> /// <param name="orphanGrouping">The orphan grouping that should be encapsulated in a node.</param> /// <returns></returns> internal abstract TTreeNode CreateIndexerGrouping(TreeOrphan orphanGrouping);
internal override PrtgNode CreateIndexerGrouping(TreeOrphan orphanGrouping) => new PrtgNodeGrouping((PrtgOrphanGrouping)orphanGrouping, this);