Class ComponentAttribute
Defines a user interface component.
Implements
Inherited Members
Namespace: EPiServer.Shell.ViewComposition
Assembly: EPiServer.Shell.dll
Version: 8.11.0Syntax
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public class ComponentAttribute : Attribute, _Attribute
Remarks
This attribute will create a new instance of IComponentDefinition with the settings provided in the attribute properties.
Constructors
ComponentAttribute()
Initializes a new instance of the ComponentAttribute class.
Declaration
public ComponentAttribute()
Properties
AllowedRoles
Gets or sets the list of roles that are allowed to use this component.
Declaration
public string AllowedRoles { get; set; }
Property Value
Type | Description |
---|---|
System.String | The role list . |
Categories
A comma separated string of categories for the component.
Declaration
public virtual string Categories { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Description
Description of the component. Should be localized.
Declaration
public virtual string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String | The description. |
IsAvailableForUserSelection
Gets or sets a value indicating whether this component can be added in the ui by a user.
Declaration
public bool IsAvailableForUserSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
LanguagePath
Path to node in language files where translation can be found.
Declaration
public virtual 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 localization providers. (for instance an xml file in the /lang directory.)
Examples
For a LanguagePath with the value "/myshop/plugin/ShopPluginTree/" the XML should look something like this:
PlugInAreas
Gets or sets the plug in areas that the component should automatically plug into.
Declaration
public virtual string PlugInAreas { get; set; }
Property Value
Type | Description |
---|---|
System.String | The plug in areas. |
Remarks
The input should be in the format of a comma separated string if you want to plug into several areas.
Settings
Gets or sets the initial settings for components of this type.
Declaration
protected virtual ISettingsDictionary Settings { get; }
Property Value
Type | Description |
---|---|
ISettingsDictionary | The initial settings for components. |
SortOrder
Gets or sets the sort order for this component.
Declaration
public virtual int SortOrder { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Title
Title used in the UI both for listings and as default for component instances. Should be localized.
Declaration
public virtual string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String | The title. |
WidgetType
Name of the widget type to use for displaying the component.
Declaration
public virtual string WidgetType { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name of the widget type to use for displaying the component. |
Methods
CreateComponentDefinition(Type)
Creates the component definition.
Declaration
public virtual IComponentDefinition CreateComponentDefinition(Type attributedType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | attributedType | The System.Type of the component. |
Returns
Type | Description |
---|---|
IComponentDefinition | A new instance of a EPiServer.Shell.ViewComposition.DefaultComponentDefinition. |