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.ApplyUI) 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 the update is installed from application visual interface and the update contains an object with the 12345 key, this update will be canceled.

See also:

IUpdateCallback