IMetaAttributesTreeList.UserConditions

Syntax

UserConditions: IOrmConditions;

Description

The UserConditions property returns user conditions applied to tree elements.

Example

Executing the example requires a form with a button named Button1, the MetaAttributesBreadcrumb component named MetaAttributesBreadcrumb1 and the MetaAttributesTreeList component named MetaAttributesTreeList1. The repository should contain a time series database with the OBJ_FC identifier. Click the button to start executing the example.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    mb: IMetabase;
    rubDescr: IMetabaseObjectDescriptor;
    dict: IMetaDictionary;
    dictInst: IMetaDictionaryInstance;
    rub: IRubricator;
    rubInst: IRubricatorInstance;
    conds: IOrmConditions;
    con: IOrmCondition;
Begin
    mb := MetabaseClass.Active;
    rubDescr := mb.ItemById("OBJ_FC");
    rub := rubDescr.Bind As IRubricator;
    rubInst := rubDescr.Open(NullAs IRubricatorInstance;
    dictInst := rubInst.GetDictionary(RubricatorDictionary.Facts);
    If dictInst <> Null Then
        dict := (dictInst As IMetabaseObjectInstance).Object As IMetaDictionary;
        MetaAttributesTreeList1.Dictionary := dict;
        conds := MetaAttributesTreeList1.UserConditions;
        con := conds.Add;
        con.AttributeName := "DL";
        con.Value := 1;
        MetaAttributesTreeList1.Breadcrumb := MetaAttributesBreadcrumb1;
        MetaAttributesBreadcrumb1.Dictionary := dictInst;
        MetaAttributesBreadcrumb1.MetaAttributes := dict.Attributes;
    End If;
End Sub Button1OnClick;

After executing the example, the attribute that determines the time series database tree hierarchy that is displayed in the MetaAttributesTreeList component can be selected in the MetaAttributesBreadcrumb component. A restriction is applied to the elements tree: only data with annual frequency is displayed.

See also:

IMetaAttributesTreeList