public void Remove(CCBColumn DO)
        {
            int index = 0;

            for (; index < m_iCount; index++)
            {
                if (m_DOA[index].Name == DO.Name)
                {
                    break;
                }
            }
            if (index == m_iCount)
            {
                return;
            }
            for (; index < m_iCount - 1; index++)
            {
                m_DOA[index] = m_DOA[index + 1];
            }
            m_iCount--;
            Remove(DO);
            if (RemoveColumnEvent != null && m_bFireEvents)
            {
                CCBColumnCollectionEventArgs args = new CCBColumnCollectionEventArgs(m_iCount, DO);
                RemoveColumnEvent(this, args);
            }
        }
 public void MoveToFront(CCBColumn DO)
 {
     m_bFireEvents = false;
     Remove(DO);
     Insert(DO, 0);
     m_bFireEvents = true;
 }
        public void Insert(CCBColumn DO, int iPos)
        {
            CheckGrow();
            if (iPos < 0)
            {
                Insert(DO, 0);
            }
            if (iPos >= m_iCount && iPos != 0)
            {
                Insert(DO, m_iCount - 1);
            }
            CCBColumn[] doTemp = new CCBColumn[m_iSize];
            int         index  = 0;

            for (; index < iPos; index++)
            {
                doTemp[index] = m_DOA[index];
            }
            doTemp[index] = DO;
            for (; index < m_iCount; index++)
            {
                doTemp[index + 1] = m_DOA[index];
            }
            m_DOA = doTemp;
            m_iCount++;
        }
 private void CheckGrow()
 {
     if (m_iCount >= m_iSize)
     {
         m_iSize *= 2;
         CCBColumn[] doTemp = new CCBColumn[m_iSize];
         m_DOA.CopyTo(doTemp, 0);
         m_DOA = doTemp;
     }
 }
 public bool Contains(CCBColumn DO)
 {
     for (int index = 0; index < Count; index++)
     {
         if (m_DOA[index].Name == DO.Name)
         {
             return(true);
         }
     }
     return(false);
 }
        public bool AddNoDuplicate(CCBColumn DO)
        {
            bool bRHS = true;

            if (Contains(DO))
            {
                Remove(DO);
                bRHS = false;
            }
            Add(DO);
            return(bRHS);
        }
 public void Add(CCBColumn DO)
 {
     if (Contains(DO))
     {
         throw new Exception("Column collection already contains a column named \"" + DO.Name + "\"");
     }
     CheckGrow();
     m_DOA[m_iCount] = DO;
     m_iCount++;
     if (AddColumnEvent != null && m_bFireEvents)
     {
         CCBColumnCollectionEventArgs args = new CCBColumnCollectionEventArgs(m_iCount, DO);
         AddColumnEvent(this, args);
     }
 }
 public CCBColumnCollectionEventArgs(int count, CCBColumn dO)
 {
     Count = count;
     DO    = dO;
 }
 public CCBColumnEventArgs(CCBColumn col)
 {
     Column = col;
 }