Class ExecutingContext
- Namespace
- Dynamicweb.Environment
- Assembly
- Dynamicweb.Core.dll
Provides static members for Dynamicweb environment variables.
public sealed class ExecutingContext
- Inheritance
-
ExecutingContext
- Inherited Members
Methods
GetCulture()
Gets the culture of the current execution context.
public static CultureInfo GetCulture()
Returns
- CultureInfo
CultureInfo instance.
Remarks
If called from a frontend pipeline, it returns the CultureInfo of the current thread which is set by the regional settings of the website instance that belongs to the pageview. If it is called before the website is detected, before PageView.Load(), the system culture is returned.
If called from a backend context, it returns a CultureInfo based on the current backend language if the user is logged in.
If called from another context, i.e. a http handler or a context where there is not pageview, no logged in user or no session, InvariantCulture is returned.
GetCulture(bool)
Gets the culture of the current execution context.
public static CultureInfo GetCulture(bool frontEnd)
Parameters
frontEndboolif set to
true, return the CultureInfo that is currently being used in the pageview. If this is set to true and a pageview instance is not present,CurrentCultureis returned.
Returns
- CultureInfo
CultureInfo instance.
Remarks
If called from a frontend pipeline, it returns the CultureInfo of the current thread which is set by the regional settings of the website instance that belongs to the pageview. If it is called before the website is detected, before PageView.Load(), the system culture is returned.
If called from a backend context, it returns a CultureInfo based on the current backend language if the user is logged in.
If called from another context, i.e. a http handler or a context where there is not pageview, no logged in user or no session, InvariantCulture is returned.
IsBackEnd()
Gets a value indicating whether the current code is being executed in the administration (/Admin or /CustomModules - except /Admin/Public)
public static bool IsBackEnd()
Returns
- bool
trueif in backend; otherwise,false.
IsBackEndUrl(string)
Determines whether the specified URL is part of the Dynamicweb administration
public static bool IsBackEndUrl(string url)
Parameters
urlstringThe URL.
Returns
- bool
trueif the specified url is a backend url; otherwise,false.
IsBackEndUrl(Uri?)
Determines whether the specified URL is part of the Dynamicweb administration
public static bool IsBackEndUrl(Uri? url)
Parameters
urlUriThe URL.
Returns
- bool
trueif the specified url is a backend url; otherwise,false.
IsFrontEnd()
Gets a value indicating whether the current code is being executed in the frontend
public static bool IsFrontEnd()
Returns
- bool
trueif in frontend; otherwise,false.