Root: IMetabaseObjectDescriptor;
The Root property determines the root directory, which content is displayed in the component.
By default the property is set to Null, in such conditions nothing is displayed in the component.
On changing value of this property, value of the Metabase property is set automatically.
Executing the example requires a form with the Button1 button and the MetabaseTreeList component named MetabaseTreeList1. Platform connections settings include a description of the Test repository. "Test" password and username are used to connect to this repository.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
MAN: IMetabaseManager;
Def: IMetabaseDefinition;
Cre: ICredentials;
Begin
MB := MetabaseClass.Active;
MAN := MB.Definition.Manager;
Cre := MAN.Packs.Item(0).Package.CreateCredentials(AuthenticationMode.Password);
Def := MAN.Definitions.FindById("Test");
(Cre As IPasswordCredentials).UserName := "Test";
(Cre As IPasswordCredentials).Password := "Test";
MB := Def.Open(Cre);
MetabaseTreeList1.Root := MB.Root;
End Sub Button1OnClick;
After executing the example, on clicking the button the Test repository root folder is set as a root folder for the MetabaseTreeList1 component.
See also: