OnSkip(Data: IMetabaseUpdateProgressData);
Data. Information about object synchronization progress.
The OnSkip method implements the event of skipping the update element on updating.
To execute the example, add a link to the Metabase system assembly. The C:\Update.pefx update file is required.
Sub UserProc;
Var
Mb: IMetabase;
Upd: IMetabaseUpdate;
Progress: MyUpdateProgress;
Begin
MB := MetabaseClass.Active;
Upd := Mb.CreateUpdate;
Upd.LoadFromFileNF("D:\Update.pefx");
Progress := New MyUpdateProgress.Create(Upd);
Upd.Apply(Progress);
Upd.SaveToFileNF("D:\Update.pefx");
End Sub UserProc;
Public Class MyUpdateProgress: UpdateProgress
update: IMetabaseUpdate;
Public Constructor Create(update_: IMetabaseUpdate);
Begin
update := update_;
End Constructor Create;
Public Sub OnProgress(Data: IMetabaseUpdateProgressData);
Var ObjectNode: IMetabaseUpdateObjectNode;
Begin
Select Case Data.Stage
Case MetabaseUpdateProgressStage.Start:
Debug.WriteLine("Object update start");
Debug.WriteLine("update conflicts log:");
Debug.WriteLine(update.SecurityConflictsLog);
Case MetabaseUpdateProgressStage.Prepare: Debug.WriteLine("Prepare object");
Case MetabaseUpdateProgressStage.Apply: Debug.WriteLine("Update object");
Case MetabaseUpdateProgressStage.AfterApply:
If Data.Node Is IMetabaseUpdateObjectNode Then
Debug.WriteLine("Object is saved");
ObjectNode := Data.Node As IMetabaseUpdateObjectNode;
Debug.WriteLine("permissions change log:");
Debug.WriteLine(ObjectNode.SDApplyLog);
End If;
Case MetabaseUpdateProgressStage.Finish: Debug.WriteLine("Update of objects is finished");
End Select;
Debug.WriteLine("Current " + Data.Current.ToString + " of " + Data.Total.ToString + " Object " + Data.Node.Label);
End Sub OnProgress;
Public Sub OnSkip(Data: IMetabaseUpdateProgressData);
Begin
Debug.WriteLine("OnSkip " + Data.Node.Label);
End Sub OnSkip;
End Class MyUpdateProgress;
After executing the example, the console window displays the information about the update progress, the log of update conflicts and the log of changing permissions.
See also: