Пример #1
0
        /// <summary>
        /// Insert the specified cell
        /// </summary>
        private void InsertCell(int row, int col, ICell p_cell)
        {
            RemoveCell(row, col);

            if (p_cell != null && p_cell.Grid != null)
            {
                throw new ArgumentException("This cell already have a linked grid", "p_cell");
            }

            if (p_cell != null)
            {
                EnsureDestinationSpannedAreaisCompletelyEmpty(row, col, p_cell.RowSpan, p_cell.ColumnSpan);
            }

            if (p_cell != null)
            {
                p_cell.BindToGrid(this, new Position(row, col));
            }

            if ((p_cell != null) && ((p_cell.RowSpan > 1) || (p_cell.ColumnSpan > 1)))
            {
                // occupy space if it is spanned cell
                OccupySpannedArea(row, col, p_cell);
            }

            DirectSetCell(new Position(row, col), p_cell);
        }
Пример #2
0
        /// <summary>
        /// Insert the specified cell.
        /// </summary>
        /// <param name="row">The row.</param>
        /// <param name="col">The column.</param>
        /// <param name="p_cell">The p_cell.</param>
        /// <remarks>
        /// For good performance set Redraw property to false.
        /// </remarks>
        public virtual void InsertCell(int row, int col, ICell p_cell)
        {
            RemoveCell(row, col);
            this.cells[row, col] = p_cell;

            if (p_cell != null)
            {
                p_cell.BindToGrid(this, new Position(row, col));

                if (Redraw)
                {
                    p_cell.Invalidate();
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Insert the specified cell (for best performance set Redraw property to false)
        /// </summary>
        /// <param name="row"></param>
        /// <param name="col"></param>
        /// <param name="p_cell"></param>
        public virtual void InsertCell(int row, int col, ICell p_cell)
        {
            RemoveCell(row, col);
            m_Cells[row, col] = p_cell;

            if (p_cell != null)
            {
                if (p_cell.Grid != null)
                {
                    throw new ArgumentException("This cell already have a linked grid", "p_cell");
                }

                p_cell.BindToGrid(this, new Position(row, col));

                if (Redraw)
                {
                    p_cell.Invalidate();
                }
            }
        }
Пример #4
0
		/// <summary>
		/// Insert the specified cell
		/// </summary>
		private void InsertCell(int row, int col, ICell p_cell)
		{
			RemoveCell(row, col);

			if (p_cell != null && p_cell.Grid != null)
				throw new ArgumentException("This cell already have a linked grid", "p_cell");

			if (p_cell != null)
				EnsureDestinationSpannedAreaisCompletelyEmpty(row, col, p_cell.RowSpan, p_cell.ColumnSpan);
			
			if (p_cell != null)
			{
				p_cell.BindToGrid(this,new Position(row, col));
			}
			
			if ((p_cell != null) && ((p_cell.RowSpan > 1) || (p_cell.ColumnSpan > 1)))
			{
				// occupy space if it is spanned cell
				OccupySpannedArea(row, col, p_cell);
			}
			
			DirectSetCell(new Position(row, col), p_cell);
		}
Пример #5
0
        /// <summary>
        /// Insert the specified cell.
        /// </summary>
        /// <param name="row">The row.</param>
        /// <param name="col">The column.</param>
        /// <param name="p_cell">The p_cell.</param>
        /// <remarks>
        /// For good performance set Redraw property to false.
        /// </remarks>
        public virtual void InsertCell(int row, int col, ICell p_cell)
        {
            RemoveCell(row, col);
              this.cells[row, col] = p_cell;

              if (p_cell != null)
              {
            p_cell.BindToGrid(this, new Position(row, col));

            if (Redraw)
            {
              p_cell.Invalidate();
            }
              }
        }