2 instantiations of Subscription
Microsoft.Maui (2)
WeakEventManager.cs (2)
116 targets.Add(new Subscription(null, methodInfo)); 120 targets.Add(new Subscription(new WeakReference(handlerTarget), methodInfo));
12 references to Subscription
Microsoft.Maui (12)
WeakEventManager.cs (12)
13 readonly Dictionary<string, List<Subscription>> _eventHandlers = new(StringComparer.Ordinal); 43 var toRemove = new List<Subscription>(); 45 if (_eventHandlers.TryGetValue(eventName, out List<Subscription>? target)) 49 Subscription subscription = target[i]; 69 Subscription subscription = toRemove[i]; 107 if (!_eventHandlers.TryGetValue(eventName, out List<Subscription>? targets)) 109 targets = new List<Subscription>(); 125 if (!_eventHandlers.TryGetValue(eventName, out List<Subscription>? subscriptions)) 130 Subscription current = subscriptions[n]; 148 readonly struct Subscription : IEquatable<Subscription> 160 public bool Equals(Subscription other) => Subscriber == other.Subscriber && Handler == other.Handler; 162 public override bool Equals(object? obj) => obj is Subscription other && Equals(other);