IMetaMemberLeaf.CompoundKey

Fore Syntax

CompoundKey: Variant;

Fore.NET Syntax

CompoundKey: object;

Description

The CompoundKey property determines compound key of an element.

Comments

Unique compound key of the element is set in the IMetaMemberLeaf.CompoundIdentity property.

Fore Example

Executing the example requires a form with a button with the Button1 identifier, and the MetaAttributesTreeList component with the MetaAttributesTreeList1 identifier. Time series database must be defined for MetaAttributesTreeList1.

The example is a handler of the OnClick event for the Button1 component.

// Handler of the OnClick event
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    nSelNodes: Array;
    pMembers: IMetaMembersSet;
    pMember: IMetaMember;
    pLeaf: IMetaMemberLeaf;
Begin
    nSelNodes := MetaAttributesTreeList1.GetSelectedNodes;
    pMembers := MetaAttributesTreeList1.GetNodesMembers(nSelNodes);
    If Not pMembers.Eof Then
        pMembers.Reset;
        Repeat
            pMember := pMembers.Current;
            If pMember.IsLeaf Then
                pLeaf := pMember As IMetaMemberLeaf;
                Debug.WriteLine("Identity: " + pLeaf.Identity.ToString);
                Debug.WriteLine("CompoundIdentity: " + ToString(pLeaf.CompoundIdentity));
                Debug.WriteLine("Key: " + pLeaf.Key.ToString);
                Debug.WriteLine("CompoundKey: " + ToString(pLeaf.CompoundKey));
                Debug.WriteLine("__________________");
            End If;
            pMembers.Next;
        Until pMembers.Eof;
    End If;
End Sub Button1OnClick;

// Data output function
Function ToString(Value: Variant): String;
Var
    s: String;
    arr: Array Of Variant;
    idx: integer;
Begin
    arr := Value As Array Of Variant;
    For idx := 0 To arr.Length - 1 Do
        s := s + arr[idx] + "; ";
    End For;
    Return s;
End Function ToString;

After executing the example the console window shows information on the time series selected in the MetaAttributesTreeList1 component.

Fore.NET Example

Executing the example requires a .NET form that contains a button with the button1 identifier, and the MetaAttributesTreeListNet component with the metaAttributesTreeListNet1 identifier. Time series database must be defined for metaAttributesTreeListNet1.

The example is a handler of the Click event for the button1 component.

Imports Prognoz.Platform.Interop.Rds;

// Handler of the Click event
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    nSelNodes: Array;
    pMembers: IMetaMembersSet;
    pMember: IMetaMember;
    pLeaf: IMetaMemberLeaf;
Begin
    nSelNodes := metaAttributesTreeListNet1.CtrlBox.GetSelectedNodes();
    pMembers := metaAttributesTreeListNet1.CtrlBox.GetNodesMembers(nSelNodes);
    If Not pMembers.Eof() Then
        pMembers.Reset();
        Repeat
            pMember := pMembers.Current();
            If pMember.IsLeaf Then
                pLeaf := pMember As IMetaMemberLeaf;
                System.Diagnostics.Debug.WriteLine("Identity: " + pLeaf.Identity.ToString());
                System.Diagnostics.Debug.WriteLine("CompoundIdentity: " + ToString(pLeaf.CompoundIdentity));
                System.Diagnostics.Debug.WriteLine("Key: " + pLeaf.Key.ToString());
                System.Diagnostics.Debug.WriteLine("CompoundKey: " + ToString(pLeaf.CompoundKey));
                System.Diagnostics.Debug.WriteLine("__________________");
            End If;
            pMembers.Next();
        Until pMembers.Eof();
    End If;
End Sub;

// Data output function
Public Function ToString(Value: object): String;
Var
    s: String;
    arr: Array Of object;
    idx: integer;
Begin
    arr := Value As Array Of object;
    For idx := 0 To arr.Length - 1 Do
        s := s + arr[idx] + "; ";
    End For;
    Return s;
End Function ToString;

After executing the example the console window shows information on the time series selected in the metaAttributesTreeListNet1 component.

See also:

IMetaMemberLeaf