Example #1
0
        /// <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;
        }
Example #2
0
        /// <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
        }
Example #3
0
 internal override CompareNode CreateIndexerGrouping(TreeOrphan orphanGrouping) => new CompareNodeGrouping((CompareOrphanGrouping)orphanGrouping, this);
Example #4
0
 /// <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);
Example #5
0
 internal override PrtgNode CreateIndexerGrouping(TreeOrphan orphanGrouping) => new PrtgNodeGrouping((PrtgOrphanGrouping)orphanGrouping, this);