Skip to main content

Implement event handler

Overview

You implement behavior by implementing event handlers for subscribed events. Event handlers are implemented by inheriting the corresponding event's HandlerBase.

  • Command implementation can be implemented by overriding OnHandle.

In addition, App CurrentProject etc. can be accessed in the HandlerBase class of each event.

Implementation example

using NextDesign.Desktop;
using NextDesign.Desktop.ExtensionPoints;

namespace SampleExtension.Events
{
///<summary>
///Application execution event
///</summary>
internal class ApplicationAfterStart : ApplicationAfterStartEventHandlerBase
{
///<summary>
///Event handler processing.
///</summary>
///<param name="c"></param>
///<param name="p"></param>
protected override void OnHandle(IEventContext c, AfterStartEventParams p)
{
//Implement event handling.
Output.WriteLine(ExtensionName, $"Events: ApplicationAfterStart Event. Version: {App.Version}");
}
}
}