Root: IMetabaseObjectDescriptor;
The Root property determines the root directory, which contents is displayed in the component.
The property is set to Null by default, the component displays nothing.
If this property is changed, value of the IMetabaseTreeList.Metabase property is set automatically.
Executing the example requires a form with the button named Button1 and the MetabaseTreeCombo component named MetabaseTreeCombo1. Platform connection settings include description of the Test repository. The Test password and user name 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: