Click or drag to resize
ExtensionAttribute Class
Base class extension attributes, defining extension points.
Inheritance Hierarchy

Namespace: Sdl.Core.PluginFramework
Assembly: Sdl.Core.PluginFramework (in Sdl.Core.PluginFramework.dll) Version: 1.8.0.0 (1.8.2687.0)
Syntax
public class ExtensionAttribute : Attribute

The ExtensionAttribute type exposes the following members.

Constructors
  NameDescription
Public methodExtensionAttribute
Default constructor for XML serialization.
Public methodExtensionAttribute(String, String, String)
Constructor with required attributes.
Top
Properties
  NameDescription
Public propertyDescription
Gets or sets the description of the extension.
Public propertyIcon
Gets or sets the resource key for an the icon representing this extension. Can be null.
Public propertyId
Gets or sets the unique id of the extension.
Public propertyName
Gets or sets the name of the extension.
Public propertyTypeId
When implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute.)
Top
Methods
  NameDescription
Public methodEquals
Returns a value that indicates whether this instance is equal to a specified object.
(Inherited from Attribute.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Returns the hash code for this instance.
(Inherited from Attribute.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsDefaultAttribute
When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
(Inherited from Attribute.)
Public methodMatch
When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
(Inherited from Attribute.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodValidate
Validates an extension targeting this extension point. This method is called by the framework while generating the plug-in manifest.
Protected methodValidateId
Validates the extension Id. Checks whether this is not null or empty.
Protected methodValidateName
Validates the extension Name. Checks whether this is not null or empty.
Top
Remarks

To define a new extension point, create a new attribute class, extending ExtensionAttribute. The class must be annotated with the ExtensionPointInfoAttribute attribute, which indicates that the class defines an extension point.

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 GetExtensionPointT, specifying the type of your extension attribute. For more information, see IExtensionPoint.

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 PluginResourceAttribute attribute. Users should now specify the name of the resource key, instead of the actual value, as the property value. When no resource string with the specified key can be found, the framework keeps the specified string as the property value. To define non-string properties whose value is stored in the PluginResources.resx resource file, create a string property, which value should be set to a resource key. When consuming the extension, use GetPluginResourceT(String) tio retriece the resource from the plug-in resource file.

See Also
Community
Edit

Be the first to Edit the community content of this topic.
Comments