ParentNode: IMetabaseUpdateFolderNode;
The ParentNode property returns a parent structure for the update object.
ParentNode returns Null for a root element of the update structure.
Executing the example requires the update file C:\Update.pef. The repository should contain an object with the OBJ_FOR_PEF identifier. Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
Update: IMetabaseUpdate;
UFN: IMetabaseUpdateFolderNode;
UpdateObj: IMetabaseUpdateObjectNode;
ObjIndex: Integer;
ParentNode: IMetabaseUpdateFolderNode;
Begin
MB := MetabaseClass.Active;
Update := Mb.CreateUpdate;
Update.LoadFromFileNF("C:\Update.pefx");
UFN := Update.RootFolder;
UpdateObj := UFN.Add(MetabaseUpdateNodeType.DataObject) As IMetabaseUpdateObjectNode;
UpdateObj.Object := MB.ItemById("OBJ_FOR_PEF");
ObjIndex := UpdateObj.Index;
ParentNode := UpdateObj.ParentNode;
ParentNode.MoveNode(ObjIndex, ParentNode, 0);
Update.SaveToFileNF("C:\Update.pefx");
End Sub UserProc;
After executing the example, OBJ_FOR_PEF will be added to the beginning of the list of update objects - C:\Update.pef. Changes are saved.
See also: