RemoveUnwantedIsolates
(
ReadWorkbookContext oReadWorkbookContext,
IGraph oGraph
)
{
Debug.Assert(oReadWorkbookContext != null);
Debug.Assert(oGraph != null);
AssertValid();
List<IVertex> oIsolatedVertices = new List<IVertex>(
from oVertex in oGraph.Vertices
where oVertex.Degree == 0
select oVertex
);
foreach (IVertex oIsolatedVertex in oIsolatedVertices)
{
// Don't remove the isolated vertex if it is supposed to be shown
// regardless of whether it is part of an edge.
if ( !oIsolatedVertex.ContainsKey(
ReservedMetadataKeys.VertexHasVisibilityOfShow) )
{
RemoveVertex(oIsolatedVertex, oReadWorkbookContext, oGraph);
}
}
}