AODL.Document.Export.Html.HTMLContentBuilder.GetCellAsHtml C# (CSharp) Метод

GetCellAsHtml() публичный Метод

Gets the cell as HTML.
public GetCellAsHtml ( Cell cell ) : string
cell AODL.Document.Content.Tables.Cell The cell.
Результат string
		public string GetCellAsHtml(Cell cell)
		{
			string html					= "<td ";

			try
			{
				if (cell != null)
				{
					if (cell.ColumnRepeating != null)
						html			+= "columnspan=\""+cell.ColumnRepeating+"\" ";

					string cellStyle	= this.HTMLStyleBuilder.GetCellStyleAsHtml(cell.CellStyle);
					if (cellStyle.Length > 0)
						html			+= cellStyle;
					
					int cellIndex		= -1;
					if (cell.Row != null)
						cellIndex		= cell.Row.GetCellIndex(cell);

					ColumnStyle colStyle	= null;
					if (cellIndex != -1 && cell.Row!= null && cell.Row.Table != null)
						if (cell.Row.Table.ColumnCollection != null)
							if (cell.Row.Table.ColumnCollection.Count > cellIndex)
								if (cell.Row.Table.ColumnCollection[cellIndex].ColumnStyle != null)
									colStyle	= cell.Row.Table.ColumnCollection[cellIndex].ColumnStyle;

					string colHtmlStyle		= this.HTMLStyleBuilder.GetColumnStyleAsHtml(colStyle);
					if (colHtmlStyle.Length > 0)
						html			+= colHtmlStyle;

					html				+= ">\n";

					string contentHtml	= this.GetIContentCollectionAsHtml(cell.Content);
					if (contentHtml.Length > 0)
						html			+= contentHtml;
				}
			}
			catch(Exception ex)
			{
				throw new AODLException("Exception while trying to build a HTML string from a Cell object.", ex);
			}

			if (!html.Equals("<td "))
				html				+= "</td>\n";
			else
				html				= "";

			return html;
		}