Class PlugInDescriptor
Describes a plug-in at runtime without having to create it.
Inheritance
Namespace: EPiServer.PlugIn
Assembly: EPiServer.dll
Version: 12.0.3Syntax
public class PlugInDescriptor : Object
Constructors
PlugInDescriptor(Int32, String, String)
Initializes a new instance of the Plug
Declaration
public PlugInDescriptor(int id, string typeName, string assemblyName)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The id. |
System. |
typeName | Name of the plug-in type. |
System. |
assemblyName | Name of the assembly where the type resides. |
PlugInDescriptor(Int32, String, String, Boolean)
Initializes a new instance of the Plug
Declaration
public PlugInDescriptor(int id, string typeName, string assemblyName, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The id. |
System. |
typeName | Name of the plug-in type. |
System. |
assemblyName | Name of the assembly where the type resides. |
System. |
enabled | if set to |
PlugInDescriptor(Int32, String, String, DateTime, DateTime, Boolean)
Initializes a new instance of the Plug
Declaration
public PlugInDescriptor(int id, string typeName, string assemblyName, DateTime saved, DateTime created, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The id. |
System. |
typeName | Name of the plug-in type. |
System. |
assemblyName | Name of the assembly where the type resides. |
System. |
saved | The date/time when this plug-in descriptor was saved. |
System. |
created | The date/time when this plug-in descriptor was created. |
System. |
enabled | if set to |
PlugInDescriptor(Int32, Type)
Initializes a new instance of the Plug
Declaration
public PlugInDescriptor(int id, Type type)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The id. |
System. |
type | The type of the plug-in. |
PlugInDescriptor(Int32, Type, Boolean)
Initializes a new instance of the Plug
Declaration
public PlugInDescriptor(int id, Type type, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The id. |
System. |
type | The type of the plug-in. |
System. |
enabled | if set to |
PlugInDescriptor(Int32, Type, DateTime, DateTime, Boolean)
Initializes a new instance of the Plug
Declaration
public PlugInDescriptor(int id, Type type, DateTime saved, DateTime created, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The id. |
System. |
type | The type of the plug-in. |
System. |
saved | The date/time when this plug-in descriptor was saved. |
System. |
created | The date/time when this plug-in descriptor was created. |
System. |
enabled | if set to |
Properties
AssemblyName
The name of the assembly.
Declaration
public string AssemblyName { get; }
Property Value
Type | Description |
---|---|
System. |
ConstructorParameterResolver
Gets or sets the constructor paramter resolver.
Declaration
public Injected<ConstructorParameterResolver> ConstructorParameterResolver { get; set; }
Property Value
Type | Description |
---|---|
Injected<Constructor |
Created
Timestamp when the record was created in the database.
Declaration
public DateTime Created { get; }
Property Value
Type | Description |
---|---|
System. |
Enabled
Whether the PlugIn is enabled or not.
Declaration
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
System. |
ID
The identifier assigned by EPiServer to this plug-in.
Declaration
public int ID { get; }
Property Value
Type | Description |
---|---|
System. |
IsAutoGenerated
If this type is located in an autogenerated assembly.
Declaration
public bool IsAutoGenerated { get; set; }
Property Value
Type | Description |
---|---|
System. |
PlugInType
The System.
Declaration
public Type PlugInType { get; }
Property Value
Type | Description |
---|---|
System. |
Saved
Timestamp when the record was last saved in the database.
Declaration
public DateTime Saved { get; }
Property Value
Type | Description |
---|---|
System. |
TypeName
The name of the class.
Declaration
public string TypeName { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
add_PlugInDescriptorSaved(PlugInDescriptor.PlugInDescriptorEventHandler)
Declaration
public static void add_PlugInDescriptorSaved(PlugInDescriptor.PlugInDescriptorEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
Plug |
value |
Create()
Create an instance of the plug-in.
Declaration
public object Create()
Returns
Type | Description |
---|---|
System. |
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. |
plugInAttributeType | The type for plugin attribute. |
Returns
Type | Description |
---|---|
Plug |
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 |
---|---|---|
Plug |
plugins | The plugin's to read from. |
System. |
plugInAttributeType | The type for plugin attribute. |
Returns
Type | Description |
---|---|
Plug |
GetAttributes()
Get all plug-in attributes.
Declaration
public PlugInAttribute[] GetAttributes()
Returns
Type | Description |
---|---|
Plug |
Load(Int32)
Load plugin information based on a plug-in ID.
Declaration
public static PlugInDescriptor Load(int id)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The id for the plugin. |
Returns
Type | Description |
---|---|
Plug |
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. |
typeName | The type for the plugin. |
System. |
assemblyName | The short assembly name for the plugin. |
Returns
Type | Description |
---|---|
Plug |
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. |
typeName | The type for the plugin. |
System. |
assemblyName | The short assembly name for the plugin. |
System. |
defaultEnabled | Tells if the plugin will be enabled by default |
Returns
Type | Description |
---|---|
Plug |
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. |
plugin | The type for the plugin. |
Returns
Type | Description |
---|---|
Plug |
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. |
remove_PlugInDescriptorSaved(PlugInDescriptor.PlugInDescriptorEventHandler)
Declaration
public static void remove_PlugInDescriptorSaved(PlugInDescriptor.PlugInDescriptorEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
Plug |
value |
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 |
---|---|
Plug |