November Happy Hour will be moved to Thursday December 5th.

Class VisitorGroupRole

The VisitorGroupRole class holds a VisitorGroup and its VisitorGroupCriterion collection.

Inheritance
System.Object
VisitorGroupRole
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.Personalization.VisitorGroups
Assembly: EPiServer.Framework.AspNet.dll
Version: 11.20.7
Syntax
public class VisitorGroupRole : VirtualRoleProviderBase, IInitializableVirtualRole

Constructors

VisitorGroupRole()

Initializes a new instance of the VisitorGroupRole class.

Declaration
public VisitorGroupRole()

VisitorGroupRole(IVisitorGroupRepository)

Initializes a new instance of the VisitorGroupRole class.

Declaration
[Obsolete("Use alternative constructor")]
public VisitorGroupRole(IVisitorGroupRepository visitorGroupRepository)
Parameters
Type Name Description
IVisitorGroupRepository visitorGroupRepository

The visitor group repository.

VisitorGroupRole(IVisitorGroupRepository, IVisitorGroupStatisticsLogger)

Initializes a new instance of the VisitorGroupRole class.

Declaration
[Obsolete("Use alternative constructor")]
public VisitorGroupRole(IVisitorGroupRepository visitorGroupRepository, IVisitorGroupStatisticsLogger visitorGroupStatisticsLogger)
Parameters
Type Name Description
IVisitorGroupRepository visitorGroupRepository

The visitor group repository.

IVisitorGroupStatisticsLogger visitorGroupStatisticsLogger

The visitor group statistics logger.

VisitorGroupRole(VisitorGroup, IVisitorGroupRepository)

Initializes a new instance of the VisitorGroupRole class.

Declaration
[Obsolete("Use alternative constructor")]
public VisitorGroupRole(VisitorGroup visitorGroup, IVisitorGroupRepository visitorGroupRepository)
Parameters
Type Name Description
VisitorGroup visitorGroup

The visitor group.

IVisitorGroupRepository visitorGroupRepository

The visitor group repository.

VisitorGroupRole(VisitorGroup, IVisitorGroupRepository, IVisitorGroupStatisticsLogger)

Initializes a new instance of the VisitorGroupRole class.

Declaration
[Obsolete("Use alternative constructor")]
public VisitorGroupRole(VisitorGroup visitorGroup, IVisitorGroupRepository visitorGroupRepository, IVisitorGroupStatisticsLogger visitorGroupStatisticsLogger)
Parameters
Type Name Description
VisitorGroup visitorGroup

The visitor group.

IVisitorGroupRepository visitorGroupRepository

The visitor group repository.

IVisitorGroupStatisticsLogger visitorGroupStatisticsLogger

The visitor group statistics logger.

VisitorGroupRole(VisitorGroup, IVisitorGroupRepository, IVisitorGroupStatisticsLogger, ICriterionFactory, IAggregatedPersonalizationEvaluator)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes a new instance of the VisitorGroupRole class.

Declaration
public VisitorGroupRole(VisitorGroup visitorGroup, IVisitorGroupRepository visitorGroupRepository, IVisitorGroupStatisticsLogger visitorGroupStatisticsLogger, ICriterionFactory criterionFactory, IAggregatedPersonalizationEvaluator personalizationEvaluator)
Parameters
Type Name Description
VisitorGroup visitorGroup

The visitor group.

IVisitorGroupRepository visitorGroupRepository

The visitor group repository.

IVisitorGroupStatisticsLogger visitorGroupStatisticsLogger

The visitor group statistics logger.

ICriterionFactory criterionFactory

The criterion factory

IAggregatedPersonalizationEvaluator personalizationEvaluator

The personalization evaluator

Fields

ImpersonatedVisitorGroupByID

Key to httpContext Items to get array of impersonated groups id for current request

Declaration
public const string ImpersonatedVisitorGroupByID = "ImpersonatedVisitorGroupsById"
Field Value
Type Description
System.String

ImpersonatedVisitorGroupByName

Key to httpContext Items to get array of impersonated groups name for current request

Declaration
public const string ImpersonatedVisitorGroupByName = "ImpersonatedVisitorGroupsByName"
Field Value
Type Description
System.String

VisitorGroupKeyByID

Query string key to set impersonation to visitor groups by id

Declaration
public const string VisitorGroupKeyByID = "visitorgroupsByID"
Field Value
Type Description
System.String

VisitorGroupKeyByName

Query string key to set impersonation to visitor groups by name

Declaration
public const string VisitorGroupKeyByName = "visitorgroupsByName"
Field Value
Type Description
System.String

Properties

ID

Gets the ID for the visitor group which is wrapped by virtual Role provider.

Declaration
public virtual Guid ID { get; }
Property Value
Type Description
System.Guid

The ID.

Name

Gets the friendly name used to refer to the provider during configuration.

Declaration
public override string Name { get; }
Property Value
Type Description
System.String
Overrides

StatisticsLogger

Gets the visitor group statistics logger.

Declaration
protected IVisitorGroupStatisticsLogger StatisticsLogger { get; }
Property Value
Type Description
IVisitorGroupStatisticsLogger

The visitor group statistics logger.

VisitorGroupRepository

Declaration
protected IVisitorGroupRepository VisitorGroupRepository { get; }
Property Value
Type Description
IVisitorGroupRepository

Methods

AddVisitorGroupStatistics(Boolean, HttpContextBase)

Adds statistics for visitor groups if statistics is enabled.

Declaration
public virtual void AddVisitorGroupStatistics(bool isMatch, HttpContextBase httpContext)
Parameters
Type Name Description
System.Boolean isMatch

if set to true [is match].

System.Web.HttpContextBase httpContext

The HTTP context.

GetRepository()

Returns the globally used repository for storing visitor groups

Declaration
[Obsolete("Get IVisitorGroupRoleRepository/IVisitorGroupRepository from the IOC container.")]
public static VisitorGroupRoleRepository GetRepository()
Returns
Type Description
VisitorGroupRoleRepository

Initialize(String)

Initializes the provider.

Declaration
public void Initialize(string name)
Parameters
Type Name Description
System.String name

The friendly name of the provider.

Initialize(String, NameValueCollection)

Initializes the provider.

Declaration
public override void Initialize(string name, NameValueCollection config)
Parameters
Type Name Description
System.String name

The friendly name of the provider.

System.Collections.Specialized.NameValueCollection config

A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider.

Overrides
Exceptions
Type Condition
System.ArgumentNullException

The name of the provider is null.

System.ArgumentException

The name of the provider has a length of zero.

System.InvalidOperationException

An attempt is made to call System.Configuration.Provider.ProviderBase.Initialize(System.String,System.Collections.Specialized.NameValueCollection) on a provider after the provider has already been initialized.

IsInVirtualRole(IPrincipal, Object)

Determines whether the specified principal is a member of this role.

Declaration
public override bool IsInVirtualRole(IPrincipal principal, object context)
Parameters
Type Name Description
System.Security.Principal.IPrincipal principal

The principal.

System.Object context

The object context.

Returns
Type Description
System.Boolean

true if the specified principal is in the virtual role; otherwise, false.

Overrides
Remarks

The context parameter may be null but can be used to transfer external context to a Virtual role provider.

IsMatch(IPrincipal, HttpContextBase)

Determines whether the specified principal is a member of this role.

Declaration
public bool IsMatch(IPrincipal principal, HttpContextBase httpContext)
Parameters
Type Name Description
System.Security.Principal.IPrincipal principal

The principal.

System.Web.HttpContextBase httpContext

The HTTP context.

Returns
Type Description
System.Boolean

true if the specified principal is in the virtual role; otherwise, false.

Remarks

The context parameter may be null but can be used to transfer external context to a Virtual role provider

Implements

Extension Methods