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

Class PersonalizedViewSettingsManager

Provides methods to work with a user's view settings.

Inheritance
System.Object
PersonalizedViewSettingsManager
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.Shell.ViewComposition
Assembly: EPiServer.Shell.dll
Version: 9.12.2
Syntax
public class PersonalizedViewSettingsManager

Constructors

PersonalizedViewSettingsManager(IPersonalizedViewSettingsRepository, IViewManager)

Initializes a new instance of the PersonalizedViewSettingsManager class.

Declaration
public PersonalizedViewSettingsManager(IPersonalizedViewSettingsRepository repository, IViewManager viewManager)
Parameters
Type Name Description
IPersonalizedViewSettingsRepository repository

The personalized view settings repository.

IViewManager viewManager

The view manager.

Properties

Repository

Gets the repository.

Declaration
public IPersonalizedViewSettingsRepository Repository { get; }
Property Value
Type Description
IPersonalizedViewSettingsRepository

The repository.

Methods

DeleteComponent(IPrincipal, String, Guid)

Deletes a component with a given id for a specific user and view.

Declaration
public void DeleteComponent(IPrincipal principal, string viewName, Guid id)
Parameters
Type Name Description
System.Security.Principal.IPrincipal principal

The principal.

System.String viewName

Name of the view.

System.Guid id

The id of the component.

GetOrCreateCustomizedComponent(IPrincipal, String, Guid)

Either get's an already existing personalized component or personalizes the component hierarchy and adds it to the personalized view settings object.

Declaration
public IComponent GetOrCreateCustomizedComponent(IPrincipal principal, string viewName, Guid containerId)
Parameters
Type Name Description
System.Security.Principal.IPrincipal principal

The principal.

System.String viewName

Name of the view.

System.Guid containerId

The container's id.

Returns
Type Description
IComponent

A personalized IComponent object.

GetOrCreatePersonalizedComponent(IPrincipal, String, Guid, out PersonalizedViewSettings, out IContainer)

Either get's an already existing personalized component or creates a new one and adds it to the personalized view settings object.

Declaration
public IComponent GetOrCreatePersonalizedComponent(IPrincipal principal, string viewName, Guid componentId, out PersonalizedViewSettings personalizedViewSettings, out IContainer personalizationContainer)
Parameters
Type Name Description
System.Security.Principal.IPrincipal principal

The principal.

System.String viewName

Name of the view.

System.Guid componentId

The components's id.

PersonalizedViewSettings personalizedViewSettings

A reference to the personalized view settings object that the component is placed in or null.

IContainer personalizationContainer

The personalization container is one exists or null.

Returns
Type Description
IComponent

A personalized IComponent object.

GetUserSettings(String, IPrincipal, Boolean)

Get the persolized settings for the user.

Declaration
public PersonalizedViewSettings GetUserSettings(string viewName, IPrincipal principal, bool createIfItemDoesNotExist)
Parameters
Type Name Description
System.String viewName

The view to get the settings of.

System.Security.Principal.IPrincipal principal

The user.

System.Boolean createIfItemDoesNotExist

if set to true a new item will be returned if there is no matching item in the backing repository.

Returns
Type Description
PersonalizedViewSettings

The PersonalizedViewSettings for the specified user and view.

Extension Methods