Profile Picture

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

Posted By Chris Kiekens 9 Years Ago

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

Author
Message
Chris Kiekens
Problem Posted 9 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: 9 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 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 4:39 AM
Posts: 3,054, Visits: 4,018

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 9 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: 9 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

2 active, 2 guests, 0 members, 0 anonymous.
No members currently viewing this topic!