Implement extension
Overview
Implement a main class that is an entry point different from a normal extension.
The following are the changes from the normal extension implementation.
| change point | normal extension | extension using ExtensionPoints |
|---|---|---|
| Namespace specification | NextDesign.Extension | NextDesign.Desktop.ExtensionPoints |
| Inheritance/Interface | Implementation of IExtension | Inheritance of ExtensionBase |
| Initialization process | Implementation of Activate method | Override of OnActivate method |
| Pre-Termination | Implementing Deactivate Method | Overriding OnDeactivate Method |
Implementation example
When using the project template, the initial settings are as follows except for OnDeactivate.
using NextDesign.Desktop.ExtensionPoints;
namespace SampleExtension
{
///<summary>
///Extension entry point
///</summary>
public class SampleExtensionEntryPoint : ExtensionBase
{
#region Activate/Deactivate
///<summary>
///Processing during activation.
///</summary>
protected override void OnActivate()
{
//ribbon
ExtensionPoints.Ribbon.AddTab("SampleExPoint").AddGroup("Test1").AddLargeButton<HelloCommand>("Hello");
//event
ExtensionPoints.Events.Application.RegisterOnAfterStart<ApplicationAfterStart>();
}
///<summary>
///<summary>
///Processing at the time of deactivation.
///</summary>
///</summary>
protected override void OnDeactivate()
{
}
#endregion
}
}