Class ComponentDefinitionBase
Helper base class for component definitions
Implements
Inherited Members
Namespace: EPiServer.Shell.ViewComposition
Assembly: EPiServer.Shell.dll
Version: 8.11.0Syntax
public abstract class ComponentDefinitionBase : PluggableComponentDefinitionBase, IComponentDefinition, IPluggableComponentDefinition, IContainerMatcher, IEquatable<IComponentDefinition>
Constructors
ComponentDefinitionBase(String)
Initializes a new instance of the ComponentDefinitionBase class.
Declaration
protected ComponentDefinitionBase(string widgetType)
Parameters
Type | Name | Description |
---|---|---|
System.String | widgetType | The type of the widget used for displaying the component. |
ComponentDefinitionBase(String, LocalizationService)
Initializes a new instance of the ComponentDefinitionBase class using a LocalizationService.
Declaration
protected ComponentDefinitionBase(string widgetType, LocalizationService localizationService)
Parameters
Type | Name | Description |
---|---|---|
System.String | widgetType | The type of the widget used for displaying the component. |
LocalizationService | localizationService | The service used for localization. |
ComponentDefinitionBase(String, String, String)
Initializes a new instance of the ComponentDefinitionBase class with a title and description
Declaration
protected ComponentDefinitionBase(string widgetType, string title, string description)
Parameters
Type | Name | Description |
---|---|---|
System.String | widgetType | The type of the widget used for displaying the component. |
System.String | title | The title |
System.String | description | The description |
Properties
Categories
Gets or sets the category for this component. Default implementation returns an empty string;
Declaration
public IEnumerable<string> Categories { get; protected set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | The category. |
DefinitionName
Unique name of the definition.
Declaration
public virtual string DefinitionName { get; }
Property Value
Type | Description |
---|---|
System.String | The unique name that is used to create new IComponents from the IComponentProviders. |
Description
Description of the component.
Declaration
public virtual string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String | The description. |
Remarks
If the LanguagePath property has been defined, the return value for Description will be the translated text from LanguagePath + "/description".
LanguagePath
Path to node in language files where translation can be found.
Declaration
public 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:
LocalizationService
The service used for localization.
Declaration
protected LocalizationService LocalizationService { get; }
Property Value
Type | Description |
---|---|
LocalizationService |
Remarks
If this is not set the static instance Current will be used.
Settings
Gets or sets the initial settings for components of this type.
Declaration
public virtual ISettingsDictionary Settings { get; }
Property Value
Type | Description |
---|---|
ISettingsDictionary | The initial settings for components. |
SortOrder
Gets the sort order.
Declaration
public int SortOrder { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Title
The title for the component.
Declaration
public virtual string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string with the title. |
Remarks
If a LanguagePath has been defined, the return value for DisplayName will be the translated text from LanguagePath + "/title".
WidgetType
Name of the widget type to use for displaying the component.
Declaration
public string WidgetType { get; protected set; }
Property Value
Type | Description |
---|---|
System.String | The name of the widget type to use for displaying the component. |
Methods
CreateComponent()
Creates the component corresponding to this component definition.
Declaration
public override IComponent CreateComponent()
Returns
Type | Description |
---|---|
IComponent | A new instance of an IComponent. |
Overrides
Remarks
This method does not perform any access control validation.
CreateComponent(Type)
Creates a EPiServer.Shell.ViewComposition.DefaultComponent instance.
Declaration
protected IComponent CreateComponent(Type attributedType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | attributedType | Type of the attributed component. |
Returns
Type | Description |
---|---|
IComponent | A EPiServer.Shell.ViewComposition.DefaultComponent instance |
Equals(IComponentDefinition)
Compares this instance to another IComponentDefinition instanse.
Declaration
public bool Equals(IComponentDefinition other)
Parameters
Type | Name | Description |
---|---|---|
IComponentDefinition | other | The other instance. |
Returns
Type | Description |
---|---|
System.Boolean | True if both instances are have the same name |