Profile Picture

EventSinkService.NodeInserted only works with newly opened form, not with saved document, ...

Posted By Chris Kiekens 5 Years Ago

EventSinkService.NodeInserted only works with newly opened form, not...

Author
Message
Chris Kiekens
Problem Posted 5 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: Forum Members
Last Active: 5 Years Ago
Posts: 3, Visits: 6

I have thefollowing problem:

I need toopen a document and have the NodeInserted event enabledto do something when a node gets inserted.

I use thishandler, manually set through a Button:

AddHandler Me.NDrawingDocument1.EventSinkService.NodeInserted, AddressOfEventSinkService_NodeInserted

The event works fine if I start the form, click on the button and then drawan object.

The event does NOT work:

- if I open a new document through the white page button on the nevrontoolbar and click the button that adds the handler

- if I open a saved document through nevron toolbar and click the buttonthat adds the handler

- if I read in a BLOB and click the button that adds the handler

No error, just the event is not fired by the document. What am I doing wrong?



Nevron Support
Posted 5 Years Ago
View Quick Profile
Supreme Being

Supreme Being (3,954 reputation)Supreme Being (3,954 reputation)Supreme Being (3,954 reputation)Supreme Being (3,954 reputation)Supreme Being (3,954 reputation)Supreme Being (3,954 reputation)Supreme Being (3,954 reputation)Supreme Being (3,954 reputation)Supreme Being (3,954 reputation)

Group: Forum Members
Last Active: Yesterday @ 6:43 AM
Posts: 2,888, Visits: 3,074

Hi,

When a document is loaded, or a new document is created, the diagram replaces the drawing view document. That is why you stop to receive events, because you remain connected to the old document that is not used any more. You need to reinstall your event handlers in these case.



Best Regards,
Nevron Support Team



Chris Kiekens
Posted 5 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: Forum Members
Last Active: 5 Years Ago
Posts: 3, Visits: 6
Hi,

I did reinstall the eventhandler with this code every time I started the program or opened a document:
AddHandler NDrawingDocument1.EventSinkService.NodeInserted, AddressOf EventSinkService_NodeInserted
And it does work, but only the first time when opening the form.

I had to change it to work all the time:
AddHandler NDrawingView1.document.EventSinkService.NodeInserted, AddressOf EventSinkService_NodeInserted
I hope this helps those with the same problem.

Thanks anyway!



Similar Topics


Reading This Topic