protected void AddSpanVertexToPotentialDConnectorMotifs
(IVertex oPotentialSpanVertex, ICollection<IVertex> oDPotentialAnchorVertices, Dictionary<string, DConnectorMotif> oPotentialDConnectorMotifs)
{
Debug.Assert(oPotentialSpanVertex != null);
Debug.Assert(oDPotentialAnchorVertices != null);
Debug.Assert(oDPotentialAnchorVertices.Count >= 2);
Debug.Assert(oPotentialDConnectorMotifs != null);
// Is there already a DConnectorMotif object for this set of
// potential anchor vertices?
IOrderedEnumerable<IVertex> oOrderedDPotentialAnchorVertices = oDPotentialAnchorVertices.OrderBy(v => v.ID);
string stringKey = string.Join(",", oOrderedDPotentialAnchorVertices.Select(v => v.ID.ToString()).ToArray());
DConnectorMotif oPotentialDConnectorMotif;
if (!oPotentialDConnectorMotifs.TryGetValue(
stringKey, out oPotentialDConnectorMotif))
{
// No. Create one.
oPotentialDConnectorMotif = new DConnectorMotif(new List<IVertex>(oDPotentialAnchorVertices));
oPotentialDConnectorMotifs.Add(stringKey,
oPotentialDConnectorMotif);
}
oPotentialDConnectorMotif.SpanVertices.Add(oPotentialSpanVertex);
}