public static void RegisterDictionaryWantsCrossRef <K, V>(Dictionary <K, V> wanterDict, XmlNode entryNode) where K : new()where V : new()
        {
            WantedRefForDictionary <K, V> wantedRefForDictionary = null;

            foreach (WantedRef wantedRef in DirectXmlCrossRefLoader.wantedRefs)
            {
                if (wantedRef.wanter == wanterDict)
                {
                    wantedRefForDictionary = (WantedRefForDictionary <K, V>)wantedRef;
                    break;
                }
            }
            if (wantedRefForDictionary == null)
            {
                wantedRefForDictionary = new WantedRefForDictionary <K, V>((object)wanterDict);
                DirectXmlCrossRefLoader.wantedRefs.Add((WantedRef)wantedRefForDictionary);
            }
            wantedRefForDictionary.AddWantedDictEntry(entryNode);
        }
Esempio n. 2
0
        public static void RegisterDictionaryWantsCrossRef <K, V>(Dictionary <K, V> wanterDict, XmlNode entryNode, object debugWanterInfo = null) where K : new()where V : new()
        {
            WantedRefForDictionary <K, V> wantedRefForDictionary = null;

            foreach (WantedRef wantedRef in wantedRefs)
            {
                if (wantedRef.wanter == wanterDict)
                {
                    wantedRefForDictionary = (WantedRefForDictionary <K, V>)wantedRef;
                    break;
                }
            }
            if (wantedRefForDictionary == null)
            {
                wantedRefForDictionary = new WantedRefForDictionary <K, V>(wanterDict, debugWanterInfo);
                wantedRefs.Add(wantedRefForDictionary);
            }
            wantedRefForDictionary.AddWantedDictEntry(entryNode);
        }
 public static void RegisterDictionaryWantsCrossRef <K, V>(Dictionary <K, V> wanterDict, XmlNode entryNode, object debugWanterInfo = null)
 {
     DeepProfiler.Start("RegisterDictionaryWantsCrossRef");
     try
     {
         WantedRefForDictionary <K, V> wantedRefForDictionary = null;
         if (!wantedListDictRefs.TryGetValue(wanterDict, out var value))
         {
             wantedRefForDictionary = new WantedRefForDictionary <K, V>(wanterDict, debugWanterInfo);
             wantedRefs.Add(wantedRefForDictionary);
             wantedListDictRefs.Add(wanterDict, wantedRefForDictionary);
         }
         else
         {
             wantedRefForDictionary = (WantedRefForDictionary <K, V>)value;
         }
         wantedRefForDictionary.AddWantedDictEntry(entryNode);
     }
     finally
     {
         DeepProfiler.End();
     }
 }