GetCellsPositions() public method

Returns a Collection of cells that represents the current class
public GetCellsPositions ( ) : PositionCollection
return PositionCollection
Beispiel #1
0
        /// <summary>
        /// Indicates if the specified range of cells is selected
        /// </summary>
        /// <param name="p_Range"></param>
        /// <returns></returns>
        public virtual bool Contains(RangeRegion p_Range)
        {
            if (p_Range.IsEmpty() || IsEmpty())
            {
                return(false);
            }

            PositionCollection positions = p_Range.GetCellsPositions();

            for (int i = 0; i < positions.Count; i++)
            {
                if (Contains(positions[i]) == false)
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #2
0
		/// <summary>
		/// Clear all the selected cells with a valid Model.
		/// </summary>
		public virtual void ClearValues(RangeRegion region)
		{
			PositionCollection positions = region.GetCellsPositions();
			foreach (Position pos in positions)
			{
				CellContext cellContext = new CellContext(this, pos);
				if (cellContext.Cell != null)
				{
					if (cellContext.Cell.Editor != null)
						cellContext.Cell.Editor.ClearCell(cellContext);
				}
			}
		}
Beispiel #3
0
        /// <summary>
        /// Indicates if the specified range of cells is selected
        /// </summary>
        /// <param name="p_Range"></param>
        /// <returns></returns>
        public virtual bool Contains(RangeRegion p_Range)
        {
            if (p_Range.IsEmpty() || IsEmpty())
                return false;

            PositionCollection positions = p_Range.GetCellsPositions();
            for (int i = 0; i < positions.Count; i++)
            {
                if ( Contains(positions[i]) == false)
                    return false;
            }

            return true;
        }