C# 클래스 Mono.Addins.AddinEngine

An add-in engine.
This class allows hosting several independent add-in engines in a single application domain. In general, applications use the AddinManager class to query and manage extensions. This class is static, so the API is easily accessible. However, some kind applications may need to use several isolated add-in engines, and in this case the AddinManager class can't be used, because it is bound to a single add-in engine. Those applications can instead create several instances of the AddinEngine class. Each add-in engine can be independently initialized with different add-in registries and extension models.
상속: Mono.Addins.ExtensionContext
파일 보기 프로젝트 열기: mono/mono-addins 1 사용 예제들

Private Properties

프로퍼티 타입 설명
ActivateAddin void
ActivateRoots void
CheckHostAssembly void
CheckInitialized void
CurrentDomainAssemblyResolve System.Reflection.Assembly
FindType Mono.Addins.Description.ExtensionNodeType
GetAddin RuntimeAddin
GetAddinForAssembly RuntimeAddin
GetAutoTypeExtensionPoint string
GetNodeTypeAddin string
Initialize void
InsertAddin bool
InsertExtensionPoint void
LoadAddin bool
OnAssemblyLoaded void
RegisterAssemblies void
RegisterAutoTypeExtensionPoint void
RegisterNodeSets void
ReportAddinLoad void
ReportAddinUnload void
ReportError void
ResetCachedData void
ResolveLoadDependencies bool
UnloadAddin void
UnregisterAddinNodeSets void
UnregisterAutoTypeExtensionPoint void
ValidateAddinRoots void

공개 메소드들

메소드 설명
AddinEngine ( ) : System

Initializes a new instance of the Mono.Addins.AddinEngine class.

CheckInstalled ( string message ) : void

Checks if the provided add-ins are installed, and requests the installation of those which aren't.

This method checks if the specified add-ins are installed. If some of the add-ins are not installed, it will use the installer assigned to the DefaultAddinInstaller property to install them. If the installation fails, or if DefaultAddinInstaller is not set, an exception will be thrown.

CreateExtensionContext ( ) : Mono.Addins.ExtensionContext

Creates a new extension context.

Extension contexts can be used to query the extension model using particular condition values.

Initialize ( string configDir ) : void

Initializes the add-in engine

The add-in engine needs to be initialized before doing any add-in operation. When initialized with this method, it will look for add-in in the add-in registry located in the specified path.

Initialize ( string configDir, string addinsDir ) : void

Initializes the add-in engine.

The add-in engine needs to be initialized before doing any add-in operation. Configuration information about the add-in registry will be stored in the provided location. The add-in engine will look for add-ins in the provided 'addinsDir' directory. When specifying a path, it is possible to use a special folder name as root. For example: [Personal]/.config/MyApp. In this case, [Personal] will be replaced by the location of the Environment.SpecialFolder.Personal folder. Any value of the Environment.SpecialFolder enumeration can be used (always between square brackets)

Initialize ( string configDir, string addinsDir, string databaseDir ) : void

Initializes the add-in engine.

The add-in engine needs to be initialized before doing any add-in operation. Configuration information about the add-in registry will be stored in the provided location. The add-in engine will look for add-ins in the provided 'addinsDir' directory. Cached information about add-ins will be stored in the 'databaseDir' directory. When specifying a path, it is possible to use a special folder name as root. For example: [Personal]/.config/MyApp. In this case, [Personal] will be replaced by the location of the Environment.SpecialFolder.Personal folder. Any value of the Environment.SpecialFolder enumeration can be used (always between square brackets)

InitializeDefaultLocalizer ( IAddinLocalizer localizer ) : void

Sets the default localizer to be used for this add-in engine

IsAddinLoaded ( string id ) : bool

Checks if an add-in has been loaded.

LoadAddin ( IProgressStatus statusMonitor, string id ) : void

Forces the loading of an add-in.

This method loads all assemblies that belong to an add-in in memory. All add-ins on which the specified add-in depends will also be loaded. Notice that in general add-ins don't need to be explicitly loaded using this method, since the add-in engine will load them on demand.

Shutdown ( ) : void

Finalizes the add-in engine.

비공개 메소드들

메소드 설명
ActivateAddin ( string id ) : void
ActivateRoots ( ) : void
CheckHostAssembly ( Assembly asm ) : void
CheckInitialized ( ) : void
CurrentDomainAssemblyResolve ( object sender, ResolveEventArgs args ) : Assembly
FindType ( Mono.Addins.Description.ExtensionNodeSet nset, string name, string callingAddinId ) : Mono.Addins.Description.ExtensionNodeType
GetAddin ( string id ) : RuntimeAddin
GetAddinForAssembly ( Assembly asm ) : RuntimeAddin
GetAutoTypeExtensionPoint ( Type type ) : string
GetNodeTypeAddin ( Mono.Addins.Description.ExtensionNodeSet nset, string type, string callingAddinId ) : string
Initialize ( Assembly startupAsm, string configDir, string addinsDir, string databaseDir ) : void
InsertAddin ( IProgressStatus statusMonitor, Addin iad ) : bool
InsertExtensionPoint ( RuntimeAddin addin, ExtensionPoint ep ) : void
LoadAddin ( IProgressStatus statusMonitor, string id, bool throwExceptions ) : bool
OnAssemblyLoaded ( object s, AssemblyLoadEventArgs a ) : void
RegisterAssemblies ( RuntimeAddin addin ) : void
RegisterAutoTypeExtensionPoint ( Type type, string path ) : void
RegisterNodeSets ( string addinId, ExtensionNodeSetCollection nsets ) : void
ReportAddinLoad ( string id ) : void
ReportAddinUnload ( string id ) : void
ReportError ( string message, string addinId, Exception exception, bool fatal ) : void
ResetCachedData ( ) : void
ResolveLoadDependencies ( ArrayList addins, Stack depCheck, string id, bool optional ) : bool
UnloadAddin ( string id ) : void
UnregisterAddinNodeSets ( string addinId ) : void
UnregisterAutoTypeExtensionPoint ( Type type, string path ) : void
ValidateAddinRoots ( ) : void

메소드 상세

AddinEngine() 공개 메소드

Initializes a new instance of the Mono.Addins.AddinEngine class.
public AddinEngine ( ) : System
리턴 System

CheckInstalled() 공개 메소드

Checks if the provided add-ins are installed, and requests the installation of those which aren't.
This method checks if the specified add-ins are installed. If some of the add-ins are not installed, it will use the installer assigned to the DefaultAddinInstaller property to install them. If the installation fails, or if DefaultAddinInstaller is not set, an exception will be thrown.
public CheckInstalled ( string message ) : void
message string /// Message to show to the user when new add-ins have to be installed. ///
리턴 void

CreateExtensionContext() 공개 메소드

Creates a new extension context.
Extension contexts can be used to query the extension model using particular condition values.
public CreateExtensionContext ( ) : Mono.Addins.ExtensionContext
리턴 Mono.Addins.ExtensionContext

Initialize() 공개 메소드

Initializes the add-in engine
The add-in engine needs to be initialized before doing any add-in operation. When initialized with this method, it will look for add-in in the add-in registry located in the specified path.
public Initialize ( string configDir ) : void
configDir string /// Location of the add-in registry. ///
리턴 void

Initialize() 공개 메소드

Initializes the add-in engine.
The add-in engine needs to be initialized before doing any add-in operation. Configuration information about the add-in registry will be stored in the provided location. The add-in engine will look for add-ins in the provided 'addinsDir' directory. When specifying a path, it is possible to use a special folder name as root. For example: [Personal]/.config/MyApp. In this case, [Personal] will be replaced by the location of the Environment.SpecialFolder.Personal folder. Any value of the Environment.SpecialFolder enumeration can be used (always between square brackets)
public Initialize ( string configDir, string addinsDir ) : void
configDir string /// Location of the add-in registry. ///
addinsDir string /// Add-ins directory. If the path is relative, it is considered to be relative /// to the configDir directory. ///
리턴 void

Initialize() 공개 메소드

Initializes the add-in engine.
The add-in engine needs to be initialized before doing any add-in operation. Configuration information about the add-in registry will be stored in the provided location. The add-in engine will look for add-ins in the provided 'addinsDir' directory. Cached information about add-ins will be stored in the 'databaseDir' directory. When specifying a path, it is possible to use a special folder name as root. For example: [Personal]/.config/MyApp. In this case, [Personal] will be replaced by the location of the Environment.SpecialFolder.Personal folder. Any value of the Environment.SpecialFolder enumeration can be used (always between square brackets)
public Initialize ( string configDir, string addinsDir, string databaseDir ) : void
configDir string /// Location of the add-in registry. ///
addinsDir string /// Add-ins directory. If the path is relative, it is considered to be relative /// to the configDir directory. ///
databaseDir string /// Location of the add-in database. If the path is relative, it is considered to be relative /// to the configDir directory. ///
리턴 void

InitializeDefaultLocalizer() 공개 메소드

Sets the default localizer to be used for this add-in engine
public InitializeDefaultLocalizer ( IAddinLocalizer localizer ) : void
localizer IAddinLocalizer /// The add-in localizer ///
리턴 void

IsAddinLoaded() 공개 메소드

Checks if an add-in has been loaded.
public IsAddinLoaded ( string id ) : bool
id string /// Full identifier of the add-in. ///
리턴 bool

LoadAddin() 공개 메소드

Forces the loading of an add-in.
This method loads all assemblies that belong to an add-in in memory. All add-ins on which the specified add-in depends will also be loaded. Notice that in general add-ins don't need to be explicitly loaded using this method, since the add-in engine will load them on demand.
public LoadAddin ( IProgressStatus statusMonitor, string id ) : void
statusMonitor IProgressStatus /// Status monitor to keep track of the loading process. ///
id string /// Full identifier of the add-in to load. ///
리턴 void

Shutdown() 공개 메소드

Finalizes the add-in engine.
public Shutdown ( ) : void
리턴 void