Class ExtensionsClient
- Namespace
- RDCore.SDK.Extensibility
- Assembly
- RDCore.SDK.dll
An extensions provider service that manages the extensions of a RDCoreExtensionServerApp.
public class ExtensionsClient : IExtensionsProvider
- Inheritance
-
ExtensionsClient
- Implements
- Inherited Members
Constructors
ExtensionsClient(IOptions<SdkAppOptions>, IExtensionManifestValidationService, IFileSystem, IPlatformEnvironment, ILogger<ExtensionsClient>)
An extensions provider service that manages the extensions of a RDCoreExtensionServerApp.
public ExtensionsClient(IOptions<SdkAppOptions> options, IExtensionManifestValidationService validation, IFileSystem fileSystem, IPlatformEnvironment environment, ILogger<ExtensionsClient> logger)
Parameters
optionsIOptions<SdkAppOptions>The extensions configuration settings.
validationIExtensionManifestValidationServiceA service that validates an extension manifest.
fileSystemIFileSystemAbstracts the file system.
environmentIPlatformEnvironmentThe platform environment the extensions are found in.
loggerILogger<ExtensionsClient>The service's logger.
Methods
Allow(ExtensionInfo)
Enables the specified ExtensionInfo if the manifest and associated executable pass validation.
public bool Allow(ExtensionInfo extension)
Parameters
extensionExtensionInfoThe deserialized manifest of the extension to enable.
Returns
- bool
trueif the specified extension passed validation and was enabled,falseotherwise.
Block(ExtensionInfo)
Disables the specified ExtensionInfo.
public bool Block(ExtensionInfo extension)
Parameters
extensionExtensionInfoThe deserialized manifest of the extension to disable.
Returns
- bool
trueif the specified extension could be disabled,falseotherwise.
Describe(string, string)
Creates a serializable ExtensionInfo model for the specified extension executable name, with the specified description.
public ExtensionInfo? Describe(string name, string description)
Parameters
namestringThe file name of the extension's executable:
RDCore.Diagnostics.exeon Windows,RDCore.Diagnosticselsewhere. Its assembly is the.dllof the same name beside it.descriptionstringA short description of the extension.
Returns
- ExtensionInfo
nullif the specified extension cannot be described.
Remarks
The implementation validates that it is executing this method inside the target extension folder.
Discover()
Scans the extensions folder for subfolders containing an extension manifest.
public IEnumerable<ExtensionInfo> Discover()
Returns
- IEnumerable<ExtensionInfo>
Returns all discovered valid extensions.
Remarks
An extension is found only when its diagnostic prefix (DiagnosticPrefix) is its own, whatever the order of the folders:
RDCbelongs to the core extension, the one the platform manifest bundles (CoreExtension): another extension that declares it is not found;RDXis the first-party extensions' prefix, and the one prefix that several extensions may declare;- the language's own prefixes (
VBC,VBR,VBA) belong to the platform: an extension that declares one is not found; - when two extensions declare the same other prefix, neither is found;
- an extension whose prefix is not three letters
AtoZis not found.
A warning is logged for each extension that is not found because of its prefix.