1
// PidginStatusItemSource.cs created with MonoDevelop
2
// User: alex at 12:19 PM 4/8/2008
4
// To change standard headers go to Edit->Preferences->Coding->Standard Headers
8
using System.Collections.Generic;
13
namespace Do.Addins.Pidgin
15
public class PidginSavedStatusItemSource : IItemSource
17
private List<IItem> statuses;
19
public PidginSavedStatusItemSource() {
20
statuses = new List<IItem> ();
24
public string Name { get { return Catalog.GetString ("Pidgin Statuses"); } }
25
public string Description { get { return Catalog.GetString ("Saved Pidgin statuses"); } }
26
public string Icon {get { return "pidgin"; } }
28
public Type[] SupportedItemTypes {
31
typeof (PidginSavedStatusItem),
36
public ICollection<IItem> Items {
37
get { return statuses; }
40
public ICollection<IItem> ChildrenOfItem (IItem item)
45
public void UpdateItems ()
47
Pidgin.IPurpleObject prpl;
50
prpl = Pidgin.GetPurpleObject ();
52
rawStatuses = prpl.PurpleSavedstatusesGetAll ();
53
foreach (int status in rawStatuses) {
54
if (!prpl.PurpleSavedstatusIsTransient (status)) {
55
string title, message;
58
title = prpl.PurpleSavedstatusGetTitle (status);
59
message = prpl.PurpleSavedstatusGetMessage (status);
60
id = prpl.PurpleSavedstatusFind (title);
61
statId = prpl.PurpleSavedstatusGetType (status);
63
statuses.Add (new PidginSavedStatusItem (title,message,id,statId));