示例#1
0
 public static IEnumerable <DataAttribute> create_memento
     (time.ClockTime clock_time)
 {
     return(new DataAttribute[] {
         DataAttribute.create_value("seconds_from_midnight", clock_time.seconds_from_midnight.ToString())
     });
 }
示例#2
0
 public static IEnumerable <DataAttribute> create_memento
     (domain.DiaryEntry diary_entry)
 {
     return(new DataAttribute[] {
         DataAttribute.create_collection("start_time", time.serialisation.ClockTime.create_memento(diary_entry.start_time))
     });
 }
示例#3
0
 public static IEnumerable <DataAttribute> create_memento
     (domain.Day day)
 {
     return(new DataAttribute[] {
         DataAttribute.create_value("summary", day.summary),
         DataAttribute.create_collection("date", time.serialisation.Date.create_attribute_memento(day.date)),
         DataAttribute.create_collection("diary", day.diary.Select((de, i) => DataAttribute.create_collection(i.ToString(), DiaryEntry.create_memento(de))))
     });
 }
示例#4
0
 // Q. Why do return types not count as part of a method signatiure?
 public static IEnumerable <DataAttribute> create_attribute_memento
     (time.Date date)
 {
     return(new[] {
         DataAttribute.create_value("year", date.year.ToString())
         , DataAttribute.create_value("month", date.month.ToString())
         , DataAttribute.create_value("day", date.day.ToString())
     });
 }