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

Interface ICriterion

Interface for visitor group criteria

Namespace: EPiServer.Personalization.VisitorGroups
Assembly: EPiServer.Framework.AspNet.dll
Version: 11.20.7
Syntax
public interface ICriterion
Remarks

Do not implement this interface, instead use the CriterionBase<T> class.

Methods

Initialize(VisitorGroupCriterion)

Initializes the criterion with its previously stored settings

Declaration
void Initialize(VisitorGroupCriterion visitorGroupCriterion)
Parameters
Type Name Description
VisitorGroupCriterion visitorGroupCriterion

The stored instance of this criterion.

IsMatch(IPrincipal, HttpContextBase)

Determines whether the specified principal and/or context matches the criteria.

Declaration
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 match; otherwise, false.

Subscribe(ICriterionEvents)

Called when a criterion instance is initialized. An instance has here the opportunity to subscribe to desired events.

Declaration
void Subscribe(ICriterionEvents criterionEvents)
Parameters
Type Name Description
ICriterionEvents criterionEvents

The criterion notifier.

Remarks

Any event subscribed to in this method should be unsubscribed in method Unsubscribe. The reason for this is that otherwise there will be "dangling" event handlers.

Unsubscribe(ICriterionEvents)

Called when a criterion is unloaded, for example because it seetings has been updated. Here any events subscribed to in method Subscribe should be unsubscribed to to avoid "dangling" event handlers.

Declaration
void Unsubscribe(ICriterionEvents criterionEvents)
Parameters
Type Name Description
ICriterionEvents criterionEvents

The criterion notifier.

Extension Methods