Interface IDisplayChannelService
Service that handles DisplayChannel instances.
Namespace: EPiServer.Web
Assembly: EPiServer.dll
Version: 9.12.2Syntax
public interface IDisplayChannelService
Properties
Channels
Gets all registered channels.
Declaration
IList<DisplayChannel> Channels { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IList<DisplayChannel> |
Remarks
The property is not thread safe meaning all modifications should occour during Initialization.
Methods
GetActiveChannels(HttpContextBase)
Gets all DisplayChannel instances that are considered active for specified context.
Declaration
IEnumerable<DisplayChannel> GetActiveChannels(HttpContextBase context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Web.HttpContextBase | context |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<DisplayChannel> |
RegisterDisplayMode(IDisplayMode, Int32, String)
Registers an System.Web.WebPages.IDisplayMode instance as an DisplayChannel.
Declaration
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.
public void Initialize(EPiServer.Framework.Initialization.InitializationEngine context)
{
context.Locate.DisplayChannelService()
.RegisterDisplayMode(new DefaultDisplayMode(RenderingTags.Mobile)
{
ContextCondition = (r) => r.Request.Browser.IsMobileDevice
});
}