Interface IMainDom
Represents the main AppDomain running for a given application.
Namespace: Umbraco.Cms.Core.Runtime
Assembly: Umbraco.Core.dll
Syntax
public interface IMainDom
Remarks
There can be only one "main" AppDomain running for a given application at a time.
It is possible to register against the MainDom and be notified when it is released.
Properties
View SourceIsMainDom
Gets a value indicating whether the current domain is the main domain.
Declaration
bool IsMainDom { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Acquire must be called first else this will always return false
Methods
View SourceAcquire(IApplicationShutdownRegistry)
Tries to acquire the MainDom, returns true if successful else false
Declaration
bool Acquire(IApplicationShutdownRegistry hostingEnvironment)
Parameters
Type | Name | Description |
---|---|---|
IApplicationShutdownRegistry | hostingEnvironment |
Returns
Type | Description |
---|---|
System.Boolean |
Register(Nullable<Action>, Nullable<Action>, Int32)
Registers a resource that requires the current AppDomain to be the main domain to function.
Declaration
bool Register(Action? install = null, Action? release = null, int weight = 100)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<Action> | install | An action to execute when registering. |
System.Nullable<Action> | release | An action to execute before the AppDomain releases the main domain status. |
System.Int32 | weight | An optional weight (lower goes first). |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether it was possible to register. |
Remarks
If registering is successful, then the install
action
is guaranteed to execute before the AppDomain releases the main domain status.