예제 #1
0
        /// <summary>
        /// Creates a new DebugContainerResponseNode.
        /// </summary>
        /// <param name="name">The name of this DebugResponseNode.</param>
        /// <param name="description">The description for this DebugResponseNode.</param>
        /// <param name="getElementFunc">The function to execute whenever the contents of this DebugResponseNode are requested.</param>
        /// <param name="parentNode">The parent node of this node.</param>
        /// <param name="AddToParent">Shall this node be added to it's parent already?</param>
        public DebugContainerResponseNode(string name, string description = null, Func <SessionData, HElement> getElementFunc = null, DebugContainerResponseNode parentNode = null, bool AddToParent = true)
        {
            Name         = name;
            _description = description;
            _subNodes    = new AVLTree <ID, DebugResponseNode>();
            GetElements  = getElementFunc ?? (s => new HText($"No {nameof(GetElements)} function was specified."));

            if (AddToParent)
            {
                if (parentNode == null)
                {
                    DebugResponse.AddNode(this);
                }
                else
                {
                    parentNode.AddNode(this);
                }
            }
        }
예제 #2
0
 /// <summary>
 /// Adds a node to the static DebugNode.
 /// </summary>
 /// <param name="node">The node to add.</param>
 public static void AddNode(DebugResponseNode node)
 {
     _debugNode.AddNode(node);
 }