示例#1
0
        private static List <TreeNode> RfnPrepareChildNodes(STreeNode str)
        {
            List <TreeNode> retTreeNode = new List <TreeNode>();
            TreeNode        tnc;

            foreach (STreeNode strc in str.Nodes)
            {
                tnc = RfnPrepareTreeNode(strc);
                retTreeNode.Add(tnc);
            }
            return(retTreeNode);
        }
示例#2
0
 /// <summary>
 /// This functions returns the treeView for which it has been written
 /// </summary>
 /// <returns></returns>
 public static TreeNode fnPrepareToRead(STreeNode sTreeNode)
 {
     try
     {
         TreeNode FinalTreeNode = RfnPrepareTreeNode(sTreeNode);
         return(FinalTreeNode);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
示例#3
0
 /// <summary>
 /// This function prepares an StreeNode Similar to the TreeNode
 /// </summary>
 public static STreeNode fnPrepareToWrite(TreeNode treeNode)
 {
     try
     {
         TreeNode treeNode_t = new TreeNode();
         foreach (TreeNode tr in treeNode.Nodes)
         {
             treeNode_t.Nodes.Add((TreeNode)tr.Clone());
         }
         STreeNode FinalStr = fnPrepareTreeNode(treeNode_t);
         return(FinalStr);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
示例#4
0
        private static TreeNode RfnPrepareTreeNode(STreeNode str)
        {
            TreeNode trnRet = new TreeNode();

            trnRet.Name               = str.Name;
            trnRet.Tag                = str.Tag;
            trnRet.ToolTipText        = str.ToolTipText;
            trnRet.ImageIndex         = str.ImageIndex;
            trnRet.Text               = str.Text;
            trnRet.SelectedImageIndex = str.SelectedImageIndex;
            #region Building NodeCollection
            List <TreeNode> retTempTreeNodeList = RfnPrepareChildNodes(str);
            foreach (TreeNode tempTr in retTempTreeNodeList)
            {
                trnRet.Nodes.Add(tempTr);
            }
            #endregion
            return(trnRet);
        }
示例#5
0
        /// <summary>
        /// One of the two recursives
        /// </summary>
        /// <param name="tr"></param>
        /// <returns></returns>
        private static STreeNode fnPrepareTreeNode(TreeNode tr)
        {
            STreeNode strRet = new STreeNode();

            strRet.Name        = tr.Name;
            strRet.ToolTipText = tr.ToolTipText;
            strRet.ImageIndex  = tr.ImageIndex;
            if (tr.Tag != null)
            {
                strRet.Tag = tr.Tag.ToString();
            }
            else
            {
                strRet.Tag = null;
            }
            strRet.Text = tr.Text.ToString();
            strRet.SelectedImageIndex = tr.SelectedImageIndex;
            strRet.Nodes = fnPrepareChildNode(tr);
            return(strRet);
        }