Show / Hide Table of Contents

    Class ApplicationEventsResolver

    A resolver to return all IApplicationEvents objects

    Inheritance
    System.​Object
    Resolver​Base
    Resolver​Base<Application​Events​Resolver>
    Many​Objects​Resolver​Base<Application​Events​Resolver, IApplication​Event​Handler>
    Namespace:System.Dynamic.ExpandoObject
    Assembly:Umbraco.Core.dll
    Syntax
    public sealed class ApplicationEventsResolver : ManyObjectsResolverBase<ApplicationEventsResolver, IApplicationEventHandler>, IDisposable
    Remarks

    This is disposable because after the app has started it should be disposed to release any memory being occupied by instances.

    Ordering handlers: handlers are ordered by (ascending) weight. By default, handlers from the Umbraco.* or Concorde.* assemblies have a -100 weight whereas any other handler has a weight of +100. A custom weight can be assigned to a handler by marking the class with the WeightAttribute. For example, the CacheRefresherEventHandler is marked with [Weight(int.MinValue)] because its events need to run before anything else. Positive weights are considered "user-space" while negative weights are "core". Finally, users can register a filter to process the list (after it has been ordered) and re-order it, or remove handlers.

    BEWARE! handlers order is an important thing, and removing handlers or reordering handlers can have unexpected consequences.

    Properties

    ApplicationEventHandlers

    Gets the IApplication​Event​Handler implementations.

    Declaration
    public IEnumerable<IApplicationEventHandler> ApplicationEventHandlers { get; }
    Property Value
    Type Description
    System.​Collections.​Generic.​IEnumerable<IApplication​Event​Handler>

    FilterCollection

    Gets or sets a delegate to filter the event handler list (EXPERT!).

    Declaration
    public Action<IList<IApplicationEventHandler>> FilterCollection { get; set; }
    Property Value
    Type Description
    System.​Action<System.​Collections.​Generic.​IList<IApplication​Event​Handler>>
    Remarks

    This can be set on startup in the pre-boot process in either a custom boot manager or global.asax (UmbracoApplication).

    Allows custom logic to execute in order to filter and/or re-order the event handlers prior to executing.

    To be used by custom boot sequences where the boot loader needs to remove some handlers, or raise their priority.

    Filtering the event handler collection can have ugly consequences. Use with care.

    InstanceTypes

    Override in order to only return types of IApplicationEventHandler and above, do not include the legacy types of IApplicationStartupHandler

    Declaration
    protected override IEnumerable<Type> InstanceTypes { get; }
    Property Value
    Type Description
    System.​Collections.​Generic.​IEnumerable<System.​Type>

    IsDisposed

    Gets a value indicating whether this instance is disposed.

    Declaration
    public bool IsDisposed { get; }
    Property Value
    Type Description
    System.​Boolean

    true if this instance is disposed; otherwise, false.

    SupportsClear

    Declaration
    protected override bool SupportsClear { get; }
    Property Value
    Type Description
    System.​Boolean

    SupportsInsert

    Declaration
    protected override bool SupportsInsert { get; }
    Property Value
    Type Description
    System.​Boolean

    Methods

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()

    Finalize()

    Declaration
    protected void Finalize()

    GetObjectWeight(Object)

    Declaration
    protected override int GetObjectWeight(object o)
    Parameters
    Type Name Description
    System.​Object o
    Returns
    Type Description
    System.​Int32

    InstantiateLegacyStartupHandlers()

    Create instances of all of the legacy startup handlers

    Declaration
    public void InstantiateLegacyStartupHandlers()
    In This Article
    • Properties
      • ApplicationEventHandlers
      • FilterCollection
      • InstanceTypes
      • IsDisposed
      • SupportsClear
      • SupportsInsert
    • Methods
      • Dispose()
      • Finalize()
      • GetObjectWeight(Object)
      • InstantiateLegacyStartupHandlers()
    Back to top Copyright © 2016 Umbraco
    Generated by DocFX