November Happy Hour will be moved to Thursday December 5th.

Class PlugInAttribute

The base class for all specialized plug-in types

Implements
System.Runtime.InteropServices._Attribute
Inherited Members
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo)
System.Attribute.GetCustomAttributes(System.Reflection.MemberInfo, System.Boolean)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.MemberInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.ParameterInfo, System.Boolean)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type)
System.Attribute.IsDefined(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.ParameterInfo, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Module)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Module, System.Type)
System.Attribute.IsDefined(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Module, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly)
System.Attribute.GetCustomAttributes(System.Reflection.Assembly, System.Boolean)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type)
System.Attribute.IsDefined(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type)
System.Attribute.GetCustomAttribute(System.Reflection.Assembly, System.Type, System.Boolean)
System.Attribute.Equals(System.Object)
System.Attribute.GetHashCode()
System.Attribute.Match(System.Object)
System.Attribute.IsDefaultAttribute()
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfoCount(System.UInt32)
System.Attribute.System.Runtime.InteropServices._Attribute.GetTypeInfo(System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.GetIDsOfNames(System.Guid, System.IntPtr, System.UInt32, System.UInt32, System.IntPtr)
System.Attribute.System.Runtime.InteropServices._Attribute.Invoke(System.UInt32, System.Guid, System.UInt32, System.Int16, System.IntPtr, System.IntPtr, System.IntPtr, System.IntPtr)
System.Attribute.TypeId
System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.PlugIn
Assembly: EPiServer.dll
Version: 9.12.2
Syntax
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

true if enabled by default; otherwise, false.

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.

Implements

System.Runtime.InteropServices._Attribute

Extension Methods