~iwarford/do-plugins/fart-plugin-fwiw

« back to all changes in this revision

Viewing changes to RememberTheMilk/src/RtmNet/Note.cs

  • Committer: Jason Jones
  • Date: 2008-12-24 04:45:02 UTC
  • mfrom: (335.1.9 do-plugins)
  • Revision ID: jasonedwardjones@gmail.com-20081224044502-ra56ym06cp1iqs7t
Merged from trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Note.cs created with MonoDevelop
 
2
// User: calvin at 11:28 PM 2/12/2008
 
3
//
 
4
// To change standard headers go to Edit->Preferences->Coding->Standard Headers
 
5
//
 
6
 
 
7
using System;
 
8
using System.Xml.Serialization;
 
9
using System.Xml.Schema;
 
10
 
 
11
namespace RtmNet
 
12
{
 
13
        /// <summary>
 
14
        /// Contains a list of <see cref="Contact"/> items for a given user.
 
15
        /// </summary>
 
16
        [System.Serializable]
 
17
        public class Notes
 
18
        {
 
19
                /// <summary>
 
20
                /// An array of <see cref="Contact"/> items for the user.
 
21
                /// </summary>
 
22
                [XmlElement("note", Form=XmlSchemaForm.Unqualified)]
 
23
                public Note[] NoteCollection = new Note[0];
 
24
        }
 
25
 
 
26
        /// <remarks/>
 
27
        [System.Serializable]
 
28
        public class Note
 
29
        {
 
30
                private string id;
 
31
                private string rawCreated;
 
32
                private string rawModified;
 
33
                private string title;   
 
34
                private string text;            
 
35
                private DateTime created = DateTime.MinValue;
 
36
                private DateTime modified = DateTime.MinValue;
 
37
 
 
38
                /// <remarks/>
 
39
                [XmlAttribute("id", Form=XmlSchemaForm.Unqualified)]
 
40
                public string ID { get { return id; } set { id = value; } }
 
41
    
 
42
                /// <remarks/>
 
43
                [XmlAttribute("created", Form=XmlSchemaForm.Unqualified)]
 
44
                public string RawCreated
 
45
                {
 
46
                        get { return rawCreated; }
 
47
                        set {
 
48
                                if(value.Length > 0) {
 
49
                                        rawCreated = value;
 
50
                                        created = Utils.DateStringToDateTime(rawCreated);
 
51
                                }
 
52
                        }
 
53
                }
 
54
    
 
55
                /// <summary>
 
56
                /// Converts the raw created field to a <see cref="DateTime"/>.
 
57
                /// </summary>  
 
58
                [XmlIgnore]
 
59
                public DateTime Created
 
60
                {
 
61
                        get { return created; }
 
62
                        set { created = value; }
 
63
                }
 
64
 
 
65
                /// <remarks/>
 
66
                [XmlAttribute("modified", Form=XmlSchemaForm.Unqualified)]
 
67
                public string RawModified
 
68
                {
 
69
                        get { return rawModified; }
 
70
                        set {
 
71
                                if(value.Length > 0) {
 
72
                                        rawModified = value;
 
73
                                        modified = Utils.DateStringToDateTime(rawModified);
 
74
                                }
 
75
                        }
 
76
                }
 
77
                /// <summary>
 
78
                /// Converts the raw modified field to a <see cref="DateTime"/>.
 
79
                /// </summary>  
 
80
                [XmlIgnore]
 
81
                public DateTime Modified
 
82
                {
 
83
                        get { return modified; }
 
84
                        set { modified = value; }
 
85
                }
 
86
 
 
87
 
 
88
                /// <summary>
 
89
                /// Is this contact marked as a friend contact?
 
90
                /// </summary>
 
91
                [XmlAttribute("title", Form=XmlSchemaForm.Unqualified)]
 
92
                public string Title { get { return title; } set { title = value; } }            
 
93
 
 
94
 
 
95
 
 
96
                /// <summary>
 
97
                /// The text of the note
 
98
                /// </summary>
 
99
                [XmlText()]
 
100
                public string Text { get { return text; } set { text = value; } }               
 
101
 
 
102
        }
 
103
}