C# Class Mono.Addins.AddinRegistry

Inheritance: IDisposable
Afficher le fichier Open project: mono/mono-addins Class Usage Examples

Private Properties

Свойство Type Description
AddinDependsOn bool
AddinRegistry System
CopyExtensionsFrom void
CreateHostAddinsFile bool
GetAddinForHostAssembly Addin
GetGlobalRegistry AddinRegistry
GetRegisteredStartupFolders string[]
NotifyDatabaseUpdated void
ParseAddin void
ScanFolders void

Méthodes publiques

Méthode Description
AddinRegistry ( string registryPath ) : System

Initializes a new instance.

Creates a new add-in registry located in the provided path. The add-in registry will look for add-ins in an 'addins' subdirectory of the provided registryPath. 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)

AddinRegistry ( string registryPath, string startupDirectory ) : System

Initializes a new instance.

Creates a new add-in registry located in the provided path. The add-in registry will look for add-ins in an 'addins' subdirectory of the provided registryPath. 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)

AddinRegistry ( string registryPath, string startupDirectory, string addinsDir ) : System

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

Creates a new add-in registry located in the provided path. Configuration information about the add-in registry will be stored in 'registryPath'. The add-in registry 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)

AddinRegistry ( string registryPath, string startupDirectory, string addinsDir, string databaseDir ) : System

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

Creates a new add-in registry located in the provided path. Configuration information about the add-in registry will be stored in 'registryPath'. The add-in registry 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)

DisableAddin ( string id ) : void

Disables an add-in.

When an add-in is disabled, all extension points it defines will be ignored by the add-in engine. Other add-ins which depend on the disabled add-in will also automatically be disabled.

DisableAddin ( string id, bool exactVersionMatch ) : void

Disables an add-in.

When an add-in is disabled, all extension points it defines will be ignored by the add-in engine. Other add-ins which depend on the disabled add-in will also automatically be disabled.

Dispose ( ) : void

Disposes the add-in engine.

DumpFile ( string file ) : void

Internal use only

EnableAddin ( string id ) : void

Enables an add-in.

If the enabled add-in depends on other add-ins which are disabled, those will automatically be enabled too.

GetAddin ( string id ) : Addin

Returns an add-in from the registry.

The add-in identifier may optionally include a version number, for example: "TextEditor.Xml,1.2"

GetAddin ( string id, bool exactVersionMatch ) : Addin

Returns an add-in from the registry.

The add-in identifier may optionally include a version number, for example: "TextEditor.Xml,1.2". In this case, if the exact version is not found and exactVersionMatch is 'false', it will return one than is compatible with the required version.

GetAddinDescription ( IProgressStatus progressStatus, string file ) : AddinDescription

Loads an add-in description

This method loads an add-in description from a file. The file can be an XML manifest or an assembly that implements an add-in.

GetAddinRoots ( ) : Mono.Addins.Addin[]

Gets all add-in roots registered in the registry.

GetAddins ( ) : Mono.Addins.Addin[]

Gets all add-ins registered in the registry.

GetGlobalRegistry ( ) : AddinRegistry

Gets the global registry.

The global add-in registry is created in "~/.config/mono.addins", and it is the default registry used when none is specified.

GetModules ( AddinSearchFlags flags ) : Mono.Addins.Addin[]

Gets all add-ins or add-in roots registered in the registry.

IsAddinEnabled ( string id ) : bool

Checks whether an add-in is enabled.

IsRegisteredForUninstall ( string addinId ) : bool

Determines whether an add-in is registered for uninstallation

ReadAddinManifestFile ( TextReader reader, string baseFile ) : AddinDescription

Reads an XML add-in manifest

ReadAddinManifestFile ( string file ) : AddinDescription

Reads an XML add-in manifest

Rebuild ( IProgressStatus monitor ) : void

Regenerates the cached data of the add-in registry.

RegisterExtension ( object extension ) : void

Registers an extension. Only AddinFileSystemExtension extensions are supported right now.

RegisterForUninstall ( string id, IEnumerable files ) : void

Registers a set of add-ins for uninstallation.

This method can be used to instruct the add-in manager to uninstall an add-in the next time the registry is updated. This is useful when an add-in manager can't delete an add-in because if it is loaded.

ResetConfiguration ( ) : void

Resets the configuration files of the registry

UnregisterExtension ( object extension ) : void

Unregisters an extension.

Update ( ) : void

Updates the add-in registry.

This method must be called after modifying, installing or uninstalling add-ins. When calling Update, every add-in added to the registry is parsed and validated, and if there is any error it will be rejected. It will also cache add-in information needed at run-time. If during the update operation the registry finds new add-ins or detects that some add-ins have been deleted, the loaded extension points will be updated to include or exclude extension nodes from those add-ins.

Update ( IProgressStatus monitor ) : void

Updates the add-in registry.

This method must be called after modifying, installing or uninstalling add-ins. When calling Update, every add-in added to the registry is parsed and validated, and if there is any error it will be rejected. It will also cache add-in information needed at run-time. If during the update operation the registry finds new add-ins or detects that some add-ins have been deleted, the loaded extension points will be updated to include or exclude extension nodes from those add-ins.

Private Methods

Méthode Description
AddinDependsOn ( string id1, string id2 ) : bool
AddinRegistry ( AddinEngine engine, string registryPath, string startupDirectory, string addinsDir, string databaseDir ) : System
CopyExtensionsFrom ( AddinRegistry other ) : void
CreateHostAddinsFile ( string hostFile ) : bool
GetAddinForHostAssembly ( string filePath ) : Addin
GetGlobalRegistry ( AddinEngine engine, string startupDirectory ) : AddinRegistry
GetRegisteredStartupFolders ( string registryPath ) : string[]
NotifyDatabaseUpdated ( ) : void
ParseAddin ( IProgressStatus progressStatus, string file, string outFile ) : void
ScanFolders ( IProgressStatus monitor, string folderToScan, StringCollection filesToIgnore ) : void

Method Details

AddinRegistry() public méthode

Initializes a new instance.
Creates a new add-in registry located in the provided path. The add-in registry will look for add-ins in an 'addins' subdirectory of the provided registryPath. 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 AddinRegistry ( string registryPath ) : System
registryPath string /// Location of the add-in registry. ///
Résultat System

AddinRegistry() public méthode

Initializes a new instance.
Creates a new add-in registry located in the provided path. The add-in registry will look for add-ins in an 'addins' subdirectory of the provided registryPath. 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 AddinRegistry ( string registryPath, string startupDirectory ) : System
registryPath string /// Location of the add-in registry. ///
startupDirectory string /// Location of the application. ///
Résultat System

AddinRegistry() public méthode

Initializes a new instance of the Mono.Addins.AddinRegistry class.
Creates a new add-in registry located in the provided path. Configuration information about the add-in registry will be stored in 'registryPath'. The add-in registry 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 AddinRegistry ( string registryPath, string startupDirectory, string addinsDir ) : System
registryPath string /// Location of the add-in registry. ///
startupDirectory string /// Location of the application. ///
addinsDir string /// Add-ins directory. If the path is relative, it is considered to be relative /// to the configDir directory. ///
Résultat System

AddinRegistry() public méthode

Initializes a new instance of the Mono.Addins.AddinRegistry class.
Creates a new add-in registry located in the provided path. Configuration information about the add-in registry will be stored in 'registryPath'. The add-in registry 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 AddinRegistry ( string registryPath, string startupDirectory, string addinsDir, string databaseDir ) : System
registryPath string /// Location of the add-in registry. ///
startupDirectory string /// Location of the application. ///
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. ///
Résultat System

DisableAddin() public méthode

Disables an add-in.
When an add-in is disabled, all extension points it defines will be ignored by the add-in engine. Other add-ins which depend on the disabled add-in will also automatically be disabled.
public DisableAddin ( string id ) : void
id string /// Identifier of the add-in. ///
Résultat void

DisableAddin() public méthode

Disables an add-in.
When an add-in is disabled, all extension points it defines will be ignored by the add-in engine. Other add-ins which depend on the disabled add-in will also automatically be disabled.
public DisableAddin ( string id, bool exactVersionMatch ) : void
id string /// Identifier of the add-in. ///
exactVersionMatch bool /// If true, it disables the add-in that exactly matches the provided version. If false, it disables /// all versions of add-ins with the same Id ///
Résultat void

Dispose() public méthode

Disposes the add-in engine.
public Dispose ( ) : void
Résultat void

DumpFile() public méthode

Internal use only
public DumpFile ( string file ) : void
file string
Résultat void

EnableAddin() public méthode

Enables an add-in.
If the enabled add-in depends on other add-ins which are disabled, those will automatically be enabled too.
public EnableAddin ( string id ) : void
id string /// Identifier of the add-in ///
Résultat void

GetAddin() public méthode

Returns an add-in from the registry.
The add-in identifier may optionally include a version number, for example: "TextEditor.Xml,1.2"
public GetAddin ( string id ) : Addin
id string /// Identifier of the add-in. ///
Résultat Addin

GetAddin() public méthode

Returns an add-in from the registry.
The add-in identifier may optionally include a version number, for example: "TextEditor.Xml,1.2". In this case, if the exact version is not found and exactVersionMatch is 'false', it will return one than is compatible with the required version.
public GetAddin ( string id, bool exactVersionMatch ) : Addin
id string /// Identifier of the add-in. ///
exactVersionMatch bool /// 'true' if the exact add-in version must be found. ///
Résultat Addin

GetAddinDescription() public méthode

Loads an add-in description
This method loads an add-in description from a file. The file can be an XML manifest or an assembly that implements an add-in.
public GetAddinDescription ( IProgressStatus progressStatus, string file ) : AddinDescription
progressStatus IProgressStatus /// Progress tracker. ///
file string /// Name of the file to load ///
Résultat Mono.Addins.Description.AddinDescription

GetAddinRoots() public méthode

Gets all add-in roots registered in the registry.
public GetAddinRoots ( ) : Mono.Addins.Addin[]
Résultat Mono.Addins.Addin[]

GetAddins() public méthode

Gets all add-ins registered in the registry.
public GetAddins ( ) : Mono.Addins.Addin[]
Résultat Mono.Addins.Addin[]

GetGlobalRegistry() public static méthode

Gets the global registry.
The global add-in registry is created in "~/.config/mono.addins", and it is the default registry used when none is specified.
public static GetGlobalRegistry ( ) : AddinRegistry
Résultat AddinRegistry

GetModules() public méthode

Gets all add-ins or add-in roots registered in the registry.
public GetModules ( AddinSearchFlags flags ) : Mono.Addins.Addin[]
flags AddinSearchFlags /// Flags. ///
Résultat Mono.Addins.Addin[]

IsAddinEnabled() public méthode

Checks whether an add-in is enabled.
public IsAddinEnabled ( string id ) : bool
id string /// Identifier of the add-in. ///
Résultat bool

IsRegisteredForUninstall() public méthode

Determines whether an add-in is registered for uninstallation
public IsRegisteredForUninstall ( string addinId ) : bool
addinId string /// Identifier of the add-in ///
Résultat bool

ReadAddinManifestFile() public méthode

Reads an XML add-in manifest
public ReadAddinManifestFile ( TextReader reader, string baseFile ) : AddinDescription
reader System.IO.TextReader /// Reader that contains the XML ///
baseFile string /// Base path to use to discover add-in files ///
Résultat Mono.Addins.Description.AddinDescription

ReadAddinManifestFile() public méthode

Reads an XML add-in manifest
public ReadAddinManifestFile ( string file ) : AddinDescription
file string /// Path to the XML file ///
Résultat Mono.Addins.Description.AddinDescription

Rebuild() public méthode

Regenerates the cached data of the add-in registry.
public Rebuild ( IProgressStatus monitor ) : void
monitor IProgressStatus /// Progress monitor to keep track of the rebuild operation. ///
Résultat void

RegisterExtension() public méthode

Registers an extension. Only AddinFileSystemExtension extensions are supported right now.
public RegisterExtension ( object extension ) : void
extension object /// The extension to register ///
Résultat void

RegisterForUninstall() public méthode

Registers a set of add-ins for uninstallation.
This method can be used to instruct the add-in manager to uninstall an add-in the next time the registry is updated. This is useful when an add-in manager can't delete an add-in because if it is loaded.
public RegisterForUninstall ( string id, IEnumerable files ) : void
id string /// Identifier of the add-in ///
files IEnumerable /// Files to be uninstalled ///
Résultat void

ResetConfiguration() public méthode

Resets the configuration files of the registry
public ResetConfiguration ( ) : void
Résultat void

UnregisterExtension() public méthode

Unregisters an extension.
public UnregisterExtension ( object extension ) : void
extension object /// The extension to unregister ///
Résultat void

Update() public méthode

Updates the add-in registry.
This method must be called after modifying, installing or uninstalling add-ins. When calling Update, every add-in added to the registry is parsed and validated, and if there is any error it will be rejected. It will also cache add-in information needed at run-time. If during the update operation the registry finds new add-ins or detects that some add-ins have been deleted, the loaded extension points will be updated to include or exclude extension nodes from those add-ins.
public Update ( ) : void
Résultat void

Update() public méthode

Updates the add-in registry.
This method must be called after modifying, installing or uninstalling add-ins. When calling Update, every add-in added to the registry is parsed and validated, and if there is any error it will be rejected. It will also cache add-in information needed at run-time. If during the update operation the registry finds new add-ins or detects that some add-ins have been deleted, the loaded extension points will be updated to include or exclude extension nodes from those add-ins.
public Update ( IProgressStatus monitor ) : void
monitor IProgressStatus /// Progress monitor to keep track of the update operation. ///
Résultat void