private void RestorePage() { var call = App.ActiveCall.ActiveCallRequest.CallInfo; var CallLiveStatusId = "3"; var CallPausedStatusId = "4"; try { _timer.SetTimePassed(call.DurationInfo); ElapsedTime = _timer.GetTimePassed(); } // call.DurationInfo is invalid catch (ArgumentOutOfRangeException) { _timer.SetTimePassed("00:00:00"); ElapsedTime = _timer.GetTimePassed(); } if (call.CallStatusInfo.CallStatusId == CallPausedStatusId) { OnPaused(this, new EventArgs()); } if (call.CallStatusInfo.CallStatusId == CallLiveStatusId) { OnStarted(this, new EventArgs()); } }
private void RestoreTimerForCall(Models.RespondModels.CallInfo call) { if (timer == null) { timer = new MyTimer(TimeSpan.FromSeconds(1), UpdateTimerLabel); } try { timer.SetTimePassed(call.DurationInfo); UpdateTimerLabel(); } // call.DurationInfo is invalid catch (ArgumentOutOfRangeException) { timer.SetTimePassed("00:00:00"); UpdateTimerLabel(); } }