AODL.Document.Content.Tables.Row.Row_OnRowChanged C# (CSharp) Method

Row_OnRowChanged() private method

After a row size changed all rows before the changed row maybe need to be resized. This also belongs to the columns.
private Row_OnRowChanged ( int rowNumber, int cellCount ) : void
rowNumber int The row number.
cellCount int The cell count.
return void
		private void Row_OnRowChanged(int rowNumber, int cellCount)
		{
			if (this.Table.ColumnCollection.Count <= cellCount)
			{
				for(int i=0; i <= cellCount-this.Table.ColumnCollection.Count; i++)
				{
					this.Table.ColumnCollection.Add(new Column(Table, string.Format("col{0}", this.Table.ColumnCollection.Count)));
				}
			}

			for(int i=0; i < rowNumber; i++)
			{
				Row row = this.Table.Rows[i];
				if (row.Cells.Count >= cellCount)
					continue;
				for(int ii = 0; ii < cellCount - row.Cells.Count; ii++)
				//for(int ii = cellCount - row.Cells.Count; ii < cellCount; ii++)
				{
					row.Cells.Add(new Cell(Table.Document));
				}
			}
		}
		#endregion