Configurable add-ins are a method for adding custom inputs to various extensibility points in DynamicWeb 10, typically providers and scheduled task add-ins, both of which will only contain functionality and you have no way of configuring it from the administration.
However, if you create your provider as a Configurable Add-in you can add UI elements to the provider. A provider will function as a Configurable Add-in by inheriting from the ConfigurableAddIn class:
using Dynamicweb.Extensibility.AddIns;
namespace Examples
{
[AddInName("MyProvider"), AddInDescription("Custom provider description")]
public class MyProvider : ConfigurableAddIn
{
}
}
| Attribute | Description |
|---|---|
| AddInActive | Defines if the add-in is active |
| AddInAuthor | Defines the the author of an add-in. |
| AddInDeprecated | Indicates if an add-in is deprecated, meaning that it can still be used, but it will no longer be selectable from the administration |
| AddInDescription | Provides a description of the add-in |
| AddInIcon | Used to provide an icon to an add-in |
| AddInIgnore | Does the same as AddInDeprecated |
| AddInLabel | Used to provide a name of the add-in |
| AddInName | Used to provide a name of the add-in |
| AddInOrder | Provides a sorting of the individual add-ins |
| AddInTarget | Defines the the place where an add-in should be displayed. |
If you then need to add some configurable to your provider, you do it by adding attributes to your properties, which gives information about how it should look in the UI.
using Dynamicweb.Extensibility.AddIns;
using Dynamicweb.Extensibility.Editors;
namespace Examples
{
[AddInName("MyProviderWithParameters"), AddInDescription("Custom provider description with parameters")]
public class MyProviderWithParameters : ConfigurableAddIn
{
[AddInParameter("My Property")]
[AddInParameterEditor(typeof(TextParameterEditor), "")]
public string MyProperty { get; set; }
}
}
DynamicWeb will then make sure to save the configuration, and fill out the correct value next time the provider is loaded.
We have a bunch of different attributes that you can use to decorate your properties:
| Attribute | Description |
|---|---|
| AddInParameter | Used to provide a name of your configuration parameter, which will be shown in the UI |
| AddInParameterEditor | Used to define which editor should be used for this parameter. A list of available editor types can be found here |
| AddInParameterGroup | Used to group parameters together in a named Group. All properties with the same name in this attribute will be listed together |
| AddInUseParameterGrouping | Defines if the AddInParameterGroup is active or not |
| AddInParameterOrder | Used to define the order of the parameters using a number value. |
| AddInUseParameterOrdering | Defines if the custom parameter ordering from the AddInParameterOrder attribute is used |