public TimeOutViewModel(StopwatchWrapper timeOutClock, TimeOutTypeEnum type) { TimeOutClock = timeOutClock; TimeOutType = type; }
/// <summary> /// starts a time out /// </summary> /// <param name="type"></param> public void startTimeOut(TimeOutTypeEnum type) { try { if (instance.CurrentJam != null) instance.CurrentJam.JamClock.Stop(); instance.PeriodClock.Pause(); instance.CurrentLineUpClock.Stop(); instance.CurrentlyInTimeOut = true; instance._team1.clearTeamPositions(); instance._team2.clearTeamPositions(); TimeOutViewModel timeOut = new TimeOutViewModel(instance.CurrentTimeOutClock, type); instance.CurrentTimeOutClock.Start(); if (type == TimeOutTypeEnum.Team1) instance.Team1.TimeOutsLeft -= 1; else if (type == TimeOutTypeEnum.Team2) instance.Team2.TimeOutsLeft -= 1; instance.TimeOuts.Add(timeOut); } catch (Exception e) { ErrorViewModel.Save(e, this.GetType(), ErrorGroupEnum.UI); } }
/// <summary> /// creates a new time out /// </summary> public void createTimeOutClock(TimeOutTypeEnum type) { if (type == TimeOutTypeEnum.Team1 || TimeOutTypeEnum.Team2 == type) { instance.CurrentTimeOutClock = new StopwatchWrapper(PolicyViewModel.Instance.TimeOutClock); this.NewTimeOut(this, null); } else if (type == TimeOutTypeEnum.Offical) { instance.CurrentTimeOutClock = new StopwatchWrapper(0); this.NewTimeOut(this, null); } else if (type == TimeOutTypeEnum.Official_Review) { instance.CurrentTimeOutClock = new StopwatchWrapper(0); this.OnNewOfficialReview(this, null); } }
public TimeOutViewModel(StopwatchWrapper timeOutClock, TimeOutTypeEnum type) { TimeOutClock = timeOutClock; TimeOutType = type; TimeoutId = Guid.NewGuid(); }
/// <summary> /// starts a time out /// </summary> /// <param name="type"></param> public void startTimeOut(TimeOutTypeEnum type) { instance.CurrentJam.JamClock.Stop(); instance.PeriodClock.Stop(); instance.CurrentLineUpClock.Stop(); instance.CurrentlyInTimeOut = true; TimeOutViewModel timeOut = new TimeOutViewModel(instance.CurrentTimeOutClock, type); instance.CurrentTimeOutClock.Start(); if (type == TimeOutTypeEnum.Team1) instance.Team1.TimeOutsLeft -= 1; else if (type == TimeOutTypeEnum.Team2) instance.Team2.TimeOutsLeft -= 1; instance.TimeOuts.Add(timeOut); }
/// <summary> /// creates a new time out /// </summary> public void createTimeOutClock(TimeOutTypeEnum type) { if (type == TimeOutTypeEnum.Team1 | TimeOutTypeEnum.Team2 == type) instance.CurrentTimeOutClock = new StopwatchWrapper(PolicyViewModel.Instance.TimeOutClock); else if (type == TimeOutTypeEnum.Offical)//TODO: this clock should be counting up instead of down for the official time out instance.CurrentTimeOutClock = new StopwatchWrapper(PolicyViewModel.Instance.TimeOutClock); this.NewTimeOut(this, null); }