/// <summary>Finds the resource dictionaries created from a given source URI. </summary>
        /// <param name="uri">The source URI. The method return <see langword="null" /> if no resource dictionaries were created from <paramref name="uri" /> </param>
        /// <returns>The resource dictionaries created from <paramref name="uri" />. The method returns <see langword="null" /> if Visual Diagnostics is not enabled, the <see langword="ENABLE_XAML_DIAGNOSTICS_SOURCE_INFO" /> environment variable is not set or is set to <see langword="false" />, or no resource dictionaries were created from <paramref name="uri" />.
        /// </returns>
        // Token: 0x060017A1 RID: 6049 RVA: 0x000735EC File Offset: 0x000717EC
        public static IEnumerable <ResourceDictionary> GetResourceDictionariesForSource(Uri uri)
        {
            if (!ResourceDictionaryDiagnostics.IsEnabled || ResourceDictionaryDiagnostics._dictionariesFromUri == null)
            {
                return(ResourceDictionaryDiagnostics.EmptyResourceDictionaries);
            }
            object dictionariesFromUriLock = ResourceDictionaryDiagnostics._dictionariesFromUriLock;
            IEnumerable <ResourceDictionary> result;

            lock (dictionariesFromUriLock)
            {
                List <WeakReference <ResourceDictionary> > list;
                if (!ResourceDictionaryDiagnostics._dictionariesFromUri.TryGetValue(uri, out list) || list.Count == 0)
                {
                    result = ResourceDictionaryDiagnostics.EmptyResourceDictionaries;
                }
                else
                {
                    List <ResourceDictionary> list2 = new List <ResourceDictionary>(list.Count);
                    List <WeakReference <ResourceDictionary> > list3 = null;
                    foreach (WeakReference <ResourceDictionary> weakReference in list)
                    {
                        ResourceDictionary item;
                        if (weakReference.TryGetTarget(out item))
                        {
                            list2.Add(item);
                        }
                        else
                        {
                            if (list3 == null)
                            {
                                list3 = new List <WeakReference <ResourceDictionary> >();
                            }
                            list3.Add(weakReference);
                        }
                    }
                    if (list3 != null)
                    {
                        ResourceDictionaryDiagnostics.RemoveEntries(uri, list, list3);
                    }
                    result = list2.AsReadOnly();
                }
            }
            return(result);
        }
        // Token: 0x060017A5 RID: 6053 RVA: 0x00073794 File Offset: 0x00071994
        private static void RemoveResourceDictionaryForUriImpl(Uri uri, ResourceDictionary rd)
        {
            object dictionariesFromUriLock = ResourceDictionaryDiagnostics._dictionariesFromUriLock;

            lock (dictionariesFromUriLock)
            {
                List <WeakReference <ResourceDictionary> > list;
                if (ResourceDictionaryDiagnostics._dictionariesFromUri != null && ResourceDictionaryDiagnostics._dictionariesFromUri.TryGetValue(uri, out list))
                {
                    List <WeakReference <ResourceDictionary> > list2 = new List <WeakReference <ResourceDictionary> >();
                    foreach (WeakReference <ResourceDictionary> weakReference in list)
                    {
                        ResourceDictionary resourceDictionary;
                        if (!weakReference.TryGetTarget(out resourceDictionary) || resourceDictionary == rd)
                        {
                            list2.Add(weakReference);
                        }
                    }
                    ResourceDictionaryDiagnostics.RemoveEntries(uri, list, list2);
                }
            }
        }