TryGetColor
(
ExcelTableReader.ExcelTableRow oRow,
String sColumnName,
ColorConverter2 oColorConverter2,
out Color oColor
)
{
Debug.Assert(oRow != null);
Debug.Assert(!String.IsNullOrEmpty(sColumnName));
Debug.Assert(oColorConverter2 != null);
AssertValid();
oColor = Color.Empty;
String sColor;
if (!oRow.TryGetNonEmptyStringFromCell(sColumnName, out sColor))
{
return(false);
}
if (!oColorConverter2.TryWorkbookToGraph(sColor, out oColor))
{
Range oInvalidCell = oRow.GetRangeForCell(sColumnName);
OnWorkbookFormatError(String.Format(
"The cell {0} contains an unrecognized color. Right-click the"
+ " cell and select Select Color on the right-click menu."
,
ExcelUtil.GetRangeAddress(oInvalidCell)
),
oInvalidCell
);
}
return(true);
}