Releases: thomaslevesque/WeakEvent
Releases · thomaslevesque/WeakEvent
4.1.0
4.1.0-beta.2
Changed
- Removed "unsubscribe on throw" feature introduced in previous beta
4.1.0-beta.1
New
- Ability to catch exceptions thrown by individual handlers (#41)
Changed
- The overload of unsubscribe that accepts a
lifetimeObject
is now obsolete. You no longer need to specify the lifetime object to unsubscribe.
4.0.1
4.0.1-beta.2
Don't add new empty entries when rebuilding the index
4.0.1-beta.1
Fixed
- Dead handlers are never removed from the
DelegateCollection
if the event is not raised (#39)
4.0.0
New
- Enable C# 8 nullability analysis (#34)
- Allow to specify a lifetime object when subscribing to the event (useful when subscribing with an anonymous delegate) (#29)
- Add documentation for public API
- Add package logo
Breaking changes
- Dropped support for .NET Framework 3.5 and .NET Standard 1.1 (.NET Standard 1.3 is now supported)
Unsubscribe
has been changed to be consistent with the behavior ofDelegate.Remove
, which has a similar role. (#13)- Multiple occurrences of the same delegate
- Previous behavior: all occurrences of the unsubscribed delegate were removed. If you subscribed with the same delegate A twice, and unsubscribed A only once, all occurrences of A were removed.
- New behavior: only the last occurrence of the unsubscribed delegate is removed. If you subscribed with the same delegate A twice, and unsubscribed A only once, only the last occurrence of A is removed.
- Multicast delegates:
- Previous behavior: when unsubscribing a multicast delegate, all occurrences of each individual delegate in the invocation list was removed. If you had subscribed with delegates A, B, C, D, C, then unsubscribed with multicast delegate AC (combination of A and C), all occurrences of A and C were removed, and you ended up with handlers B, D.
- New behavior: when unsubscribing a multicast delegate, the last occurrence of the complete invocation list is removed. If you had subscribed with delegates A, B, C, D, C, then unsubscribe with multicast delegate AC (combination of A and C), nothing is removed, because the sequence A, C don't appear in A, B, C, D, C. If you unsubscribe with multicast delegate BCD, then B, C and D are removed, and you end up with handlers A, C.
- Multiple occurrences of the same delegate
4.0.0-beta.3
New
- Added package logo
4.0.0-beta.2
New
- Add documentation for public API
4.0.0-beta.1
New
- Enable C# 8 nullability analysis (#34)
- Allow to specify a lifetime object when subscribing to the event (useful when subscribing with an anonymous delegate) (#29)
Breaking changes
- Dropped support for .NET Framework 3.5 and .NET Standard 1.1 (.NET Standard 1.3 is now supported)
Unsubscribe
has been changed to be consistent with the behavior ofDelegate.Remove
, which has a similar role. (#13)- Multiple occurrences of the same delegate
- Previous behavior: all occurrences of the unsubscribed delegate were removed. If you subscribed with the same delegate A twice, and unsubscribed A only once, all occurrences of A were removed.
- New behavior: only the last occurrence of the unsubscribed delegate is removed. If you subscribed with the same delegate A twice, and unsubscribed A only once, only the last occurrence of A is removed.
- Multicast delegates:
- Previous behavior: when unsubscribing a multicast delegate, all occurrences of each individual delegate in the invocation list was removed. If you had subscribed with delegates A, B, C, D, C, then unsubscribed with multicast delegate AC (combination of A and C), all occurrences of A and C were removed, and you ended up with handlers B, D.
- New behavior: when unsubscribing a multicast delegate, the last occurrence of the complete invocation list is removed. If you had subscribed with delegates A, B, C, D, C, then unsubscribe with multicast delegate AC (combination of A and C), nothing is removed, because the sequence A, C don't appear in A, B, C, D, C. If you unsubscribe with multicast delegate BCD, then B, C and D are removed, and you end up with handlers A, C.
- Multiple occurrences of the same delegate