Class PlugInAttribute
The base class for all specialized plug-in types
Inheritance
Implements
Inherited Members
Namespace: EPiServer.PlugIn
Assembly: EPiServer.dll
Version: 9.12.2Syntax
public abstract class PlugInAttribute : Attribute, _Attribute
Remarks
When an area that support plug-ins executes in EPiServer it will search for files in the bin directory and their containing classes for an attribute called PlugInAttribute. The PlugInAttribute is only a base class for all specialized plug-in types and is not actually used anywhere to define a plug-in, only to search and match plug-ins that used attributes derived from PlugInAttribute.
The class that handles searching is PlugInLocator, probably you don’t need to use this class unless you are implementing your own plug-in support. It returns a array of PlugInDescriptor classes, PlugInDescriptor contains information about the PlugInAttribute definition and the plug-in id that was assigned to the plug-in in this installation.
Constructors
PlugInAttribute()
Initializes a new instance of the PlugInAttribute class.
Declaration
protected PlugInAttribute()
PlugInAttribute(String, String)
Initializes a new instance of the PlugInAttribute class.
Declaration
protected PlugInAttribute(string displayName, string description)
Parameters
Type | Name | Description |
---|---|---|
System.String | displayName | The name of the plug-in. |
System.String | description | The description for the plug-in. |
Remarks
Unless the LanguagePath property is explicitly set, the DisplayName and Description properties will always return the literal values assigned here, but if you assign a value to LanguagePath the LocalizationService will be used to translate the texts.
PlugInAttribute(String, String, String)
Initializes a new instance of the PlugInAttribute class.
Declaration
protected PlugInAttribute(string displayName, string description, string languagePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | displayName | The name of the plug-in. |
System.String | description | The description for the plug-in. |
System.String | languagePath | The language path for translation support. |
Remarks
See DisplayName and Description properties for more information about how the languagePath
is used.
Properties
DefaultEnabled
Declaration
public bool DefaultEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
If not set the value of this property is 'true'.
Description
Description of the plugin
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String | The description. |
Remarks
If a LanguagePath has been defined, the return value for Description will be the translated text from LanguagePath + "/description"
DisplayName
The display name for the plugin.
Declaration
public string DisplayName { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string with the display name. |
Remarks
If a LanguagePath has been defined, the return value for DisplayName will be the translated text from LanguagePath + "/displayname"
LanguagePath
Path to node in language files where translation can be found.
Declaration
public string LanguagePath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Set this property to the path of the XML element that contains the displayname and description elements in one of your language files (an xml file in the /lang directory.)
Examples
For a LanguagePath with the value "/myshop/plugin/ShopPluginTree/" the XML should look something like this:
<languages>
<language name="English" id="EN">
<myshop>
<plugin>
<ShopPluginTree>
<displayname>My shop</displayname>
<description>Description of shopping tab</description>
</ShopPluginTree>
</plugin>
</myshop>
</language>
</languages>
PlugInType
Gets or sets the plug-in type that is decorated with this attribute. This property is normally set by plug-in system during runtime, but can be overriden explicitly by plug-in developer.
Declaration
public Type PlugInType { get; }
Property Value
Type | Description |
---|---|
System.Type | Plug-in type. |
RequireLicenseForLoad
Determine if the plugin requires a valid license to be loaded.
Declaration
public bool RequireLicenseForLoad { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True if license is required. |
Remarks
If true, the PlugInLocator will try to load and validate a license for the assembly that the plugin is defined in, before allowing the plugin to be instantiated.
SortIndex
The sort index compared to other plugins
Declaration
public int SortIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
SetPlugInType(Type)
Sets the type of the plug-in.
Declaration
public void SetPlugInType(Type plugInType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | plugInType | Type of the plug-in. |