protected void HandleEdge(object newedge, System.EventArgs args) {
Edge e = (Edge)newedge;
try {
e.CloseEvent += this.HandleEdgeClose;
e.Subscribe(this, null);
lock( _sync ) {
_edges.Add(e);
}
}
catch(Exception x) {
//Didn't work out, make sure the edges is closed
Console.WriteLine("Closing ({0}) due to: {1}", e, x);
e.Close();
}
}