Interface IMainDom
Represents the main AppDomain running for a given application.
Namespace: Umbraco.Core
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
When the first call is made to this there will generally be some logic executed to acquire a distributed lock lease.
Methods
View SourceRegister(Action, Action, Int32)
Registers a resource that requires the current AppDomain to be the main domain to function.
Declaration
bool Register(Action install, Action release, int weight = 100)
Parameters
Type | Name | Description |
---|---|---|
System.Action | install | An action to execute when registering. |
System.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.
Register(Action, Int32)
Registers a resource that requires the current AppDomain to be the main domain to function.
Declaration
bool Register(Action release, int weight = 100)
Parameters
Type | Name | Description |
---|---|---|
System.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. |