SaaS CMS has officially launched! Learn more now.

Class GadgetFactory

Implementation of a IGadgetFactory. Provides methods to create Gadget instances.

Inheritance
System.Object
GadgetFactory
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Shell.Gadgets
Assembly: EPiServer.Shell.dll
Version: 10.10.4
Syntax
[ServiceConfiguration(typeof(IGadgetFactory), Lifecycle = ServiceInstanceScope.Singleton)]
[Obsolete("The Episerver gadget framework has been deprecated and was replaced by the Episerver Components.")]
public class GadgetFactory : IGadgetFactory

Constructors

GadgetFactory(IGadgetDefinitionProvider[])

Initializes a new instance of the GadgetFactory class.

Declaration
public GadgetFactory(IGadgetDefinitionProvider[] providers)
Parameters
Type Name Description
IGadgetDefinitionProvider[] providers

Methods

Create(String)

Create a GadgetDefinition for a gadget name

Declaration
public GadgetDefinition Create(string gadgetName)
Parameters
Type Name Description
System.String gadgetName

Name of the gadget.

Returns
Type Description
GadgetDefinition
Exceptions
Type Condition
System.ArgumentNullException
System.ArgumentException

CreateGadgetFromTemplate(Guid)

Creates a gadget from template.

Declaration
public Gadget CreateGadgetFromTemplate(Guid gadgetTemplateId)
Parameters
Type Name Description
System.Guid gadgetTemplateId

The gadget template ID.

Returns
Type Description
Gadget

A new Gadget copied from the template.

Exceptions
Type Condition
System.ArgumentException

GetGadgetTemplates()

Gets the available gadget templates.

Declaration
public IEnumerable<Gadget> GetGadgetTemplates()
Returns
Type Description
System.Collections.Generic.IEnumerable<Gadget>

Events

CreatingGadgetDefinition

Occurs when IGadgetFactory.Create method called.

Declaration
public event EventHandler<GadgetDefinitionEventArgs> CreatingGadgetDefinition
Event Type
Type Description
System.EventHandler<GadgetDefinitionEventArgs>

GettingGadgetTemplates

Occurs when IGadgetFactory.GetGadgetTemplates method called.

Declaration
public event EventHandler<GadgetTemplatesEventArgs> GettingGadgetTemplates
Event Type
Type Description
System.EventHandler<GadgetTemplatesEventArgs>

Implements

Extension Methods