private void CreateTestWorkTree()
        {
            workTree = new Tree();
            // First branch
            TreeNode rootNode_1 = new TreeNode(workTree, null);
            workTree.RootNodes.Add(rootNode_1);
            TreeNode childNode_1_1 = new TreeNode(workTree, rootNode_1);
            TreeNode childNode_1_2 = new TreeNode(workTree, rootNode_1);
            rootNode_1.ChildNodes.Add(childNode_1_1);
            rootNode_1.ChildNodes.Add(childNode_1_2);

            // Second branch
            TreeNode rootNode_2 = new TreeNode(workTree, null);
            workTree.RootNodes.Add(rootNode_2);
            TreeNode childNode_2_1 = new TreeNode(workTree, rootNode_2);
            TreeNode childNode_2_2 = new TreeNode(workTree, rootNode_2);
            rootNode_2.ChildNodes.Add(childNode_2_1);
            rootNode_2.ChildNodes.Add(childNode_2_2);

            // Third branch
            TreeNode rootNode_3 = new TreeNode(workTree, null);
            workTree.RootNodes.Add(rootNode_3);
            TreeNode childNode_3_1 = new TreeNode(workTree, rootNode_3);
            TreeNode childNode_3_2 = new TreeNode(workTree, rootNode_3);
            rootNode_3.ChildNodes.Add(childNode_3_1);
            rootNode_3.ChildNodes.Add(childNode_3_2);
        }
 public TreeNode(Tree ownerTree, TreeNode ownerNode, int nodeCode, string nodeHeader)
     : this(ownerTree, ownerNode)
 {
     header = nodeHeader;
     internalCode = nodeCode;
     SetGlobalNodeCode();
 }
 public TestTreeService()
 {
     tree = new Tree();
     /// For testing we are creating a static tree in memory (workTree)
     /// but return it dynamic by queries
     /// In a work realization this queries will be redirect to DataStore
     CreateTestWorkTree();
 }
 /// <summary>
 /// .ctor
 /// </summary>
 /// <param name="ownerTree">owner tree object</param>
 /// <param name="ownerNode">ownre node object</param>
 public TreeNode(Tree ownerTree, TreeNode ownerNode)
 {
     this.ownerTree = ownerTree;
     this.ownerNode = ownerNode;
     childNodes = new TreeNodeCollection();
     internalCode = GetDefaultNodeCode();
     SetGlobalNodeCode();
     header = String.Format("Node #{0}", internalCode);
 }
 public TreeNode(Tree ownerTree, TreeNode ownerNode, string nodeHeader)
     : this(ownerTree, ownerNode)
 {
     header = nodeHeader;
 }