Try our conversational search powered by Generative AI!

Class CriterionBase<T>

An abstract class for a visitor group criterion using strongly typed settings and automatically generated user interface

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 abstract class CriterionBase<T> : ICriterion, IGeneratesAdministrativeInterface where T : class, ICriterionModel, new()
Type Parameters
Name Description
T

The type of model/settings to operate on.

Constructors

CriterionBase()

Declaration
protected CriterionBase()

Properties

Model

Gets the model for this criterian instance.

Declaration
public T Model { get; }
Property Value
Type Description
T

The model.

Methods

Initialize(VisitorGroupCriterion)

Initializes the criterion with the provided settings or creates new settings.

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

The stored visitor group for this criterion.

IsMatch(IPrincipal, HttpContextBase)

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

Declaration
public abstract 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
public virtual 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
public virtual void Unsubscribe(ICriterionEvents criterionEvents)
Parameters
Type Name Description
ICriterionEvents criterionEvents

The criterion notifier.

Explicit Interface Implementations

IGeneratesAdministrativeInterface.ModelType

This class supports the EPiServer infrastructure and is not intended to be used directly from your code.

Declaration
Type IGeneratesAdministrativeInterface.ModelType { get; }
Returns
Type Description
System.Type
Remarks

This is basically a way for the rendering runtime to get hold of the generic type that was specified for the model as part of this class.

Implements

Extension Methods