Exemple #1
0
 protected void removeProxyDelegates(ProxyDelegateFinderBase proxyDelegateFinder, bool removeCreators = true)
 {
     if (proxyDelegateFinder.Errors != 0)
     {
         Log.v("Not removing proxy delegates and creator type since errors were detected.");
         return;
     }
     addTypesToBeRemoved(proxyDelegateFinder.DelegateTypes, "Proxy delegate type");
     if (removeCreators && proxyDelegateFinder.RemovedDelegateCreatorCalls > 0)
     {
         addTypesToBeRemoved(proxyDelegateFinder.DelegateCreatorTypes, "Proxy delegate creator type");
     }
 }
Exemple #2
0
 public ProxyDelegateFinderBase(ModuleDefinition module, ProxyDelegateFinderBase oldOne)
 {
     this.module = module;
     foreach (var method in oldOne.delegateCreatorMethods)
     {
         delegateCreatorMethods.Add(lookup(method, "Could not find delegate creator method"));
     }
     foreach (var kv in oldOne.delegateTypesDict)
     {
         delegateTypesDict[lookup(kv.Key, "Could not find delegate type")] = kv.Value;
     }
     foreach (var key in oldOne.fieldToDelegateInfo.getKeys())
     {
         fieldToDelegateInfo.add(lookup(key, "Could not find field"), copy(oldOne.fieldToDelegateInfo.find(key)));
     }
     foreach (var kv in oldOne.proxyMethodToField)
     {
         var key   = lookup(kv.Key, "Could not find proxy method");
         var value = lookup(kv.Value, "Could not find proxy field");
         proxyMethodToField[key] = value;
     }
 }