ResolveEventHandler ResolveEventHandler ResolveEventHandler ResolveEventHandler Delegate

定义

表示处理 TypeResolveResourceResolveAssemblyResolveAppDomain 事件的方法。Represents a method that handles the TypeResolve, ResourceResolve, or AssemblyResolve event of an AppDomain.

public delegate System::Reflection::Assembly ^ ResolveEventHandler(System::Object ^ sender, ResolveEventArgs ^ args);
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public delegate System.Reflection.Assembly ResolveEventHandler(object sender, ResolveEventArgs args);
type ResolveEventHandler = delegate of obj * ResolveEventArgs -> Assembly
Public Delegate Function ResolveEventHandler(sender As Object, args As ResolveEventArgs) As Assembly 

参数

sender
Object Object Object Object

事件源。The source of the event.

返回值

System.Reflection.Assembly

解析类型、程序集或资源的程序集;如果无法解析程序集,则为 nullThe assembly that resolves the type, assembly, or resource; or null if the assembly cannot be resolved.

继承
ResolveEventHandlerResolveEventHandlerResolveEventHandlerResolveEventHandler
属性

注解

如果运行时类加载程序无法解析对程序集、 类型或资源的引用,将引发相应事件,从而使有机会通知运行时引用的程序集、 类型或资源位于哪个程序集中的回调。If the runtime class loader cannot resolve a reference to an assembly, type, or resource, the corresponding events are raised to give the callback a chance to tell the runtime which assembly the referenced assembly, type, or resource is in. 它负责ResolveEventHandler返回程序集解析类型、 程序集或资源,或如果无法识别该程序集,则返回 null。It is the responsibility of the ResolveEventHandler to return the assembly that resolves the type, assembly, or resource, or to return null if the assembly is not recognized. 有关详细信息,请参阅解析程序集加载AppDomain.ResourceResolveAppDomain.AssemblyResolve,和AppDomain.ReflectionOnlyAssemblyResolve事件。For more information, see Resolving Assembly Loads and the AppDomain.ResourceResolve, AppDomain.AssemblyResolve, and AppDomain.ReflectionOnlyAssemblyResolve events.

重要

开头.NET Framework 4.NET Framework 4,则System.ResolveEventHandler事件引发的所有程序集,包括资源程序集。Beginning with the .NET Framework 4.NET Framework 4, the System.ResolveEventHandler event is raised for all assemblies, including resource assemblies. 在早期版本中的资源程序集不引发事件。In earlier versions, the event was not raised for resource assemblies. 如果本地化操作系统,则可能会调用处理程序多个时间: 为每个区域性回退链中的一次。If the operating system is localized, the handler might be called multiple times: once for each culture in the fallback chain.

每个派生的类DelegateMulticastDelegate具有一个构造函数和一个Invoke方法。Every derived class of Delegate and MulticastDelegate has a constructor and an Invoke method. C + + 代码示例中的说明,请参阅Delegate类。See the C++ code example in the description for the Delegate class.

扩展方法

GetMethodInfo(Delegate) GetMethodInfo(Delegate) GetMethodInfo(Delegate) GetMethodInfo(Delegate)

获取指示指定委托表示的方法的对象。Gets an object that represents the method represented by the specified delegate.

适用于

另请参阅