Class ExtensionAttribute
Base class extension attributes, defining extension points.
Namespace: Sdl.Core.PluginFramework
Assembly: Sdl.Core.PluginFramework.dll
Syntax
public class ExtensionAttribute : Attribute
Remarks
To define a new extension point, create a new attribute class, extending Extension
Users can now create new extension classes annotated with the new extension attribute, and implementing a specified interface.
To get access to all the extensions registered with your extension point, use GetExtensionPoint<T>(), specifying
the type of your extension attribute. For more information, see IExtension
When the plug-in manifest is generated, instances of the extension attribute are saved in the plug-in manifest using XML serialization. For that reason, make sure your extension attribute supports this (e.g. add a default constructor).
The framework also provides support for getting property values from the PluginResources.resx resource file, which is deployed together with the plug-in manifest.
To specify that the value of a certain string property needs to be retrieved from the resource file, annotate the property definition with the Plugin
Constructors
ExtensionAttribute()
Default constructor for XML serialization.
Declaration
public ExtensionAttribute()
Remarks
To define a new extension point, create a new attribute class, extending Extension
Users can now create new extension classes annotated with the new extension attribute, and implementing a specified interface.
To get access to all the extensions registered with your extension point, use GetExtensionPoint<T>(), specifying
the type of your extension attribute. For more information, see IExtension
When the plug-in manifest is generated, instances of the extension attribute are saved in the plug-in manifest using XML serialization. For that reason, make sure your extension attribute supports this (e.g. add a default constructor).
The framework also provides support for getting property values from the PluginResources.resx resource file, which is deployed together with the plug-in manifest.
To specify that the value of a certain string property needs to be retrieved from the resource file, annotate the property definition with the Plugin
ExtensionAttribute(String, String, String)
Constructor with required attributes.
Declaration
public ExtensionAttribute(string id, string name, string description)
Parameters
Type | Name | Description |
---|---|---|
String | id | The unique id for the extension. |
String | name | The name for the extension. Should typically be a key of a resource string in PluginResources.resx. |
String | description | The description for the extension. Should typically be a key of a resource string in PluginResources.resx. |
Remarks
To define a new extension point, create a new attribute class, extending Extension
Users can now create new extension classes annotated with the new extension attribute, and implementing a specified interface.
To get access to all the extensions registered with your extension point, use GetExtensionPoint<T>(), specifying
the type of your extension attribute. For more information, see IExtension
When the plug-in manifest is generated, instances of the extension attribute are saved in the plug-in manifest using XML serialization. For that reason, make sure your extension attribute supports this (e.g. add a default constructor).
The framework also provides support for getting property values from the PluginResources.resx resource file, which is deployed together with the plug-in manifest.
To specify that the value of a certain string property needs to be retrieved from the resource file, annotate the property definition with the Plugin
Properties
Description
Gets or sets the description of the extension.
Declaration
[PluginResource]
public string Description { get; set; }
Property Value
Type | Description |
---|---|
String |
Remarks
Should typically be a key of a resource string in PluginResources.resx.
Icon
Gets or sets the resource key for an the icon representing this extension. Can be null.
Declaration
public string Icon { get; set; }
Property Value
Type | Description |
---|---|
String |
Remarks
To define a new extension point, create a new attribute class, extending Extension
Users can now create new extension classes annotated with the new extension attribute, and implementing a specified interface.
To get access to all the extensions registered with your extension point, use GetExtensionPoint<T>(), specifying
the type of your extension attribute. For more information, see IExtension
When the plug-in manifest is generated, instances of the extension attribute are saved in the plug-in manifest using XML serialization. For that reason, make sure your extension attribute supports this (e.g. add a default constructor).
The framework also provides support for getting property values from the PluginResources.resx resource file, which is deployed together with the plug-in manifest.
To specify that the value of a certain string property needs to be retrieved from the resource file, annotate the property definition with the Plugin
Id
Gets or sets the unique id of the extension.
Declaration
public string Id { get; set; }
Property Value
Type | Description |
---|---|
String |
Remarks
To define a new extension point, create a new attribute class, extending Extension
Users can now create new extension classes annotated with the new extension attribute, and implementing a specified interface.
To get access to all the extensions registered with your extension point, use GetExtensionPoint<T>(), specifying
the type of your extension attribute. For more information, see IExtension
When the plug-in manifest is generated, instances of the extension attribute are saved in the plug-in manifest using XML serialization. For that reason, make sure your extension attribute supports this (e.g. add a default constructor).
The framework also provides support for getting property values from the PluginResources.resx resource file, which is deployed together with the plug-in manifest.
To specify that the value of a certain string property needs to be retrieved from the resource file, annotate the property definition with the Plugin
Name
Gets or sets the name of the extension.
Declaration
[PluginResource]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
String |
Remarks
Should typically be a key of a resource string in PluginResources.resx.
Methods
Validate(IExtensionAttributeInfo, IExtensionValidationContext)
Validates an extension targeting this extension point. This method is called by the framework while generating the plug-in manifest.
Declaration
public virtual void Validate(IExtensionAttributeInfo info, IExtensionValidationContext context)
Parameters
Type | Name | Description |
---|---|---|
IExtension |
info | Information about the extension. |
IExtension |
context | Provides functionality to validate extensions targeting the extension point and report warning or error messages |
Remarks
To define a new extension point, create a new attribute class, extending Extension
Users can now create new extension classes annotated with the new extension attribute, and implementing a specified interface.
To get access to all the extensions registered with your extension point, use GetExtensionPoint<T>(), specifying
the type of your extension attribute. For more information, see IExtension
When the plug-in manifest is generated, instances of the extension attribute are saved in the plug-in manifest using XML serialization. For that reason, make sure your extension attribute supports this (e.g. add a default constructor).
The framework also provides support for getting property values from the PluginResources.resx resource file, which is deployed together with the plug-in manifest.
To specify that the value of a certain string property needs to be retrieved from the resource file, annotate the property definition with the Plugin
ValidateId(IExtensionAttributeInfo, IExtensionValidationContext)
Validates the extension Id. Checks whether this is not null or empty.
Declaration
protected virtual void ValidateId(IExtensionAttributeInfo info, IExtensionValidationContext context)
Parameters
Type | Name | Description |
---|---|---|
IExtension |
info | Information about the extension. |
IExtension |
context | Provides functionality to validate extensions targeting the extension point and report warning or error messages |
Remarks
To define a new extension point, create a new attribute class, extending Extension
Users can now create new extension classes annotated with the new extension attribute, and implementing a specified interface.
To get access to all the extensions registered with your extension point, use GetExtensionPoint<T>(), specifying
the type of your extension attribute. For more information, see IExtension
When the plug-in manifest is generated, instances of the extension attribute are saved in the plug-in manifest using XML serialization. For that reason, make sure your extension attribute supports this (e.g. add a default constructor).
The framework also provides support for getting property values from the PluginResources.resx resource file, which is deployed together with the plug-in manifest.
To specify that the value of a certain string property needs to be retrieved from the resource file, annotate the property definition with the Plugin
ValidateName(IExtensionAttributeInfo, IExtensionValidationContext)
Validates the extension Name. Checks whether this is not null or empty.
Declaration
protected virtual void ValidateName(IExtensionAttributeInfo info, IExtensionValidationContext context)
Parameters
Type | Name | Description |
---|---|---|
IExtension |
info | Information about the extension. |
IExtension |
context | Provides functionality to validate extensions targeting the extension point and report warning or error messages |
Remarks
To define a new extension point, create a new attribute class, extending Extension
Users can now create new extension classes annotated with the new extension attribute, and implementing a specified interface.
To get access to all the extensions registered with your extension point, use GetExtensionPoint<T>(), specifying
the type of your extension attribute. For more information, see IExtension
When the plug-in manifest is generated, instances of the extension attribute are saved in the plug-in manifest using XML serialization. For that reason, make sure your extension attribute supports this (e.g. add a default constructor).
The framework also provides support for getting property values from the PluginResources.resx resource file, which is deployed together with the plug-in manifest.
To specify that the value of a certain string property needs to be retrieved from the resource file, annotate the property definition with the Plugin