IRubricatorInstanceList.FindByKey

Fore Syntax

FindByKey(RubricatorKey: Integer): IRubricatorInstance;

Fore.NET Syntax

FindByKey(RubricatorKey: uinteger): Prognoz.Platform.Interop.Cubes.IRubricatorInstance;

Description

The FindByKey method returns database from the collection by its key.

Comments

The method returns Null if time series database with the specified key is missing in the collection.

Fore Example

Executing the example requires a form, the LanerBox component on it and the UiErAnalyzer component with the UiErAnalyzer1 identifier that is a data source for LanerBox. A workbook of the time series database in series mode must be loaded to UiErAnalyzer1.

Add links to the Cubes and the Metabase system assemblies.

Sub FindRub;
Var
    Laner: ILaner;
    RubList: IRubricatorInstanceList;
    mb: IMetabase;
    key: Integer;
    RubrInst: IRubricatorInstance;
Begin
    Laner := UiErAnalyzer1.ErAnalyzer.Laner;
    RubList := Laner.UsedRubricators;
    mb := MetabaseClass.Active;
    key := mb.GetObjectKeyById("FC_COMM");
    RubrInst := RubList.FindByKey(key);
    If RubrInst <> Null Then
            Debug.WriteLine("Is data source");
        Else
            Debug.WriteLine(Is not the data source);
    End If;
End Sub FindRub;

After executing the example it is determined whether the time series database with the FC_COMM identifier is a data source for the series of loaded workbook. The result is displayed in the console window.

Fore.NET Example

Executing the example requires a form, the LanerBoxNet component on it and the UiErAnalyzerNet component with the UiErAnalyzerNet1 identifier that is a data source for LanerBoxNet. A workbook of the time series database in series mode must be loaded to UiErAnalyzerNet1.

Imports Prognoz.Platform.Interop.Laner;
Imports Prognoz.Platform.Interop.Cubes;

Private Sub FindRub();
Var
    Laner: ILaner;
    RubList: IRubricatorInstanceList;
    mb: IMetabase;
    key: uinteger;
    RubrInst: IRubricatorInstance;
Begin
    Laner := UiErAnalyzerNet1.ErAnalyzer.ErAnalyzer.Laner;
    RubList := Laner.UsedRubricators;
    mb := Self.Metabase;
    key := mb.GetObjectKeyById("FC_COMM");
    RubrInst := RubList.FindByKey(key);
    If RubrInst <> Null Then
            System.Diagnostics.Debug.WriteLine("Is data source");
        Else
            System.Diagnostics.Debug.WriteLine(Is not the data source);
    End If;
End Sub;

After executing the example it is determined whether the time series database with the FC_COMM identifier is a data source for the series of loaded workbook. The result is displayed in the console window.

See also:

IRubricatorInstanceList