Class DisplayChannelService
Service that handles DisplayChannel instances.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Web
Assembly: EPiServer.dll
Version: 7.19.2Syntax
public class DisplayChannelService : IInitializableModuleConstructors
DisplayChannelService()
Initializes a new instance of the DisplayChannelService class.
Declaration
public DisplayChannelService()Properties
Channels
Gets all registered channels.
Declaration
public virtual IList<DisplayChannel> Channels { get; }Property Value
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<DisplayChannel> | The channels. | 
EditPath
Gets the edit path Sets the edit path. Main purpose forusing it in tests.
Declaration
public string EditPath { get; set; }Property Value
| Type | Description | 
|---|---|
| System.String | 
PrincipalInfoCreator
Delegate to make PrincipalInfo testable
Declaration
public Func<IPrincipal, PrincipalInfo> PrincipalInfoCreator { get; set; }Property Value
| Type | Description | 
|---|---|
| System.Func<System.Security.Principal.IPrincipal, PrincipalInfo> | 
Methods
GetActiveChannels(HttpContextBase)
Gets all DisplayChannel instances that are considered active for specified context.
Declaration
public virtual IEnumerable<DisplayChannel> GetActiveChannels(HttpContextBase context)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Web.HttpContextBase | context | The context. | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<DisplayChannel> | 
Initialize(InitializationEngine)
Initializes this instance.
Declaration
public void Initialize(InitializationEngine context)Parameters
| Type | Name | Description | 
|---|---|---|
| InitializationEngine | context | The context. | 
Remarks
Gets called as part of the EPiServer Framework initialization sequence. Note that it will be called only once per AppDomain, unless the method throws an exception. If an exception is thrown, the initialization method will be called repeadetly for each request reaching the site until the method succeeds.
Initialize(ITypeScannerLookup, IServiceLocator)
Initializes a new instance of the DisplayChannelService class.
Declaration
public virtual void Initialize(ITypeScannerLookup typeScanner, IServiceLocator serviceLocator)Parameters
| Type | Name | Description | 
|---|---|---|
| ITypeScannerLookup | typeScanner | The type scanner. | 
| IServiceLocator | serviceLocator | The service locator. | 
Preload(String[])
Preloads the module.
Declaration
public void Preload(string[] parameters)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String[] | parameters | The parameters. | 
Remarks
This method is only available to be compatible with "AlwaysRunning" applications in .NET 4 / IIS 7. It currently serves no purpose.
RegisterDisplayMode(IDisplayMode)
Registers an System.Web.WebPages.IDisplayMode instance as an DisplayChannel.
Declaration
public virtual void RegisterDisplayMode(IDisplayMode displayMode)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Web.WebPages.IDisplayMode | displayMode | The display mode. | 
Examples
The following example shows the registration of a simple channel for MVC that is active for mobile request.
RegisterDisplayMode(IDisplayMode, Int32)
Registers an System.Web.WebPages.IDisplayMode instance as an DisplayChannel.
Declaration
public virtual void RegisterDisplayMode(IDisplayMode displayMode, int index)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Web.WebPages.IDisplayMode | displayMode | The display mode. | 
| System.Int32 | index | The index of where the instance is registered. | 
Examples
The following example shows the registration of a simple channel for MVC that is active for mobile request.
RegisterDisplayMode(IDisplayMode, Int32, String)
Registers an System.Web.WebPages.IDisplayMode instance as an DisplayChannel.
Declaration
public virtual void RegisterDisplayMode(IDisplayMode displayMode, int index, string resolutionId)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Web.WebPages.IDisplayMode | displayMode | The display mode. | 
| System.Int32 | index | The index of where the instance is registered. | 
| System.String | resolutionId | The resolution id. | 
Examples
The following example shows the registration of a simple channel for MVC that is active for mobile request.
Uninitialize(InitializationEngine)
Resets the module into an uninitialized state.
Declaration
public void Uninitialize(InitializationEngine context)Parameters
| Type | Name | Description | 
|---|---|---|
| InitializationEngine | context | The context. | 
Remarks
This method is usually not called when running under a web application since the web app may be shut down very abruptly, but your module should still implement it properly since it will make integration and unit testing much simpler.
Any work done by Initialize(InitializationEngine) as well as any code executing on InitComplete should be reversed.
