Class ExecutingContext
- Namespace
- Dynamicweb.Environment
- Assembly
- Dynamicweb.Environment.dll
Provides static members for Dynamicweb environment variables.
public sealed class ExecutingContext
- Inheritance
-
ExecutingContext
- Inherited Members
Properties
IsPrimary
Determines whether this instance is the primary machine in a clustering environment.
public static bool IsPrimary { get; set; }
Property Value
- bool
true
if this instance is the primary machine; otherwise,false
.
Remarks
Returns true if the instance is not a member of a cluster
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
frontEnd
bool- if 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,CurrentCulture
is 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.IsAdminLoggedIn()
Gets a value indicating if the user is logged into the Dynamicweb administration
[Obsolete("Check whether there is a backend user instead")]
public static bool IsAdminLoggedIn()
Returns
- bool
- Returns true logged in otherwise false
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
true
if in backend; otherwise,false
.
IsBackEndUrl(string)
Determines whether the specified URL is part of the Dynamicweb administration
public static bool IsBackEndUrl(string url)
Parameters
url
string- The URL.
Returns
- bool
true
if 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
url
Uri- The URL.
Returns
- bool
true
if 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
true
if in frontend; otherwise,false
.
IsPrimaryMachine()
Determines whether this instance is the primary machine in a clustering environment.
[Obsolete("Use IsPrimary instead.")]
public static bool IsPrimaryMachine()
Returns
- bool
true
if this instance is the primary machine; otherwise,false
.
Remarks
Returns true if the instance is not a member of a cluster