IUpdateCallback.OnCallback

Syntax

OnCallback(Reason: MetabaseUpdateCallbackReason; Update: IMetabaseUpdate): Boolean;

Parameters

Reason. The action that results in the event related to update.

Update. The update, for which an event will be generated.

Description

The OnCallback method implements the event related to repository update.

Comments

If the method returns True, the Reason action will be prohibited. If the method returns False, the Reason action will be allowed.

Example

Add a link to the Metabase system assembly.

Class CUpdateCallback: UpdateCallback
    Function OnCallback(Reason: MetabaseUpdateCallbackReason; Update: IMetabaseUpdate): Boolean;
    Begin
        If (Reason = MetabaseUpdateCallbackReason.ApplyCoreStart) And Not IsNull(Update.RootFolder.FindObject(12345)) Then
            Return True// Prohibit action
        Else
            Return False// Allow action
        End If;
    End Function OnCallback;
End Class CUpdateCallback;

The specified example is a global handler of update work events. If, during update, the system detects that the update object tree contains the object with the 12345 key, the entire update is canceled.

See also:

IUpdateCallback