示例#1
0
        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);
            }
        }
示例#2
0
 public void MoveToFront(CCBColumn DO)
 {
     m_bFireEvents = false;
     Remove(DO);
     Insert(DO, 0);
     m_bFireEvents = true;
 }
示例#3
0
        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++;
        }
示例#4
0
 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;
     }
 }
示例#5
0
 public bool Contains(CCBColumn DO)
 {
     for (int index = 0; index < Count; index++)
     {
         if (m_DOA[index].Name == DO.Name)
         {
             return(true);
         }
     }
     return(false);
 }
示例#6
0
        public bool AddNoDuplicate(CCBColumn DO)
        {
            bool bRHS = true;

            if (Contains(DO))
            {
                Remove(DO);
                bRHS = false;
            }
            Add(DO);
            return(bRHS);
        }
示例#7
0
 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 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++;
		}
		public bool AddNoDuplicate(CCBColumn DO)
		{
			bool bRHS = true;
			if(Contains(DO))
			{
				Remove(DO);
				bRHS = false;
			}
			Add(DO);
			return bRHS;
		}
示例#10
0
		public bool Contains(CCBColumn DO)
		{
			for(int index = 0; index < Count; index++)
			{
				if(m_DOA[index].Name == DO.Name)
					return true;
			}
			return false;
		}
示例#11
0
		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);
			}
		}
示例#12
0
		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;
			}
		}
示例#13
0
		public CCBColumnCollectionEventArgs(int count, CCBColumn dO)
		{
			Count = count;
			DO = dO;
		}
示例#14
0
 public CCBColumnCollectionEventArgs(int count, CCBColumn dO)
 {
     Count = count;
     DO    = dO;
 }
示例#15
0
		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);
			}
		}
示例#16
0
		public CCBColumnEventArgs(CCBColumn col)
		{
			Column = col;
		}
示例#17
0
		public void MoveToFront(CCBColumn DO)
		{
			m_bFireEvents = false;
			Remove(DO);
			Insert(DO, 0);
			m_bFireEvents = true;
		}
示例#18
0
 public CCBColumnEventArgs(CCBColumn col)
 {
     Column = col;
 }