3 instantiations of EventRegistrationToken
mscorlib (3)
system\runtime\interopservices\windowsruntime\eventregistrationtokentable.cs (3)
69return new EventRegistrationToken(0); 87token = new EventRegistrationToken(token.Value + 1); 173return new EventRegistrationToken(tokenValue);
95 references to EventRegistrationToken
mscorlib (62)
system\reflection\eventinfo.cs (2)
126if (addMethod.ReturnType == typeof(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)) 149if (parameters[0].ParameterType == typeof(System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken))
system\runtime\interopservices\windowsruntime\eventregistrationtoken.cs (6)
32public static bool operator ==(EventRegistrationToken left, EventRegistrationToken right) 37public static bool operator !=(EventRegistrationToken left, EventRegistrationToken right) 44if (!(obj is EventRegistrationToken)) 49return ((EventRegistrationToken)obj).Value == Value;
system\runtime\interopservices\windowsruntime\eventregistrationtokentable.cs (11)
23private Dictionary<EventRegistrationToken, T> m_tokens = new Dictionary<EventRegistrationToken, T>(); 64public EventRegistrationToken AddEventHandler(T handler) 78private EventRegistrationToken AddEventHandlerNoLock(T handler) 84EventRegistrationToken token = GetPreferredToken(handler); 103internal T ExtractHandler(EventRegistrationToken token) 132private static EventRegistrationToken GetPreferredToken(T handler) 176public void RemoveEventHandler(EventRegistrationToken token) 205EventRegistrationToken preferredToken = GetPreferredToken(handler); 218foreach (KeyValuePair<EventRegistrationToken, T> registration in m_tokens) 236private void RemoveEventHandlerNoLock(EventRegistrationToken token)
system\runtime\interopservices\windowsruntime\windowsruntimemarshal.cs (39)
31public static void AddEventHandler<T>(Func<T, EventRegistrationToken> addMethod, 32Action<EventRegistrationToken> removeMethod, 62public static void RemoveEventHandler<T>(Action<EventRegistrationToken> removeMethod, T handler) 87public static void RemoveAllEventHandlers(Action<EventRegistrationToken> removeMethod) 135private EventRegistrationToken firstToken; // Optimization for common case where there is only one token 136private List<EventRegistrationToken> restTokens; // Rest of the tokens 138internal EventRegistrationTokenList(EventRegistrationToken token) 153public bool Push(EventRegistrationToken token) 159restTokens = new List<EventRegistrationToken>(); 170public bool Pop(out EventRegistrationToken token) 186public void CopyTo(List<EventRegistrationToken> tokens) 228internal static void AddEventHandler<T>(Func<T, EventRegistrationToken> addMethod, 229Action<EventRegistrationToken> removeMethod, 238EventRegistrationToken token = addMethod(handler); 261private static Dictionary<object, EventRegistrationTokenList> GetEventRegistrationTokenTable(object instance, Action<EventRegistrationToken> removeMethod) 288internal static void RemoveEventHandler<T>(Action<EventRegistrationToken> removeMethod, T handler) 294EventRegistrationToken token; 330internal static void RemoveAllEventHandlers(Action<EventRegistrationToken> removeMethod) 337List<EventRegistrationToken> tokensToRemove = new List<EventRegistrationToken>(); 411internal EventRegistrationTokenListWithCount(TokenListCount tokenListCount, EventRegistrationToken token) 430public void Push(EventRegistrationToken token) 437public bool Pop(out EventRegistrationToken token) 442public void CopyTo(List<EventRegistrationToken> tokens) 546private static object GetInstanceKey(Action<EventRegistrationToken> removeMethod) 558internal static void AddEventHandler<T>(Func<T, EventRegistrationToken> addMethod, 559Action<EventRegistrationToken> removeMethod, 569EventRegistrationToken token = addMethod(handler); 638private static ConditionalWeakTable<object, EventRegistrationTokenListWithCount> GetEventRegistrationTokenTableNoCreate(object instance, Action<EventRegistrationToken> removeMethod, out TokenListCount tokenListCount) 646private static ConditionalWeakTable<object, EventRegistrationTokenListWithCount> GetOrCreateEventRegistrationTokenTable(object instance, Action<EventRegistrationToken> removeMethod, out TokenListCount tokenListCount) 655private static ConditionalWeakTable<object, EventRegistrationTokenListWithCount> GetEventRegistrationTokenTableInternal(object instance, Action<EventRegistrationToken> removeMethod, out TokenListCount tokenListCount, bool createIfNotFound) 693internal static void RemoveEventHandler<T>(Action<EventRegistrationToken> removeMethod, T handler) 697EventRegistrationToken token; 770internal static void RemoveAllEventHandlers(Action<EventRegistrationToken> removeMethod) 774List<EventRegistrationToken> tokensToRemove = new List<EventRegistrationToken>(); 1028internal static void CallRemoveMethods(Action<EventRegistrationToken> removeMethod, List<EventRegistrationToken> tokensToRemove) 1033foreach (EventRegistrationToken token in tokensToRemove)
system\threading\Tasks\AsyncCausalityTracer.cs (2)
155EventRegistrationToken token = s_TracerFactory.add_TracingStatusChanged(new EventHandler<WFD.TracingStatusChangedEventArgs>(TracingStatusChangedHandler)); 156Contract.Assert(token != default(EventRegistrationToken), "EventRegistrationToken is null");
system\threading\Tasks\IAsyncCausalityTracerStatics.cs (2)
31EventRegistrationToken add_TracingStatusChanged(System.EventHandler<TracingStatusChangedEventArgs> eventHandler); 32void remove_TracingStatusChanged(EventRegistrationToken token);
System (33)
compmod\system\collections\specialized\marshalinghelpers.cs (33)
47EventRegistrationToken add_CollectionChanged(NotifyCollectionChangedEventHandler value); 48void remove_CollectionChanged(EventRegistrationToken token); 57EventRegistrationToken add_PropertyChanged(PropertyChangedEventHandler value); 58void remove_PropertyChanged(EventRegistrationToken token); 67EventRegistrationToken add_CanExecuteChanged(EventHandler<object> value); 68void remove_CanExecuteChanged(EventRegistrationToken token); 172Func<NotifyCollectionChangedEventHandler, EventRegistrationToken> addMethod = 173new Func<NotifyCollectionChangedEventHandler, EventRegistrationToken>(_this.add_CollectionChanged); 174Action<EventRegistrationToken> removeMethod = 175new Action<EventRegistrationToken>(_this.remove_CollectionChanged); 187Action<EventRegistrationToken> removeMethod = 188new Action<EventRegistrationToken>(_this.remove_CollectionChanged); 213internal EventRegistrationToken add_CollectionChanged(NotifyCollectionChangedEventHandler value) 218EventRegistrationToken token = table.AddEventHandler(value); 226internal void remove_CollectionChanged(EventRegistrationToken token) 258Func<PropertyChangedEventHandler, EventRegistrationToken> addMethod = 259new Func<PropertyChangedEventHandler, EventRegistrationToken>(_this.add_PropertyChanged); 260Action<EventRegistrationToken> removeMethod = 261new Action<EventRegistrationToken>(_this.remove_PropertyChanged); 273Action<EventRegistrationToken> removeMethod = 274new Action<EventRegistrationToken>(_this.remove_PropertyChanged); 299internal EventRegistrationToken add_PropertyChanged(PropertyChangedEventHandler value) 304EventRegistrationToken token = table.AddEventHandler(value); 312internal void remove_PropertyChanged(EventRegistrationToken token) 348Func<EventHandler<object>, EventRegistrationToken> addMethod = 349new Func<EventHandler<object>, EventRegistrationToken>(_this.add_CanExecuteChanged); 350Action<EventRegistrationToken> removeMethod = 351new Action<EventRegistrationToken>(_this.remove_CanExecuteChanged); 365Action<EventRegistrationToken> removeMethod = 366new Action<EventRegistrationToken>(_this.remove_CanExecuteChanged); 409private EventRegistrationToken add_CanExecuteChanged(EventHandler<object> value) 415EventRegistrationToken token = table.AddEventHandler(handler); 422private void remove_CanExecuteChanged(EventRegistrationToken token)