private string TimeSpanAsText(TimeSpan timespan, OvertimeStatus overtimeStatus) { if (overtimeStatus == OvertimeStatus.Normal) { return(((int)timespan.TotalMinutes).ToString()); } return(TimeboxEnforcer.DurationAsText(timespan)); }
private string TimeSpanAsText(TimeSpan timespan, OvertimeStatus overtimeStatus) { if (overtimeStatus == OvertimeStatus.Normal) { return ((int)timespan.TotalMinutes).ToString(); } return TimeboxEnforcer.DurationAsText(timespan); }
private Color GetForecolor(OvertimeStatus overtimeStatus) { switch (overtimeStatus) { case OvertimeStatus.Normal: return Color.White; case OvertimeStatus.Warning: return Color.Yellow; case OvertimeStatus.Overtime: return Color.Red; default: throw new SosException("Unknown status: " + overtimeStatus); } }
private Color GetForecolor(OvertimeStatus overtimeStatus) { switch (overtimeStatus) { case OvertimeStatus.Normal: return(Color.White); case OvertimeStatus.Warning: return(Color.Yellow); case OvertimeStatus.Overtime: return(Color.Red); default: throw new SosException("Unknown status: " + overtimeStatus); } }
public void UpdateText(TimeSpan timespan, OvertimeStatus overtimeStatus) { _label.Text = TimeSpanAsText(timespan, overtimeStatus); _label.ForeColor = GetForecolor(overtimeStatus); }