Add(Id: String): IMetabaseCustomForeEvent;
Add(Id: String): Prognoz.Platform.Interop.Metabase.MetabaseCustomForeEvent;
Id. Custom event identifier.
The Add method adds a new custom event to the collection.
To clear the collection of custom events, use the IMetabaseCustomForeEvents.Clear method.
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: