// Token: 0x060017B2 RID: 6066 RVA: 0x00073A8C File Offset: 0x00071C8C internal static void RevertRequest(StaticResourceExtension requester, bool success) { ResourceDictionaryDiagnostics.LookupResult lookupResult = ResourceDictionaryDiagnostics._lookupResultStack.Pop(); if (!success) { return; } if (lookupResult.Requester.GetType() == typeof(StaticResourceExtension)) { return; } if (ResourceDictionaryDiagnostics._resultCache == null) { ResourceDictionaryDiagnostics._resultCache = new Dictionary <WeakReferenceKey <StaticResourceExtension>, WeakReference <ResourceDictionary> >(); } WeakReferenceKey <StaticResourceExtension> key = new WeakReferenceKey <StaticResourceExtension>(requester); ResourceDictionary dictionary = null; WeakReference <ResourceDictionary> weakReference; bool flag = ResourceDictionaryDiagnostics._resultCache.TryGetValue(key, out weakReference); if (flag) { weakReference.TryGetTarget(out dictionary); } if (lookupResult.Dictionary != null) { ResourceDictionaryDiagnostics._resultCache[key] = new WeakReference <ResourceDictionary>(lookupResult.Dictionary); return; } lookupResult.Key = requester.ResourceKey; lookupResult.Dictionary = dictionary; }
// Token: 0x060017AF RID: 6063 RVA: 0x000739D0 File Offset: 0x00071BD0 internal static ResourceDictionaryDiagnostics.LookupResult RequestLookupResult(StaticResourceExtension requester) { if (ResourceDictionaryDiagnostics._lookupResultStack == null) { ResourceDictionaryDiagnostics._lookupResultStack = new Stack <ResourceDictionaryDiagnostics.LookupResult>(); } ResourceDictionaryDiagnostics.LookupResult lookupResult = new ResourceDictionaryDiagnostics.LookupResult(requester); ResourceDictionaryDiagnostics._lookupResultStack.Push(lookupResult); return(lookupResult); }
// Token: 0x060017B1 RID: 6065 RVA: 0x00073A18 File Offset: 0x00071C18 private static void RecordLookupResultImpl(object key, ResourceDictionary rd) { if (ResourceDictionaryDiagnostics._lookupResultStack.Count > 0) { ResourceDictionaryDiagnostics.LookupResult lookupResult = ResourceDictionaryDiagnostics._lookupResultStack.Peek(); if (!object.Equals(lookupResult.Requester.ResourceKey, key)) { return; } if (lookupResult.Requester.GetType() == typeof(StaticResourceExtension)) { lookupResult.Key = key; lookupResult.Dictionary = rd; return; } lookupResult.Key = key; lookupResult.Dictionary = rd; } }
// Token: 0x060017B3 RID: 6067 RVA: 0x00073B30 File Offset: 0x00071D30 internal static void OnStaticResourceResolved(object targetObject, object targetProperty, ResourceDictionaryDiagnostics.LookupResult result) { EventHandler <StaticResourceResolvedEventArgs> staticResourceResolved = ResourceDictionaryDiagnostics.StaticResourceResolved; if (staticResourceResolved != null && result.Dictionary != null) { staticResourceResolved(null, new StaticResourceResolvedEventArgs(targetObject, targetProperty, result.Dictionary, result.Key)); } ResourceDictionaryDiagnostics.RequestCacheCleanup(targetObject); }