17
17
note_manager = mgr;
20
//Convert System.DateTime to unix timestamp
21
private static long UnixDateTime(DateTime d)
23
long epoch_ticks = new DateTime (1970,1,1).Ticks;
24
//Ticks is in 100s of nanoseconds, unix time is in seconds
25
return (d.ToUniversalTime ().Ticks - epoch_ticks) / 10000000;
20
28
public bool DisplayNote (string uri)
107
115
recent_changes.SearchText = search_text;
108
116
recent_changes.Present ();
119
public bool NoteExists (string uri)
121
Note note = note_manager.FindByUri (uri);
125
public string[] ListAllNotes ()
127
ArrayList uris = new ArrayList ();
128
foreach (Note note in note_manager.Notes) {
131
return (string []) uris.ToArray (typeof (string)) ;
134
public string GetNoteContents (string uri)
137
note = note_manager.FindByUri (uri);
140
return note.TextContent;
143
public string GetNoteTitle (string uri)
146
note = note_manager.FindByUri (uri);
152
public long GetNoteCreateDate (string uri)
155
note = note_manager.FindByUri (uri);
158
return UnixDateTime (note.CreateDate);
161
public long GetNoteChangeDate (string uri)
164
note = note_manager.FindByUri (uri);
167
return UnixDateTime (note.ChangeDate);
170
public string GetNoteContentsXml (string uri)
173
note = note_manager.FindByUri (uri);
176
return note.XmlContent;
179
public bool SetNoteContents (string uri, string text_contents)
182
note = note_manager.FindByUri (uri);
185
note.TextContent = text_contents;
189
public bool SetNoteContentsXml (string uri, string xml_contents)
192
note = note_manager.FindByUri (uri);
195
note.XmlContent = xml_contents;