18
18
// along with this program. If not, see <http://www.gnu.org/licenses/>.
21
using System.Threading;
26
namespace Do.Addins.Tomboy
29
25
public class TomboyItem : IOpenableItem
34
30
/// The Tomboy Item only has one property, the title
36
32
/// <param name="note_title">
37
33
/// A <see cref="System.String"/>
39
public TomboyItem(TomboyItemSource.NoteStruct note)
35
public TomboyItem (string title)
41
this.title = note.title;
42
this.changed_date = note.changed_date;
45
public string Name { get { return title; } }
46
44
public string Description {
48
// This is an example of a UNIX timestamp for the date/time 11-04-2005 09:25.
49
// First make a System.DateTime equivalent to the UNIX Epoch.
50
System.DateTime dateTime = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
52
// Add the number of seconds in UNIX timestamp to be converted.
53
dateTime = dateTime.AddSeconds(changed_date);
55
// The dateTime now contains the right date/time so to format the string,
56
// use the standard formatting methods of the DateTime object.
57
string printDate = dateTime.ToShortDateString() +" "+ dateTime.ToShortTimeString();
59
// Print the date and time
60
string desc = "Last changed at: " + printDate;
64
public string Icon { get { return "tomboy"; } }
67
/// This is because we implement IRunnableItem
57
/// This is because we implement IOpenableItem
68
58
/// We use this method to run this instance of the item
71
TomboyDBus tomboy_instance = new TomboyDBus();
72
tomboy_instance.OpenNote(title);
62
new TomboyDBus ().OpenNote (title);