Try our conversational search powered by Generative AI!

Class PlugInDescriptor

Describes a plug-in at runtime without having to create it.

Inheritance
System.Object
PlugInDescriptor
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.PlugIn
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public class PlugInDescriptor

Constructors

PlugInDescriptor(Int32, String, String)

Initializes a new instance of the PlugInDescriptor class.

Declaration
public PlugInDescriptor(int id, string typeName, string assemblyName)
Parameters
Type Name Description
System.Int32 id

The id.

System.String typeName

Name of the plug-in type.

System.String assemblyName

Name of the assembly where the type resides.

PlugInDescriptor(Int32, String, String, Boolean)

Initializes a new instance of the PlugInDescriptor class.

Declaration
public PlugInDescriptor(int id, string typeName, string assemblyName, bool enabled)
Parameters
Type Name Description
System.Int32 id

The id.

System.String typeName

Name of the plug-in type.

System.String assemblyName

Name of the assembly where the type resides.

System.Boolean enabled

if set to true the plug-in is enabled, otherwise the plug-in is disabled.

PlugInDescriptor(Int32, String, String, DateTime, DateTime, Boolean)

Initializes a new instance of the PlugInDescriptor class.

Declaration
public PlugInDescriptor(int id, string typeName, string assemblyName, DateTime saved, DateTime created, bool enabled)
Parameters
Type Name Description
System.Int32 id

The id.

System.String typeName

Name of the plug-in type.

System.String assemblyName

Name of the assembly where the type resides.

System.DateTime saved

The date/time when this plug-in descriptor was saved.

System.DateTime created

The date/time when this plug-in descriptor was created.

System.Boolean enabled

if set to true the plug-in is enabled, otherwise the plug-in is disabled.

PlugInDescriptor(Int32, Type)

Initializes a new instance of the PlugInDescriptor class.

Declaration
public PlugInDescriptor(int id, Type type)
Parameters
Type Name Description
System.Int32 id

The id.

System.Type type

The type of the plug-in.

PlugInDescriptor(Int32, Type, Boolean)

Initializes a new instance of the PlugInDescriptor class.

Declaration
public PlugInDescriptor(int id, Type type, bool enabled)
Parameters
Type Name Description
System.Int32 id

The id.

System.Type type

The type of the plug-in.

System.Boolean enabled

if set to true the plug-in is enabled, otherwise the plug-in is disabled.

PlugInDescriptor(Int32, Type, DateTime, DateTime, Boolean)

Initializes a new instance of the PlugInDescriptor class.

Declaration
public PlugInDescriptor(int id, Type type, DateTime saved, DateTime created, bool enabled)
Parameters
Type Name Description
System.Int32 id

The id.

System.Type type

The type of the plug-in.

System.DateTime saved

The date/time when this plug-in descriptor was saved.

System.DateTime created

The date/time when this plug-in descriptor was created.

System.Boolean enabled

if set to true the plug-in is enabled, otherwise the plug-in is disabled.

Properties

AssemblyName

The name of the assembly.

Declaration
public string AssemblyName { get; }
Property Value
Type Description
System.String

ConstructorParameterResolver

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets or sets the constructor paramter resolver.

Declaration
public Injected<ConstructorParameterResolver> ConstructorParameterResolver { get; set; }
Property Value
Type Description
Injected<ConstructorParameterResolver>

Created

Timestamp when the record was created in the database.

Declaration
public DateTime Created { get; }
Property Value
Type Description
System.DateTime

Enabled

Whether the PlugIn is enabled or not.

Declaration
public bool Enabled { get; set; }
Property Value
Type Description
System.Boolean

ID

The identifier assigned by EPiServer to this plug-in.

Declaration
public int ID { get; }
Property Value
Type Description
System.Int32

IsAutoGenerated

If this type is located in an autogenerated assembly.

Declaration
public bool IsAutoGenerated { get; set; }
Property Value
Type Description
System.Boolean

PlugInType

The System.Type for the plug-in.

Declaration
public Type PlugInType { get; }
Property Value
Type Description
System.Type

Saved

Timestamp when the record was last saved in the database.

Declaration
public DateTime Saved { get; }
Property Value
Type Description
System.DateTime

TypeName

The name of the class.

Declaration
public string TypeName { get; }
Property Value
Type Description
System.String

Methods

Create()

Create an instance of the plug-in.

Declaration
public object Create()
Returns
Type Description
System.Object

The plug-in.

GetAttribute(Type)

Get a plug-in attribute of a special type.

Declaration
public virtual PlugInAttribute GetAttribute(Type plugInAttributeType)
Parameters
Type Name Description
System.Type plugInAttributeType

The type for plugin attribute.

Returns
Type Description
PlugInAttribute

GetAttribute<T>()

Get a plug-in attribute of a special type.

Declaration
public virtual T GetAttribute<T>()
    where T : PlugInAttribute
Returns
Type Description
T
Type Parameters
Name Description
T

GetAttributeArray(PlugInDescriptor[], Type)

Get all PlugInAttribute of a given type from a array of PlugInDescriptor.

Declaration
public static PlugInAttribute[] GetAttributeArray(PlugInDescriptor[] plugins, Type plugInAttributeType)
Parameters
Type Name Description
PlugInDescriptor[] plugins

The plugin's to read from.

System.Type plugInAttributeType

The type for plugin attribute.

Returns
Type Description
PlugInAttribute[]

GetAttributes()

Get all plug-in attributes.

Declaration
public PlugInAttribute[] GetAttributes()
Returns
Type Description
PlugInAttribute[]

Load(Int32)

Load plugin information based on a plug-in ID.

Declaration
public static PlugInDescriptor Load(int id)
Parameters
Type Name Description
System.Int32 id

The id for the plugin.

Returns
Type Description
PlugInDescriptor

Load(String, String)

Load plugin information based on the type of the plug-in.

Declaration
public static PlugInDescriptor Load(string typeName, string assemblyName)
Parameters
Type Name Description
System.String typeName

The type for the plugin.

System.String assemblyName

The short assembly name for the plugin.

Returns
Type Description
PlugInDescriptor

A descriptor for the plugin.

Remarks

This method does not cache the loading of a plugin.

Load(String, String, Boolean)

Load plugin information based on the type of the plug-in.

Declaration
public static PlugInDescriptor Load(string typeName, string assemblyName, bool defaultEnabled)
Parameters
Type Name Description
System.String typeName

The type for the plugin.

System.String assemblyName

The short assembly name for the plugin.

System.Boolean defaultEnabled

Tells if the plugin will be enabled by default

Returns
Type Description
PlugInDescriptor

A descriptor for the plugin.

Remarks

This method does not cache the loading of a plugin.

Load(Type)

Load plugin information based on the type of the plug-in.

Declaration
public static PlugInDescriptor Load(Type plugin)
Parameters
Type Name Description
System.Type plugin

The type for the plugin.

Returns
Type Description
PlugInDescriptor

A descriptor for the plug-in or null if the type is not decorated with any plug-in attribute.

LoadAll()

Load all plugins information from database.

Declaration
public static IEnumerable<PlugInDescriptor> LoadAll()
Returns
Type Description
System.Collections.Generic.IEnumerable<PlugInDescriptor>

Save()

Save plugin descriptor.

Declaration
public void Save()

Events

PlugInDescriptorSaved

Occurs when the plug in descriptor has been saved.

Declaration
public static event PlugInDescriptor.PlugInDescriptorEventHandler PlugInDescriptorSaved
Event Type
Type Description
PlugInDescriptor.PlugInDescriptorEventHandler

Extension Methods