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

Change Unsubscribe to match the behavior of Delegate.Remove #13

Closed
thomaslevesque opened this issue Apr 4, 2018 · 3 comments · Fixed by #35
Closed

Change Unsubscribe to match the behavior of Delegate.Remove #13

thomaslevesque opened this issue Apr 4, 2018 · 3 comments · Fixed by #35

Comments

@thomaslevesque
Copy link
Owner

Currently, when the Unsubscribe method receives a multicast delegate, it removes each individual handler from the weak event source. Since it has a role similar to Delegate.Remove, it should be consistent with the behavior of that method. Delegate.Remove removes the last occurrence of the whole invocation list of the specified delegate; if it doesn't find the exact list, it doesn't remove anything.

Suggested by @Weldryn in #11, see the discussion there for details.

@thomaslevesque
Copy link
Owner Author

@Weldryn, if you want to implement this, I suggest you start by writing (failing) unit tests to document the desired behavior (TDD-style). When we agree on what the exact behavior should be, based on these tests, you can start to actually implement it.

@Weldryn
Copy link

Weldryn commented Apr 7, 2018

Alright. I'll do that when I got some time. Cheers!

@thomaslevesque
Copy link
Owner Author

Hi @Weldryn, I released a beta with this change. Since you raised the issue in the first place, would you be interested in testing the change to make sure it works as you expected?

thomaslevesque added a commit that referenced this issue Nov 16, 2019
It had been lost when #13 was implemented
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants