Class SimpleMainDom
Provides a simple implementation of IMainDom.
Inheritance
Namespace: Umbraco.Cms.Core
Assembly: Umbraco.Core.dll
Syntax
public class SimpleMainDom : IMainDom
Constructors
View SourceSimpleMainDom()
Declaration
public SimpleMainDom()
Properties
View SourceIsMainDom
Gets a value indicating whether the current domain is the main domain.
Declaration
public bool IsMainDom { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Acquire must be called first else this will always return false
Methods
View SourceAcquire(IApplicationShutdownRegistry)
Acquires the main domain status.
Declaration
public bool Acquire(IApplicationShutdownRegistry hostingEnvironment)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplicationShutdownRegistry | hostingEnvironment | The application shutdown registry. |
Returns
| Type | Description |
|---|---|
| bool | Always returns |
Dispose()
Declaration
public void Dispose()
Dispose(bool)
Releases the unmanaged resources used by the SimpleMainDom and optionally releases the managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
|
Register(Action?, Action?, int)
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 |
|---|---|---|
| Action | install | An action to execute when registering. |
| Action | release | An action to execute before the AppDomain releases the main domain status. |
| int | weight | An optional weight (lower goes first). |
Returns
| Type | Description |
|---|---|
| bool | 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.
Stop()
Stops the main domain and executes all registered release callbacks.
Declaration
public void Stop()