public void Close() { Cycle c; foreach (var n in InternalNodes) { foreach (var ep in n.Requests) { if (Owner.cycleMap.TryFindValue((Node)ep.Target, out c) && c == this) { InternalEnds.Add(ep); } else { Requests.Add(ep); } } foreach (var ep in n.Provides) { if (!Owner.cycleMap.TryFindValue((Node)ep.Target, out c) || c != this) { Provides.Add(ep); } } } }
public void AddProvides(Node requester, T role) { var ep = new EndPoint(requester, role); if (!Provides.Contains(ep)) { if (requester == this) { HasLoop = true; } Provides.Add(ep); Owner.Invalidate(); } }