this.tlMatrixCategories.AfterCheckNode += new DevExpress.XtraTreeList.NodeEventHandler(this.tlMatrixCategories_AfterCheckNode);

private void treeList_AfterCheckNode( object sender, NodeEventArgs e )
        {
            if( e.Node.CheckState == CheckState.Indeterminate )
                e.Node.CheckState = CheckState.Checked;
            treeList.BeginUpdate();
            try
            {
                SetCheckedChildNodes( e.Node, e.Node.CheckState );
                if( e.Node.ParentNode != null )
                    SetCheckedParentNodes( e.Node.ParentNode, e.Node.CheckState );
            }
            finally
            {
                treeList.EndUpdate();
            }
        }
        private void SetCheckedChildNodes( TreeListNode node, CheckState checkState )
        {
            for( int i = 0; i < node.Nodes.Count; i++ )
            {
                node.Nodes[ i ].CheckState = checkState;
                SetCheckedChildNodes( node.Nodes[ i ], checkState );
            }
        }
        private void SetCheckedParentNodes( TreeListNode node, CheckState checkState )
        {
            bool b = false;
            for( int i = 0; i < node.Nodes.Count; i++ )
            {
                if( !checkState.Equals( node.Nodes[ i ].CheckState ) )
                {
                    b = !b;
                    break;
                }
            }
            node.CheckState = b ? CheckState.Indeterminate : checkState;
            if( node.ParentNode != null )
                SetCheckedParentNodes( node.ParentNode, checkState );
        }
CTS(Common Type System)
닷넷 프레임워크는 여러 다른 언어가 동일한 데이터형을 사용하도록 공통언어를 사용하고 있다. 



값형은 데이터를 메모리의 스택영역에 저장(값) - 변수 복하면 새로운 영역으로 저장됨
int, float, struct, enum 등
참조형은 데이터를 힙영역에 저장(주소저장)
class, interface, delegate

+ Recent posts