private void m_CalculateTimeoutCode_ExecuteCode(object sender, EventArgs e)
        {
            try
            {
                this.SendingEmailsReplicator_InitialChildData = null;
                using (EntitiesDataContext EDC = new EntitiesDataContext(m_OnWorkflowActivated_WorkflowProperties.SiteUrl))
                {
                    Shipping _sp = Element.GetAtIndex <Shipping>(EDC.Shipping, m_OnWorkflowActivated_WorkflowProperties.ItemId.ToString());
                    TimeSpan _timeDistance;
                    switch (_sp.ShippingState.GetValueOrDefault(ShippingState.None))
                    {
                    case ShippingState.Confirmed:
                        switch (_sp.CalculateDistance(out _timeDistance))
                        {
                        case Shipping.Distance.UpTo72h:
                        case Shipping.Distance.UpTo24h:
                        case Shipping.Distance.UpTo2h:
                        case Shipping.Distance.VeryClose:
                            SetupTimeout(_timeDistance, _sp);
                            break;

                        case Shipping.Distance.Late:
                            MakeDelayed(_sp, EDC, m_TimeOutReached);
                            break;
                        }
                        break;

                    case ShippingState.WaitingForCarrierData:
                    case ShippingState.WaitingForConfirmation:
                    case ShippingState.Creation:
                        switch (_sp.CalculateDistance(out _timeDistance))
                        {
                        case Shipping.Distance.UpTo72h:
                            RequestData(_timeDistance, _sp, AlarmPriority.Normal, EDC, m_TimeOutReached);
                            break;

                        case Shipping.Distance.UpTo24h:
                            RequestData(_timeDistance, _sp, AlarmPriority.Warning, EDC, m_TimeOutReached);
                            break;

                        case Shipping.Distance.UpTo2h:
                            RequestData(_timeDistance, _sp, AlarmPriority.Warning, EDC, m_TimeOutReached);
                            break;

                        case Shipping.Distance.VeryClose:
                            RequestData(_timeDistance, _sp, AlarmPriority.High, EDC, m_TimeOutReached);
                            break;

                        case Shipping.Distance.Late:
                            MakeDelayed(_sp, EDC, m_TimeOutReached);
                            break;
                        }
                        break;

                    case ShippingState.Cancelation:
                        MakeCanceled(_sp, EDC);
                        break;

                    case ShippingState.Underway:
                    default:
                        SetupTimeout(TimeSpan.FromHours(5), _sp);
                        break;
                    }// switch (_sp.State.Value)
                    try
                    {
                        EDC.SubmitChanges(ConflictMode.ContinueOnConflict);
                    }
                    catch (ChangeConflictException)
                    {
                        ActionResult _ar = new ActionResult("ShippingStateMachine.m_CalculateTimeoutCode_ExecuteCode");
                        EDC.ResolveChangeConflicts(_ar);
                        EDC.SubmitChanges();
                        _ar.ReportActionResult(EDC);
                    }
                    finally { m_TimeOutReached = false; }
                } //using (EntitiesDataContext EDC
            }
            catch (Exception _ex)
            {
                ReportException("ShippingStateMachine.m_CalculateTimeoutCode_ExecuteCode", _ex);
            }
        }