GetLabelFontSize
(
IVertex oVertex
)
{
Debug.Assert(oVertex != null);
AssertValid();
// Start with the default font size.
Double dLabelFontSize = m_oFormattedTextManager.FontSize;
Object oPerVertexLabelFontSizeAsObject;
// Check for a per-vertex font size. Note that the font size is stored
// as a Single in the vertex's metadata to reduce memory usage.
if ( oVertex.TryGetValue(ReservedMetadataKeys.PerVertexLabelFontSize,
typeof(Single), out oPerVertexLabelFontSizeAsObject) )
{
dLabelFontSize = (Double)(Single)oPerVertexLabelFontSizeAsObject;
if (dLabelFontSize <= 0)
{
throw new FormatException( String.Format(
"{0}: The vertex with the ID {1} has a non-positive"
+ " ReservedMetadataKeys.PerVertexLabelFontSize value."
,
this.ClassName,
oVertex.ID
) );
}
}
return (dLabelFontSize * m_dGraphScale);
}