private static ConditionalWeakTable <object, WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.EventRegistrationTokenListWithCount> GetEventRegistrationTokenTableInternal(object instance, Action <EventRegistrationToken> removeMethod, out WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.TokenListCount tokenListCount, bool createIfNotFound) { WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.EventCacheKey key; key.target = instance; key.method = removeMethod.Method; lock (WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.s_eventRegistrations) { WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.EventCacheEntry local_3; if (!WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.s_eventRegistrations.TryGetValue(key, out local_3)) { if (!createIfNotFound) { tokenListCount = (WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.TokenListCount)null; return((ConditionalWeakTable <object, WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.EventRegistrationTokenListWithCount>)null); } local_3 = new WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.EventCacheEntry(); local_3.registrationTable = new ConditionalWeakTable <object, WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.EventRegistrationTokenListWithCount>(); local_3.tokenListCount = new WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.TokenListCount(key); WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.s_eventRegistrations.Add(key, local_3); } tokenListCount = local_3.tokenListCount; return(local_3.registrationTable); } }
internal EventRegistrationTokenListWithCount(WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.TokenListCount tokenListCount, EventRegistrationToken token) { this._tokenListCount = tokenListCount; this._tokenListCount.Inc(); this._tokenList = new WindowsRuntimeMarshal.EventRegistrationTokenList(token); }
private static ConditionalWeakTable <object, WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.EventRegistrationTokenListWithCount> GetOrCreateEventRegistrationTokenTable(object instance, Action <EventRegistrationToken> removeMethod, out WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.TokenListCount tokenListCount) { return(WindowsRuntimeMarshal.NativeOrStaticEventRegistrationImpl.GetEventRegistrationTokenTableInternal(instance, removeMethod, out tokenListCount, true)); }