public void RestartTimer(Model.SiegeTimer oSiegeTimer) { TimeSpan oTimespanToGo; if (SiegeTimer.Timer != null) { SiegeTimer.Timer.Stop(); } SiegeTimer = oSiegeTimer; oTimespanToGo = SiegeTimer.End - DateTime.Now; Countdown((int)oTimespanToGo.TotalSeconds, TimeSpan.FromSeconds(1), cur => labelTimer.Content = string.Format("{0:%m}:{0:ss}", new TimeSpan(0, 0, cur))); }
public SiegeTimerItem(Model.SiegeTimer oSiegeTimer, LogWriter oLogWriter, Model.API.matches_match oMatch) { TimeSpan oTimespanToGo; InitializeComponent(); SiegeTimer = oSiegeTimer; m_oLogWriter = oLogWriter; Match = oMatch; labelObjectiveMapName.Content = SiegeTimer.Map.Identifier; labelObjectiveName.Content = SiegeTimer.XMLObjective.Name; imageObjectiveType.Source = new BitmapImage(this.GetIconUri(SiegeTimer.XMLObjective, SiegeTimer.APIObjective.current_owner.color)); oTimespanToGo = SiegeTimer.End - DateTime.Now; Countdown((int)oTimespanToGo.TotalSeconds, TimeSpan.FromSeconds(1), cur => labelTimer.Content = string.Format("{0:%m}:{0:ss}", new TimeSpan(0, 0, cur))); }
public SiegeTimerEventArgs(Model.SiegeTimer oSiegeTimer) { SiegeTimer = oSiegeTimer; }