IsUnderUpdateRoot: Boolean;
IsUnderUpdateRoot: boolean;
The IsUnderUpdateRoot property returns the attribute of the update object position under the IMetabaseUpdate.RootFolder root.
Executing the example required an update file with the Update.pefx name containing the object with the FOLDER identifier. The form should contain the Button component with the Button1 identifier.
Add a link to the Metabase system assembly.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Update: IMetabaseUpdate;
Object: IMetabaseUpdateObjectNode;
Root: IMetabaseUpdateFolderNode;
Begin
//Get access to repository
MB := MetabaseClass.Active;
//Create update object
Update := Mb.CreateUpdate;
//Load update from file
Update.LoadFromFileNF("C:\Update.pefx");
//Get object containing the file structure
Root := Update.RootFolder;
//Get object with the FOLDER identifier
Object := Root.FindObject(MB.GetObjectKeyById("FOLDER"));
//Display the update object position under the root to the console
Debug.Write(Object.IsUnderUpdateRoot);
End Sub Button1OnClick;
After executing the example, clicking the button displays the attribute whether the specified update object is located under the IMetabaseUpdate.RootFolder root.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Metabase;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
MB: IMetabase;
Update: IMetabaseUpdate;
Object: IMetabaseUpdateObjectNode;
Root: IMetabaseUpdateFolderNode;
Begin
//Get access to repository
MB := Self.Metabase;
//Create update object
Update := Mb.CreateUpdate();
//Load update from file
Update.LoadFromFileNF("C:\" + "Update.pefx", UpdateLoadMode.ulmReplace);
//Get object containing the file structure
Root := Update.RootFolder;
//Get object with the FOLDER identifier
Object := Root.FindObject(MB.GetObjectKeyById("FOLDER"));
//Display the update object position under the root to the console
System.Diagnostics.Debug.Write(Object.IsUnderUpdateRoot);
End Sub;
See also: