ReadRadius ( ExcelTableReader.ExcelTableRow oRow, VertexRadiusConverter oVertexRadiusConverter, IVertex oVertex ) { Debug.Assert(oRow != null); Debug.Assert(oVertex != null); Debug.Assert(oVertexRadiusConverter != null); AssertValid(); String sRadius; if (!oRow.TryGetNonEmptyStringFromCell(VertexTableColumnNames.Radius, out sRadius)) { return(new Nullable <Single>()); } Single fRadius; if (!Single.TryParse(sRadius, out fRadius)) { Range oInvalidCell = oRow.GetRangeForCell( VertexTableColumnNames.Radius); OnWorkbookFormatError(String.Format( "The cell {0} contains an invalid size. The vertex size," + " which is optional, must be a number. Any number is" + " acceptable, although {1} is used for any number less than" + " {1} and {2} is used for any number greater than {2}." , ExcelUtil.GetRangeAddress(oInvalidCell), VertexRadiusConverter.MinimumRadiusWorkbook, VertexRadiusConverter.MaximumRadiusWorkbook ), oInvalidCell ); } oVertex.SetValue(ReservedMetadataKeys.PerVertexRadius, oVertexRadiusConverter.WorkbookToGraph(fRadius)); return(new Nullable <Single>(fRadius)); }
ReadRadius ( ExcelTableReader.ExcelTableRow oRow, VertexRadiusConverter oVertexRadiusConverter, IVertex oVertex ) { Debug.Assert(oRow != null); Debug.Assert(oVertex != null); Debug.Assert(oVertexRadiusConverter != null); AssertValid(); String sRadius; if ( !oRow.TryGetNonEmptyStringFromCell(VertexTableColumnNames.Radius, out sRadius) ) { return ( new Nullable<Single>() ); } Single fRadius; if ( !Single.TryParse(sRadius, out fRadius) ) { Range oInvalidCell = oRow.GetRangeForCell( VertexTableColumnNames.Radius); OnWorkbookFormatError( String.Format( "The cell {0} contains an invalid size. The vertex size," + " which is optional, must be a number. Any number is" + " acceptable, although {1} is used for any number less than" + " {1} and {2} is used for any number greater than {2}." , ExcelUtil.GetRangeAddress(oInvalidCell), VertexRadiusConverter.MinimumRadiusWorkbook, VertexRadiusConverter.MaximumRadiusWorkbook ), oInvalidCell ); } oVertex.SetValue( ReservedMetadataKeys.PerVertexRadius, oVertexRadiusConverter.WorkbookToGraph(fRadius) ); return ( new Nullable<Single>(fRadius) ); }