CTExtension Class |
Inheritant must implement Hook(CTInterface) and UnHook(CTInterface). Inheritant should have minimal or no constructor at all. For (un)initialization purposes implementations of InitNotify and UnInitNotify can be overridden.
To provide various funtionalities for core product, inheritant should implement GetInterface2(ctExtensionInterface) which must return valid object in every state of this extension. However, functions of the interfaces are not called unless the status is at least ctExtensionStatusInitialized.
Namespace: CTExtensions
The CTExtension type exposes the following members.
Name | Description | |
---|---|---|
CTExtension |
Constructor
|
Name | Description | |
---|---|---|
Database |
Currently active database
| |
LicenseState |
Indicator of current license state.
Null = not checked
True = value
False = invalid
| |
Profile |
Currently active profile
|
Name | Description | |
---|---|---|
FriendlyName |
Name of current extension in user-friendly manner. Can be localized.
Short name of current type by default.
| |
GetExportProfileLinkToDBObject |
Read id of the linked object stored by your extension using StoreExportProfileLinkToDBObject(ICTExportProfile, SQLObjectType, Int32, Int32). Use intData to
identify specific link or otherwise first to found is returned.
| |
GetInterface | Obsolete.
Implementation of this function should return object implementing the requested
type in every case if this extension supports the interface, including when
this extension is not initialized. If this extension is not initialized,
the only function that might get called is GetParent().
| |
GetInterface2 |
Implementation of this function should return objects implementing the requested
type in every case if this extension supports the interface, including when
this extension is not initialized. If this extension is not initialized,
the only function that might get called is GetParent().
| |
GetInterfaceCapabilities |
Returns all interfaces this extension is capable of.
| |
GetSpecificInterface | Obsolete.
Calls GetInterface2(ctExtensionInterface) and verifies that returned type
is valid before passing it to the core.
| |
GetSpecificInterfaces |
Calls GetInterface2(ctExtensionInterface) and verifies that returned types
are valid before passing it to the core.
| |
GetStatus |
Status of this extension as defined int
CTEngineLib.ctExtensionStatus
| |
Hook |
Implementation of this function is the only valid
and supported place to hook into CTInterface events.
Additional event -hooking is not allowed anywhere else.
This is called after this object is initialized in case the
current environment supports CTInterface events.
Must not be called by anything else than internal implementation.
| |
IdentifyingName |
By default identifying name of each extensions is
their full typename. This can be overridden but is not
couraged as each add-in should have unique and non-changing
identifying name.
| |
InitNotify | ||
IsInitialized |
Getter to indicate if this extension is currently initialized or not.
| |
NotifyLoaded |
Notification that this extension is now loaded.
| |
NotifyUnLoaded |
Notification that this extension is now UnLoaded.
| |
ReadExportSettings |
Read arbitrary data for your extension stored with StoreExportSettings(ICTExportProfile, String, Int32, Byte).
| |
RequestLicense |
RequestLicense
| |
StoreExportProfileLinkToDBObject |
Store link-data of your extension from export profile to given DB object type with given id.
ID's stored using this function are kept linked to correct objects even in profile import/export -cases.
Use intData to distinct different links of same type.
| |
StoreExportSettings |
Store arbitrary data to given export profile's data slot for your extension.
You may store easily one string and one integer per export profile, or even unlimited bytearray.
To store settings that consider links to other CT objects, use StoreExportProfileLinkToDBObject(ICTExportProfile, SQLObjectType, Int32, Int32) so the object IDs are handled correctly in import/export. | |
UnHook |
Implementation of this function must release all event
hooks added at Hook(CTInterface). This function may be
called multiple times.
This is called before the object is going to be uninitialized,
re-initialized or if CTInterface object is changed.
Must not be called by anything else than internal implementation.
| |
UnInitNotify | ||
Unload |
Unloads this extension.
|
// @AUTO-REFERENCE { [CT_INSTALL_PATH]\CTInterface.dll } // @AUTO-REFERENCE { [CT_INSTALL_PATH]\Interop.CTEngineLib.dll } using ATR.CT.CTInterface; using CTExtensions; using CTEngineLib; public class MyAddin : CTExtension { public override bool Hook(CTInterface oCTInterface) { bool bHooked = false; if (oCTInterface != null) { // Hook to CTInterface events and set bHooked = true. } return bHooked; } public override void UnHook(CTInterface oCTInterface) { if (oCTInterface != null) { // Un-Hook all handlers from CTInterface } } }
CUSTOMTOOLS 2017 SP1