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


EventSinkService.NodeInserted only works with newly opened form, not...
Author
Message
Chris Kiekens
Chris Kiekens
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
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
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

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
Chris Kiekens
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
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!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search