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.
<font color="#008080">Sub</font> Main;<br /> <font color="#008080">Var</font><br /> Mb: IMetabase;<br /> Upd: IMetabaseUpdate;<br /> Progress: MyUpdateProgress;<br /> <font color="#008080">Begin</font><br /> MB := MetabaseClass.Active;<br /> Upd := Mb.CreateUpdate;<br /> Upd.LoadFromFileNF(<font color="#800000">"D:\Update.pefx"</font>);<br /> Progress := <font color="#008080">New</font> MyUpdateProgress.Create(Upd);<br /> Upd.Apply(Progress);<br /> Upd.SaveToFileNF(<font color="#800000">"D:\Update.pefx"</font>);<br /> <font color="#008080">End</font> <font color="#008080">Sub</font> Main;<br /> <br /> <font color="#008080">Public</font> <font color="#008080">Class</font> MyUpdateProgress: UpdateProgress<br /> update: IMetabaseUpdate;<br /> <br /> <font color="#008080">Public</font> <font color="#008080">Constructor</font> Create(update_: IMetabaseUpdate);<br /> <font color="#008080">Begin</font><br /> update := update_;<br /> <font color="#008080">End</font> <font color="#008080">Constructor</font> Create;<br /> <br /> <font color="#008080">Public</font> <font color="#008080">Sub</font> OnProgress(Data: IMetabaseUpdateProgressData);<br /> <font color="#008080">Var</font> ObjectNode: IMetabaseUpdateObjectNode;<br /> <font color="#008080">Begin</font><br /> <font color="#008080">Select</font> <font color="#008080">Case</font> Data.Stage<br /> <font color="#008080">Case</font> MetabaseUpdateProgressStage.Start:<br /> Debug.WriteLine(<font color="#800000">"Start of object update"</font>);<br /> Debug.WriteLine(<font color="#800000">"update conflict log:"</font>);<br /> Debug.WriteLine(update.SecurityConflictsLog);<br /> <font color="#008080">Case</font> MetabaseUpdateProgressStage.Prepare: Debug.WriteLine(<font color="#800000">"Prepare object"</font>);<br /> <font color="#008080">Case</font> MetabaseUpdateProgressStage.Apply: Debug.WriteLine(<font color="#800000">"Object update"</font>);<br /> <font color="#008080">Case</font> MetabaseUpdateProgressStage.AfterApply:<br /> <font color="#008080">If</font> Data.Node <font color="#008080">Is</font> IMetabaseUpdateObjectNode <font color="#008080">Then</font><br /> Debug.WriteLine(<font color="#800000">"Object is saved"</font>);<br /> ObjectNode := Data.Node <font color="#008080">As</font> IMetabaseUpdateObjectNode;<br /> Debug.WriteLine(<font color="#800000">"permissions change log:"</font>);<br /> Debug.WriteLine(ObjectNode.SDApplyLog);<br /> <font color="#008080">End</font> <font color="#008080">If</font>;<br /> <font color="#008080">Case</font> MetabaseUpdateProgressStage.Finish: Debug.WriteLine(<font color="#800000">"Object update is finished"</font>);<br /> <font color="#008080">End</font> <font color="#008080">Select</font>;<br /> Debug.WriteLine(<font color="#800000">"Current "</font> + Data.Current.ToString + <font color="#800000">" from "</font> + Data.Total.ToString + <font color="#800000">" Object "</font> + Data.Node.Label);<br /> <font color="#008080">End</font> <font color="#008080">Sub</font> OnProgress;<br /> <br /> <font color="#008080">Public</font> <font color="#008080">Sub</font> OnSkip(Data: IMetabaseUpdateProgressData);<br /> <font color="#008080">Begin</font><br /> Debug.WriteLine(<font color="#800000">"OnSkip "</font> + Data.Node.Label);<br /> <font color="#008080">End</font> <font color="#008080">Sub</font> OnSkip;<br /> <font color="#008080">End</font> <font color="#008080">Class</font> 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: