OnCallback(Reason: MetabaseUpdateCallbackReason; Update: IMetabaseUpdate): Boolean;
Reason. The action that results in the event related to update.
Update. The update, for which an event will be generated.
The OnCallback method implements the event related to repository update.
If the method returns True, the Reason action will be prohibited. If the method returns False, the Reason action will be allowed.
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: