public override string ToString() { return(String.Format("[{0}] {1} {12} [{2}] {3}-{4} {5}-{6} [{7},{8},{9},{10} {11}] ", Id.ToString().PadLeft(3, ' '), Name, Duration.ToString().PadLeft(3, ' '), EarlyStartDate.ToShortDateString(), EarlyFinishDate.ToShortDateString(), LatestStartDate.ToShortDateString(), LatestFinishDate.ToShortDateString(), EarlyStart.ToString().PadLeft(3, ' '), EarlyFinish.ToString().PadLeft(3, ' '), LatestStart.ToString().PadLeft(3, ' '), LatestFinish.ToString().PadLeft(3, ' '), Slack.ToString().PadLeft(3, ' '), DisplayOrder.ToString().PadLeft(4, ' ') )); }
/*public IComparable Field(int field) * { * switch (field) * { * case 0: * return (IComparable)TimeAtUni_; * case 1: * return (IComparable)TimeInClasses_; * case 2: * return (IComparable)TimeInBreaks_; * case 3: * return Days_; * case 4: * return (IComparable)MinDayLength_; * case 5: * return (IComparable)MaxDayLength_; * case 6: * return (IComparable)AverageDayLength_; * case 7: * return (IComparable)ShortBreak_; * case 8: * return (IComparable)LongBreak_; * case 9: * return (IComparable)AverageBreak_; * case 10: * return NumberBreaks_; * case 11: * return (IComparable)ShortBlock_; * case 12: * return (IComparable)LongBlock_; * case 13: * return (IComparable)AverageBlock_; * case 14: * return NumberBlocks_; * case 15: * return (IComparable)EarlyStart_; * case 16: * return (IComparable)LateStart_; * case 17: * return (IComparable)AverageStart_; * case 18: * return (IComparable)EarlyEnd_; * case 19: * return (IComparable)LateEnd_; * case 20: * return (IComparable)AverageEnd_; * default: * throw new Exception("Field index out of range."); * } * }*/ public string FieldValueToString(FieldIndex field) { switch (field) { case FieldIndex.TimeAtUni: return(TimeAtUni.ToString()); case FieldIndex.TimeInClasses: return(TimeInClasses.ToString()); case FieldIndex.TimeInBreaks: return(TimeInBreaks.ToString()); case FieldIndex.Days: return(Days.ToString()); case FieldIndex.MinDayLength: return(MinDayLength.ToString()); case FieldIndex.MaxDayLength: return(MaxDayLength.ToString()); case FieldIndex.AverageDayLength: return(AverageDayLength.ToString()); case FieldIndex.ShortBreak: return(ShortBreak.ToString()); case FieldIndex.LongBreak: return(LongBreak.ToString()); case FieldIndex.AverageBreak: return(AverageBreak.ToString()); case FieldIndex.NumberBreaks: return(NumberBreaks.ToString()); case FieldIndex.ShortBlock: return(ShortBlock.ToString()); case FieldIndex.LongBlock: return(LongBlock.ToString()); case FieldIndex.AverageBlock: return(AverageBlock.ToString()); case FieldIndex.NumberBlocks: return(NumberBlocks.ToString()); case FieldIndex.EarlyStart: return(EarlyStart.ToString()); case FieldIndex.LateStart: return(LateStart.ToString()); case FieldIndex.AverageStart: return(AverageStart.ToString()); case FieldIndex.EarlyEnd: return(EarlyEnd.ToString()); case FieldIndex.LateEnd: return(LateEnd.ToString()); case FieldIndex.AverageEnd: return(AverageEnd.ToString()); default: return(""); } }