Class SimpleMainDom
Provides a simple implementation of IMainDom.
Inheritance
Namespace: Umbraco.Core
Assembly: Umbraco.Core.dll
Syntax
public class SimpleMainDom : IMainDom
Properties
View SourceIsMainDom
Gets a value indicating whether the current domain is the main domain.
Declaration
public 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
public 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
public 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. |
Stop()
Declaration
public void Stop()