Ejemplo n.º 1
0
 public CTreeNodeWriteable(CTreeNode pNode, ENodeCreate eFlag) : base(pNode, eFlag)
 {
     m_eCommand = EWriteCommand.EWRITE_NOTHING;
 }
Ejemplo n.º 2
0
 public CIntTreeNode(int iVal, CIntTreeNode pNode, ENodeCreate eFlag) : base(pNode, eFlag)
 {
     m_iVal = iVal;
 }
Ejemplo n.º 3
0
 public CStringTreeNode(string sStr, CStringTreeNode pNode, ENodeCreate eFlag) : base(pNode, eFlag)
 {
     m_sStr = sStr;
 }
Ejemplo n.º 4
0
        public CTreeNode(CTreeNode pNode, ENodeCreate eFlag)
        {
            CTreeNode pPrev, pPost;

            m_pChild = null;

            switch (eFlag)
            {
            case ENodeCreate.ENODE_FIRST_CHILD:
                m_pParent = pNode;

                if (pNode.m_pChild != null)
                {
                    pPost = pNode.m_pChild;
                    pPrev = pNode.m_pChild.m_pLeftBrother;
                    pPrev.m_pRightBrother = this;
                    pPost.m_pLeftBrother  = this;
                    m_pRightBrother       = pPost;
                    m_pLeftBrother        = pPrev;
                    pNode.m_pChild        = this;
                }
                else
                {
                    m_pLeftBrother  = this;
                    m_pRightBrother = this;
                    pNode.m_pChild  = this;
                }

                break;

            case ENodeCreate.ENODE_LAST_CHILD:
                m_pParent = pNode;

                if (pNode.m_pChild != null)
                {
                    pPost = pNode.m_pChild;
                    pPrev = pNode.m_pChild.m_pLeftBrother;
                    pPrev.m_pRightBrother = this;
                    pPost.m_pLeftBrother  = this;
                    m_pRightBrother       = pPost;
                    m_pLeftBrother        = pPrev;
                }
                else
                {
                    m_pLeftBrother  = this;
                    m_pRightBrother = this;
                    pNode.m_pChild  = this;
                }

                break;

            case ENodeCreate.ENODE_RIGHT_BROTHER:
                m_pParent       = pNode.m_pParent;
                m_pRightBrother = pNode.m_pRightBrother;
                m_pLeftBrother  = pNode;
                pNode.m_pRightBrother.m_pLeftBrother = this;
                pNode.m_pRightBrother = this;

                break;

            case ENodeCreate.ENODE_LEFT_BROTHER:
                m_pParent       = pNode.m_pParent;
                m_pLeftBrother  = pNode.m_pLeftBrother;
                m_pRightBrother = pNode;
                pNode.m_pLeftBrother.m_pRightBrother = this;
                pNode.m_pLeftBrother = this;

                if (m_pParent != null && m_pParent.m_pChild == pNode)
                {
                    m_pParent.m_pChild = this;
                }

                break;
            }
        }