Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscribe only to implemented events #26

Merged
merged 10 commits into from
Dec 6, 2024

Conversation

cwollenhaupt
Copy link
Contributor

Before subscribing to an event we check wether the VFP handler actually has a method to handle the event. Only if it does we subscribe to the event. This change lets us selectively implement only the events we are interested in, instead of having to implement all events.

Some .NET types implement lots of events and behave differently when an event is being subscribed. For instance, they might not collect and provide event data if there's no subscriber. Even though they shouldn't sometimes types expect a certain behavior from event handlers or alter the default behavior based on just the existence of a subscriber.

Two minor changes are included: Fixed typos (sorry!) and consistently use the SetError method instead of mixing direct assignments to the property with SetError calls. This makes it easier to subclass wwDotNetBridge when our application has its own logging scheme and we want to log all errors as they occur instead of checking after every call to wwDotNetBridge.

I've not recompiled wwDotNetBridge.DLL to avoid binary conflicts. For the same reason I've not updated the Examples directory with the updated PRG and DLL, nor did I remove the outdated PDB file.

@RickStrahl RickStrahl merged commit b155769 into RickStrahl:master Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants