Delete node by indirectly

In the OnDocumentChanged method, I check if a deleted link has ToNode equal a condition then I delete the Node.
It’s cause of overflow error.

I was just process with case deleting a link by directly. I overrided the OnSelectedDeleting method.
But case node A link to Node B,
if Delete node A, then the link will be delete, I just can catch the case in the OnDocumentChanged method, not OnSelectedDeleting method.

Tell me how to delete the ToNode with a condition.
thank for ahead
Sorry for My English.

I assume you mean stack overflow. I think you should debug the cause of that.
There’s at least one example of what you want to do in the sample applications, in the Processor sample.
Create a couple of ActivityNodes, and draw a link. Context-click the link, and invoke “Replace With Remote Connectors”. (Those two elliptical nodes name that connection, as you can see if you edit the text of one of them.) If you delete either link, whether by deleting the connected ActivityNode or just by deleting the link directly, not only does the RemoteConnectorNode get deleted, but so does the other one.
This is done in an override of FlowLink.OnLayerChanged.
You are right that you don’t want to implement a GoView.SelectionDeleting or GoView.SelectionDeleted event handler, since those events are only raised with the user deletes the selection, and links can be deleted implicitly, without being selected.

I’ve overriden of FlowLink.OnLayerChanged.
It’s done.
Thanks you so much