Example #1
0
        // Tomboy.Note -> DTONote
        public static DTONote ToDTONote(this Tomboy.Note tomboy_note)
        {
            DTONote dto_note = new DTONote ();

            // using ServiceStack simple auto mapper
            dto_note.PopulateWith (tomboy_note);

            // copy over tags
            dto_note.Tags = tomboy_note.Tags.Keys.ToArray ();

            // correctly format the DateTime to strings
            dto_note.CreateDate = tomboy_note.CreateDate.ToString (XmlSettings.DATE_TIME_FORMAT);
            dto_note.ChangeDate = tomboy_note.ChangeDate.ToString (XmlSettings.DATE_TIME_FORMAT);
            dto_note.MetadataChangeDate = tomboy_note.MetadataChangeDate.ToString (XmlSettings.DATE_TIME_FORMAT);

            return dto_note;
        }