/// <summary> /// Translates itemtype to polish equivalent /// </summary> /// <param name="itemtype"></param> /// <returns></returns> public static string TranslateToPolish(ScheduleItemType itemtype) { switch (itemtype) { case ScheduleItemType.Lecture: return("Wykład"); case ScheduleItemType.Laboratory: return("Laboratorium"); case ScheduleItemType.Class: return("Ćwiczenia"); case ScheduleItemType.Seminar: return("Seminarium"); case ScheduleItemType.Project: return("Projekt"); case ScheduleItemType.Other: return("Inne"); default: return(""); } }
/// ----------------------------------------------------------------------------- /// <summary> /// when there's no template, try to present the data in a reasonable format /// </summary> /// <param name="value">Value of the item</param> /// <param name="type">Type of the item</param> /// <returns>A formatted string</returns> /// ----------------------------------------------------------------------------- protected override string FormatDataValue(object value, ScheduleItemType type) { var retVal = string.Empty; if (!ReferenceEquals(value, null)) { if (type == ScheduleItemType.TitleHeader) { if (this.DateFormatString.Length == 0) { retVal = value.ToString(); } else { retVal = string.Format(this.DateFormatString, value); } } else if (type == ScheduleItemType.RangeHeader) { if (this.TimeFormatString.Length == 0) { retVal = value.ToString(); } else { retVal = string.Format(this.TimeFormatString, value); } } else { retVal = value.ToString(); } } return(retVal); }
protected override TableItemStyle GetStyle(ScheduleItemType type) { // handle DateHeader, which is not handled in the base class if (type == ScheduleItemType.DateHeader) { return(this.RangeHeaderStyle); } return(base.GetStyle(type)); }
protected override ITemplate GetTemplate(ScheduleItemType type) { switch (type) { case ScheduleItemType.RangeHeader: return(this.TimeTemplate); case ScheduleItemType.TitleHeader: return(this.DateTemplate); case ScheduleItemType.Item: return(this.ItemTemplate); case ScheduleItemType.AlternatingItem: return(this.ItemTemplate); } return(null); }
/// <summary> /// Returns the syntax string. /// </summary> /// <returns> /// syntax /// </returns> public static string GetSyntax(this ScheduleItemType value) { switch (value) { case ScheduleItemType.WILDCARD: return("*"); case ScheduleItemType.LASTDAY: return("last"); case ScheduleItemType.WEEKDAY: return("weekday"); case ScheduleItemType.LASTWEEKDAY: return("lastweekday"); } throw new ArgumentException(); }
/// <summary>Ctor. </summary> /// <param name="type">of crontab parameter</param> public CrontabParameterExpression(ScheduleItemType type) { ItemType = type; }
public ScheduleItem(int dataSetIndex1, ScheduleItemType itemType1) { this.DataSetIndex = dataSetIndex1; this.ItemType = itemType1; }
public ScheduleItem(int dataSetIndex1, ScheduleItemType itemType1) { DataSetIndex = dataSetIndex1; ItemType = itemType1; }