C# 클래스 NavHelper.AssemblyResolver.AssemblyResolver

Helper class for Microsoft Dynamics NAV that allows C/AL to receive the AssemblyResolve event and process it at runtime. The class subscribes to the AssemblyResolve event of the current application domain at startup, and upon disposal it unsubscribes from events. The class uses a common assembly repository that will be created once per service tier instance runtime, but each session will be able to resolve an assembly independently. Assemblies resolved in one session will be available to other sessions.
상속: IDisposable
파일 보기 프로젝트 열기: vjekob/NAV-Assembly-Resolver

공개 메소드들

메소드 설명
AssemblyResolver ( ) : System

Constructor. It adds this instance of the AssemblyResolver to the static list of resolvers, and then attempts to subscribe this instance to the AssemblyResolve event of the current application domain.

ResolveAssembly ( string name, byte asm, byte pdb ) : void

Stores the assembly in the instance cache.

비공개 메소드들

메소드 설명
AssemblyResolve ( object sender, ResolveEventArgs args ) : Assembly
GetExceptionMessage ( Exception e, string method ) : string
IDisposable ( ) : void

Implements the IDisposable interface. It first unsubscribes current instance from listening to the ApplicationResolve event of the current application domain (if this instance was subscribed to it), then removes this instance from the static list of AssemblyResolver instances, and then subscribes the next instance from the list if there are any left. This makes sure that there is always one and only one instance of the AssemblyResolver subscribed to the AssemblyResolve event of the current application domain, and that any instances belonging to ended sessions are unsubscribed so that they may be garbage-collected.

Subscribe ( ) : void

Subscribes this instance of AssemblyResolver to the AssemblyResolve event of the current application domain if no other instance of AssemblyResolver is already subscribed to that event.

Unsubscribe ( ) : void

Unsubscribes this instance of AssemblyResolver from the AssemblyResolve event of the current application domain if this instance was subscribed to it.

메소드 상세

AssemblyResolver() 공개 메소드

Constructor. It adds this instance of the AssemblyResolver to the static list of resolvers, and then attempts to subscribe this instance to the AssemblyResolve event of the current application domain.
public AssemblyResolver ( ) : System
리턴 System

ResolveAssembly() 공개 메소드

Stores the assembly in the instance cache.
public ResolveAssembly ( string name, byte asm, byte pdb ) : void
name string Fully qualified name of the assembly to store in the instance cache.
asm byte Byte array containing the assembly bytes to store in the instance cache.
pdb byte Byte array containing the debug information for the assembly.
리턴 void