Table of Contents

Class CMSActionContext

Namespace
CMS.Base
Assembly
CMS.Base.dll

Ensures context for the actions block.

public sealed class CMSActionContext : AbstractActionContext<CMSActionContext>, IDataContainer, ISimpleDataContainer, IContext, IVirtualHierarchicalObject, IHierarchicalObject, INameIndexable, ICloneThreadItem
Inheritance
object
CMSActionContext
Implements
Inherited Members
Extension Methods

Examples

using(var ctx = new CMSActionContext() { LogEvents = false }) { DoSomeAction(); }

Constructors

CMSActionContext()

Constructor

public CMSActionContext()

CMSActionContext(IUserInfo)

Constructor. Ensures that all actions during the life of this object will use the given user context.

public CMSActionContext(IUserInfo user)

Parameters

user IUserInfo

User to use within all actions

Properties

AllowAsyncActions

Indicates if the actions can run asynchronously. Default is true, if the application is web site, otherwise false.

public bool AllowAsyncActions { set; }

Property Value

bool

AllowInitUser

Indicates if the current user should be initialized.

public bool AllowInitUser { set; }

Property Value

bool

ContinuousIntegrationAllowObjectSerialization

Configures if object serialization within continuous integration is allowed in the given context

public bool ContinuousIntegrationAllowObjectSerialization { set; }

Property Value

bool

CurrentAllowAsyncActions

Indicates if the actions can run asynchronously. Default is true.

public static bool CurrentAllowAsyncActions { get; }

Property Value

bool

CurrentAllowInitUser

Indicates if the current user should be initialized.

public static bool CurrentAllowInitUser { get; }

Property Value

bool

CurrentContinuousIntegrationAllowObjectSerialization

Indicates if object serialization within continuous integration is allowed in the given context

public static bool CurrentContinuousIntegrationAllowObjectSerialization { get; }

Property Value

bool

CurrentDeletePhysicalFiles

Indicates whether a physical files should be deleted for meta files and media files.

public static bool CurrentDeletePhysicalFiles { get; }

Property Value

bool

CurrentDisconnected

Indicates if the objects within current context should behave as disconnected

public static bool CurrentDisconnected { get; }

Property Value

bool

CurrentEnableLogContext

Indicates whether logging through log context (LogContext) is currently enabled.

public static bool CurrentEnableLogContext { get; }

Property Value

bool

CurrentLogEvents

Indicates if the events should be logged within the context.

public static bool CurrentLogEvents { get; }

Property Value

bool

CurrentLogWebFarmTasks

Indicates if the web farm tasks should be logged within the context.

public static bool CurrentLogWebFarmTasks { get; }

Property Value

bool

CurrentResetChanges

Indicates whether the changes made to the object instance should be reseted.

public static bool CurrentResetChanges { get; }

Property Value

bool

CurrentSendEmails

Indicates if the emails should be sent.

public static bool CurrentSendEmails { get; }

Property Value

bool

CurrentTouchCacheDependencies

Indicates if the objects cache dependencies should be touched within the context.

public static bool CurrentTouchCacheDependencies { get; }

Property Value

bool

CurrentUpdateSystemFields

Indicates if the system fields should be updated.

public static bool CurrentUpdateSystemFields { get; }

Property Value

bool

CurrentUpdateTimeStamp

Indicates if the objects time stamps should be updated within the context.

public static bool CurrentUpdateTimeStamp { get; }

Property Value

bool

CurrentUseGlobalAdminContext

Indicates if global admin context should be used.

public static bool CurrentUseGlobalAdminContext { get; }

Property Value

bool

CurrentUser

Current user of the context.

public static IUserInfo CurrentUser { get; set; }

Property Value

IUserInfo

DeletePhysicalFiles

Indicates whether a physical files should be deleted for meta files and media files.

public bool DeletePhysicalFiles { set; }

Property Value

bool

Disconnected

Indicates if the objects within current context should behave as disconnected

public bool Disconnected { set; }

Property Value

bool

EnableLogContext

Indicates whether logging through log context (LogContext) is currently enabled.

public bool EnableLogContext { set; }

Property Value

bool

LogEvents

Indicates if the events should be logged.

public bool LogEvents { set; }

Property Value

bool

LogWebFarmTasks

Indicates if the web farm tasks should be logged.

public bool LogWebFarmTasks { set; }

Property Value

bool

ResetChanges

Indicates whether the changes made to the object instance should be reseted.

public bool ResetChanges { set; }

Property Value

bool

SendEmails

Indicates if email should be sent.

public bool SendEmails { set; }

Property Value

bool

ThreadCulture

Current thread culture.

public CultureInfo ThreadCulture { set; }

Property Value

CultureInfo

TouchCacheDependencies

Indicates if the objects cache dependencies should be touched.

public bool TouchCacheDependencies { set; }

Property Value

bool

UpdateSystemFields

Indicates if the system fields should be updated.

public bool UpdateSystemFields { set; }

Property Value

bool

UpdateTimeStamp

Indicates if the objects time stamps should be updated.

public bool UpdateTimeStamp { set; }

Property Value

bool

UseGlobalAdminContext

Indicates if global admin context should be used.

public bool UseGlobalAdminContext { set; }

Property Value

bool

User

User of the context.

public IUserInfo User { set; }

Property Value

IUserInfo

Methods

CloneForNewThread()

Clones the object for the new thread

public override object CloneForNewThread()

Returns

object

DisableAll()

Disables all automated actions except for the ones necessary to keep the system consistent

Disables: Logging for event log, web farm tasks and cache dependencies Timestamp update Object invalidation Cache usage Asynchronous actions Sending of emails Smart search indexing

Does not disable: Object serialization

public CMSActionContext DisableAll()

Returns

CMSActionContext

DisableLogging()

Disables logging of event log.

public CMSActionContext DisableLogging()

Returns

CMSActionContext

RestoreOriginalValues()

Restores the original values to the context

protected override void RestoreOriginalValues()