Class PluginAttribute
This attribute is required so that the type finder can create the instance of the subtype that implements the contract.
Inherited Members
Namespace: CPlugin.Net
Assembly: CPlugin.Net.Attributes.dll
Syntax
[AttributeUsage(AttributeTargets.Assembly, Inherited = false, AllowMultiple = true)]
public class PluginAttribute : Attribute
Remarks
Example:
IPluginStartup
represents the contract and can reside in its own project called App.Contracts
.
Each plugin must implement the contract in this way:
class Startup : IPluginStartup { }
And then add this line before the namespace declaration:
[assembly: Plugin(typeof(Startup))]
Constructors
Name | Description |
---|---|
PluginAttribute(Type) | Initializes a new instance of the PluginAttribute class. |
Properties
Name | Description |
---|---|
PluginType | Gets an instance of type Type that implements the contract. |