FindOutActive;
FindOutActive();
The FindOutActive method sets up period parameters based on the current selection.
If the first selected element in the dictionary is 01.01.1990, and the last selected element is 01.01.1992, all months are selected between these elements, and there are no other selected elements, after calling the FindOutActive method the following properties are set: Start - 01.01.1990 00:00:00, End_ - 01.01.1992 00:00:00, Levels - number of months between them, Active = True.
Executing the example requires a form containing the Button component with the Button1 identifier, the DimensionTree component with DimensionTree1 identifier and the UiDimension component with the UiDimension1 identifier. Specify the data source UiDimension1 for the DimensionTree1 component. A calendar dictionary is used as a data source. The example is a handler of the OnClick event for the Button1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
CalendarSel: IDimCalendarSelection;
SelPeriod: IDimCalendarPeriodSelection;
Begin
CalendarSel := UiDimension1.Selection As IDimCalendarSelection;
SelPeriod := CalendarSel.Period;
SelPeriod.FindOutActive;
Debug.WriteLine(SelPeriod.Start.ToString + " " + SelPeriod.End_.ToString);
Debug.WriteLine(SelPeriod.Levels);
Debug.WriteLine(SelPeriod.Active);
End Sub Button1OnClick;
On clicking the Button1 button the console window shows period parameters based on the current selection.
Executing the example requires a form containing the Button component with the button1 identifier, the DimensionTreeNet component with DimensionTreeNet1 identifier and the UiDimensionNet component with the UiDimensionNet1 identifier. Specify the data source UiDimensionNet1 for the DimensionTreeNet1 component. A calendar dictionary is used as a data source. Example is the Click event handler for the Button1 component.
To execute the example, add a link to the Dimensions system assembly.
Imports Prognoz.Platform.Interop.Dimensions;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
CalendarSel: IDimCalendarSelection;
SelPeriod: IDimCalendarPeriodSelection;
Begin
CalendarSel := uiDimensionNet1.Selection As IDimCalendarSelection;
SelPeriod := CalendarSel.Period;
SelPeriod.FindOutActive();
System.Diagnostics.Debug.WriteLine(SelPeriod.Start.ToString() + " " + SelPeriod.@End.ToString());
System.Diagnostics.Debug.WriteLine(SelPeriod.Levels);
System.Diagnostics.Debug.WriteLine(SelPeriod.Active);
End Sub;
The result of Fore.NET Example execution matches that in the Fore Example.
See also: