FindSerieByStubKey(StubKey: Integer): ILanerSerie;
FindSerieByStubKey(StubKey: integer): Prognoz.Platform.Interop.Laner.ILanerSerie;
StubKey. Data source key.
The FindSerieByStubKey method searches a series in the context by data source key.
If a series is not found, the method returns Null.
Executing the example requires a form containing:
A button with the Button1 identifier.
The LanerBox component with the LanerBox1 identifier.
The UiErAnalyzer component that is a data source for LanerBox1. Workbook of the time series database must be loaded into UiErAnalyzer.
There should also be the pContext variable that contains context.
Add links to the Metabase and the Cubes system assemblies. Example is a handler of the OnClick event for the button.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
pContext: ILanerContext;
i: Integer;
Ser: ILanerCalculateSerie;
Stub: IVariableStub;
lSerie: ILanerSerie;
Begin
For i := 0 To LanerBox1.SelectedSeriesCount - 1 Do
Ser := LanerBox1.SelectedSeries(i) As ILanerCalculateSerie;
Stub := Ser.Stub;
lSerie := pContext.FindSerieByStubKey(Stub.Key);
If lSerie <> Null Then
Debug.WriteLine(Stub.NameEx(True));
End If;
End For;
End Sub Button1OnClick;
After executing the example, extended series names, highlighted in the LanerBox1 component and present in the context, are displayed in a console window.
Executing the example requires a .NET form containing:
A button with the button1 identifier.
The LanerBoxNet component with the lanerBoxNet1 identifier.
The UiErAnalyzerNet component that is a data source for the lanerBoxNet1. Workbook of the time series database must be loaded into UiErAnalyzerNet.
Example is a handler of the Click event for the button.
Imports Prognoz.Platform.Interop.Laner;
Imports Prognoz.Platform.Interop.Cubes;
…
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
i: Integer;
Ser: ILanerCalculateSerie;
Stub: IVariableStub;
lSerie: ILanerSerie;
Begin
For i := 0 To LanerBox1.SelectedSeriesCount - 1 Do
Ser := LanerBox1.SelectedSeries(i) As ILanerCalculateSerie;
Stub := Ser.Stub;
lSerie := GlobalContext.FindSerieByStubKey(Stub.Key);
If lSerie <> Null Then
Debug.WriteLine(Stub.NameEx(True));
End If;
End For;
End Sub Button1OnClick;
After executing the example, extended series names, highlighted in the LanerBox1 component and present in the context, are displayed in a console window.
See also: