IMetabaseCustomForeEvents.Add

Fore Syntax

Add(Id: String): IMetabaseCustomForeEvent;

Fore.NET Syntax

Add(Id: String): Prognoz.Platform.Interop.Metabase.MetabaseCustomForeEvent;

Parameters

Id. Custom event identifier.

Description

The Add method adds a new custom event to the collection.

Comments

To clear the collection of custom events, use the IMetabaseCustomForeEvents.Clear method.

Examples

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    CustomClassExtender: IMetabaseCustomExtender;
    Events: IMetabaseCustomForeEvents;
    ForeEvent: IMetabaseCustomForeEvent;
Begin
    MB := MetabaseClass.Active;
    
//Get custom classes container
    CustomClassExtender := Mb.SpecialObject(MetabaseSpecialObject.CustomExtender).Edit As IMetabaseCustomExtender;
    
//Get the list of events
    Events := CustomClassExtender.Events;
    ForeEvent := Events.Add(
"EVENT_ENTER");
    ForeEvent.Name := 
"Application login";
    (CustomClassExtender 
As IMetabaseObject).Save;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    CustomClassExtender: IMetabaseCustomExtender;
    Events: IMetabaseCustomForeEvents;
    ForeEvent: IMetabaseCustomForeEvent;
Begin
    MB := Params.Metabase;
    
//Get custom classes container
    CustomClassExtender := Mb.SpecialObject[MetabaseSpecialObject.msoCustomExtender].Edit() As IMetabaseCustomExtender;
    
//Get the list of events
    Events := CustomClassExtender.Events;
    ForeEvent := Events.Add(
"EVENT_ENTER");
    ForeEvent.Name := 
"Application login";
    (CustomClassExtender 
As IMetabaseObject).Save();
End Sub;

on executing the example a new custom event will be created.

See also:

IMetabaseCustomForeEvents