public FieldDefinition GetFieldDefinition(IFieldDefinition item) { return(TryGetOrAdd(_fieldcache, item, fdef => { var tdef = GetTypeDefinition(item.DeclaringType); return tdef == null ? null : JustDecompileHelper.FindMatchingField(tdef, fdef); })); }
public EventDefinition GetEventDefinition(IEventDefinition item) { return(TryGetOrAdd(_eventcache, item, edef => { var tdef = GetTypeDefinition(item.DeclaringType); return tdef == null ? null : JustDecompileHelper.FindMatchingEvent(tdef, edef); })); }
public PropertyDefinition GetPropertyDefinition(IPropertyDefinition item) { return(TryGetOrAdd(_propertycache, item, pdef => { var tdef = GetTypeDefinition(item.DeclaringType); return tdef == null ? null : JustDecompileHelper.FindMatchingProperty(tdef, pdef); })); }
public MethodDefinition GetMethodDefinition(IMethodDefinition item) { return(TryGetOrAdd(_methodcache, item, mdef => { var tdef = GetTypeDefinition(item.DeclaringType); return tdef == null ? null : JustDecompileHelper.FindMatchingMethod(tdef, mdef); })); }
public AssemblyNameReference GetAssemblyNameReference(IAssemblyNameReference item) { var canr = JustDecompileHelper.ExtractCecilAssemblyNameReference(item); if (canr == null) { return(null); } return(TryGetOrAdd(_assemblynamereferencecache, canr, anref => JustDecompileHelper.FindMatchingAssemblyReference(AssemblyDefinition, anref))); }
private IAssemblyContext SearchAssemblyReferenceContext(IAssemblyNameReference anr) { var canr = JustDecompileHelper.ExtractCecilAssemblyNameReference(anr); if (canr == null) { return(null); } foreach (var wrapper in Package.HostAssemblies) { var jdwrapper = (JustDecompileAssemblyWrapper)wrapper; foreach (var oanr in jdwrapper.AssemblyDefinition.MainModule.AssemblyReferences) { var coanr = JustDecompileHelper.ExtractCecilAssemblyNameReference(oanr); if (canr == coanr) { return(GetAssemblyContext(jdwrapper.Location)); } } } return(null); }
public Resource GetResource(IResource item) { return(TryGetOrAdd(_resourcecache, item, res => JustDecompileHelper.FindMatchingResource(AssemblyDefinition, res))); }
public TypeDefinition GetTypeDefinition(ITypeDefinition item) { return(TryGetOrAdd(_typecache, item, tdef => JustDecompileHelper.FindMatchingType(AssemblyDefinition, tdef))); }