IWorkbookValidationPadContext.SelectedElems

Fore Syntax

SelectedElems: IMetabaseObjectDescriptors;

Fore.NET Syntax

SelectedElems: Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptors;

Description

The SelectedElems property returns descriptions of elements selected in the tree with validation rules.

Fore Example

Executing the example requires a form with the button named Button1 on it, the WorkbookConfigurationPanel component named WorkbookConfigurationPanel1 and the UiErAnalyzer component named UiErAnalyzer1. UiErAnalyzer1 is connected to a workbook and it is installed as a data source for the WorkbookConfigurationPanel1 component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Pad: ISystemPadContext;
    SelectedElems: IMetabaseObjectDescriptors;
    Desc: IMetabaseObjectDescriptor;
Begin
    Pad := WorkbookConfigurationPanel1.GetActiveContext;
    If Pad Is IWorkbookValidationPadContext Then
        SelectedElems := (Pad As IWorkbookValidationPadContext).SelectedElems;
        For Each Desc In SelectedElems Do
            Debug.WriteLine(Desc.Name + '(' + Desc.Id + ')');
        End For;
    End If;
End Sub Button1OnClick;

Clicking the button performs a control: whether the currently opened component tab is the tab with with validation rule tree. If the tab with validation rule tree is opened, the list of selected elements (names and identifiers) in the tree will be displayed only to the development environment console.

Fore.NET Example

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.Express;
Imports Prognoz.Platform.Interop.Metabase;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Pad: ISystemPadContext;
    SelectedElems: IMetabaseObjectDescriptors;
    Desc: IMetabaseObjectDescriptor;
Begin
    Pad := WorkbookConfigurationPanelNet1.CtrlBox.GetActiveContext();
    If Pad Is IWorkbookValidationPadContext Then
        SelectedElems := (Pad As IWorkbookValidationPadContext).SelectedElems;
        For Each Desc In SelectedElems Do
            System.Diagnostics.Debug.WriteLine(Desc.Name + '(' + Desc.Id + ')');
        End For;
    End If;
End Sub;

See also:

IWorkbookValidationPadContext