Exemple #1
0
        /// <summary>
        /// Add a cell to the collection of highlighted cells.
        /// </summary>
        /// <param name="Cell">The base cell</param>
        /// <returns>The highlighted cell</returns>
        private BaseHighLightCell AddHighLightCell(Interop.IHTMLTableCell Cell)
        {
            BaseHighLightCell hCell = m_HighLightCellFactory.CreateHighLightCell(Cell);

            if (!m_Cells.Contains(hCell))
            {
                System.Diagnostics.Debug.WriteLine("AddHighLightCell", Cell.GetHashCode().ToString());
                hCell.MakeHighLight();
                m_Cells.Add(hCell);
            }
            return(hCell);
        }
        /// <summary>
        /// Return all cells from a specified row.
        /// </summary>
        /// <param name="row"></param>
        /// <returns></returns>
        internal BaseHighLightCell[] GetColCollection(int row)
        {
            ArrayList   eColsAl = new ArrayList();
            IEnumerator eCells  = base.GetEnumerator();

            while (eCells.MoveNext())
            {
                if (((BaseHighLightCell)eCells.Current).Row == row)
                {
                    eColsAl.Add(eCells.Current);
                }
            }
            BaseHighLightCell[] eCols = new BaseHighLightCell[eColsAl.Count];
            eColsAl.CopyTo(eCols);
            return(eCols);
        }
        /// <summary>
        /// Return all cells form a specified column.
        /// </summary>
        /// <param name="col"></param>
        /// <returns></returns>
        internal BaseHighLightCell[] GetRowCollection(int col)
        {
            ArrayList   eRowsAl = new ArrayList();
            IEnumerator eCells  = base.GetEnumerator();

            while (eCells.MoveNext())
            {
                if (((BaseHighLightCell)eCells.Current).Col == col)
                {
                    eRowsAl.Add(eCells.Current);
                }
            }
            BaseHighLightCell[] eRows = new BaseHighLightCell[eRowsAl.Count];
            eRowsAl.CopyTo(eRows);
            return(eRows);
        }
 /// <summary>
 /// Returns the cell at the specified position or null if no cell found.
 /// This indexer is read only.
 /// </summary>
 internal BaseHighLightCell this[int row, int col]
 {
     get
     {
         IEnumerator eCells = base.GetEnumerator();
         while (eCells.MoveNext())
         {
             BaseHighLightCell cell = (BaseHighLightCell)eCells.Current;
             if (cell.Col == col && cell.Row == row)
             {
                 return((BaseHighLightCell)eCells.Current);
             }
         }
         return(null);
     }
 }
Exemple #5
0
        public int Compare(object x, object y)
        {
            BaseHighLightCell c1 = (BaseHighLightCell)x;
            BaseHighLightCell c2 = (BaseHighLightCell)y;

            if (c1.Row < c2.Row)
            {
                return(-1);
            }
            if (c1.Row > c2.Row)
            {
                return(1);
            }
            if (c1.Col < c2.Col)
            {
                return(-1);
            }
            if (c1.Col > c2.Col)
            {
                return(1);
            }
            return(0);
        }