private IRtssc GetSelectedRtssc(bool isStartMode)
        {
            RadDropDownList ddlRoute              = isStartMode ? ddlRouteStart : ddlRouteStop;
            RadDropDownList ddlTroncon            = isStartMode ? ddlTronconStart : ddlTronconStop;
            RadDropDownList ddlSection            = isStartMode ? ddlSectionStart : ddlSectionStop;
            RadDropDownList ddlSousRoute          = isStartMode ? ddlSousRouteStart : ddlSousRouteStop;
            TextBoxBase     mtxtChainageSelection = isStartMode ? mtxtChainageSelectionStart : mtxtChainageSelectionStop;

            IRtssc rtssc = null;
            AcquisitionTriggerMode triggerMode = GetSelectedTriggerMode(isStartMode);

            if (triggerMode == AcquisitionTriggerMode.Rtssc || triggerMode == AcquisitionTriggerMode.RtsscProximity || triggerMode == AcquisitionTriggerMode.EndSection)
            {
                var ValidateControl = new Func <RadDropDownList, bool>(ddlControl => ddlControl.SelectedIndex != -1 && ddlControl.SelectedValue.ToString() == ddlControl.Text);

                if (ValidateControl(ddlRoute) && ValidateControl(ddlTroncon) && ValidateControl(ddlSection) && ValidateControl(ddlSousRoute))
                {
                    double chainage;
                    if (!double.TryParse(mtxtChainageSelection.Text, out chainage))
                    {
                        chainage = 0;
                    }

                    rtssc = new Rtssc(
                        (string)ddlRoute.SelectedValue,
                        (string)ddlTroncon.SelectedValue,
                        (string)ddlSection.SelectedValue,
                        (string)ddlSousRoute.SelectedValue,
                        chainage: chainage);
                }
            }

            return(rtssc);
        }
        private async Task TryShowEndSectionRtssc(bool isStartMode)
        {
            AcquisitionTriggerMode stopTriggerMode = GetSelectedTriggerMode(isStartMode);

            if (stopTriggerMode == AcquisitionTriggerMode.Rtssc || stopTriggerMode == AcquisitionTriggerMode.RtsscProximity)
            {
                var bgrData = await AgentBroker.Instance.TryExecuteOnFirst <IBgrDirectionalAgent, BgrData>(agent => agent.CurrentData).GetValueOrDefault(null);;
                await ShowSpecificEndSectionRtssc(isStartMode, bgrData);
                await ShowEndSectionChainage(isStartMode, GetSelectedDirection(isStartMode));
            }
        }
 private async Task HandleDirectionCheckedChanged(bool isStartMode)
 {
     await DoAndIgnoreRtssIndexChanged(async() =>
     {
         AcquisitionTriggerMode triggerMode = GetSelectedTriggerMode(isStartMode);
         switch (triggerMode)
         {
         case AcquisitionTriggerMode.Rtssc:
         case AcquisitionTriggerMode.RtsscProximity:
             DirectionBgr direction = GetSelectedDirection(isStartMode);
             BindStartStopSousRouteDDLs(isStartMode, direction);
             await ShowEndSectionChainage(isStartMode, direction);
             break;
         }
     });
 }