Class GadgetDefinition
Definition of a gadget
Inheritance
Inherited Members
Namespace: EPiServer.Shell.Gadgets
Assembly: EPiServer.Shell.dll
Version: 8.11.0Syntax
public class GadgetDefinition
Constructors
GadgetDefinition(String, String, Type, String, GadgetAction[])
Initializes a new instance of the GadgetDefinition class.
Declaration
public GadgetDefinition(string name, string title, Type controllerType, string defaultAction, params GadgetAction[] actions)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the gadget. Used as an identifier. |
System.String | title | The title of the gadget. Used for display. |
System.Type | controllerType | The controller responsible for this gadget. |
System.String | defaultAction | The default action. |
GadgetAction[] | actions | Avaliable actions for this gadget. |
Properties
Actions
List of aviable actions on the gadget
Declaration
public IList<GadgetAction> Actions { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<GadgetAction> |
Area
Used when the application is located within a virtual path.
Declaration
public string Area { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
Virtual path is ~/Shell/CMS then the area should be CMS
Category
Gets or sets the category associated with this gadget. Used for determining where in the UI the gadget can be added.
Declaration
public string Category { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ClientLocalizationDependencies
List of client localization routeValues that the gadget requires
Declaration
public IList<object> ClientLocalizationDependencies { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<System.Object> |
ClientResourceDependencies
List of client resources relative urls that gadget requires
Declaration
public IList<ClientResource> ClientResourceDependencies { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<ClientResource> |
ClientScriptInitMethod
The name of a javascript function for gadget initialization. Called when the gadget is instantiated.
Declaration
public string ClientScriptInitMethod { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ControllerName
The ASP.NET MVC Controller name without the "Controller" suffix
Declaration
public string ControllerName { get; }
Property Value
Type | Description |
---|---|
System.String |
ControllerType
The ASP.NET MVC Controller Type
Declaration
public Type ControllerType { get; set; }
Property Value
Type | Description |
---|---|
System.Type |
DefaultAction
The ASP.NET MVC Controller action that provides the default view of gadget. Default is "Index".
Declaration
public string DefaultAction { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Description
The description of the gadget type. This appears in the add gadget list
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DescriptionResourceKey
Gets or sets the description resource key.
Declaration
public string DescriptionResourceKey { get; set; }
Property Value
Type | Description |
---|---|
System.String | The description resource key. |
IconUrl
The name of the static resource wrapper property that provides the URL for the icon image.
Declaration
public string IconUrl { get; set; }
Property Value
Type | Description |
---|---|
System.String |
IsAvailable
The delegate responsible for determining the gadgets avaliability in a certain context.
Declaration
public Func<RequestContext, bool> IsAvailable { get; set; }
Property Value
Type | Description |
---|---|
System.Func<System.Web.Routing.RequestContext, System.Boolean> |
Name
The name of the gadget type. Used as an identifier, must be unique among gadgets.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
NameResourceKey
Gets or sets the name resource key.
Declaration
public string NameResourceKey { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name resource key. |
ResourceType
Gets or sets the type that is used to resolve localized resources.
Declaration
public Type ResourceType { get; set; }
Property Value
Type | Description |
---|---|
System.Type | The type that is used to resolve localized resources. |
Title
The title of the gadget type. This appears in the add gadget list, and in the title bar of the gadget on the dashboard.
Declaration
public string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String |