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
10
using System.Collections.Generic;
16
public class PidginStatusItemSource : IItemSource
18
private static readonly string status_file;
19
private List<IItem> statuses;
21
static PidginStatusItemSource() {
22
string home = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
23
status_file = "~/.purple/status.xml".Replace("~", home);
26
public PidginStatusItemSource() {
27
statuses = new List<IItem> ();
31
public Type[] SupportedItemTypes {
34
typeof (PidginStatusItem),
40
offline = 1, available, unavailable, invisible, away,
41
extended_away, mobile, tune
44
public string Name { get { return "Pidgin Statuses"; } }
45
public string Description { get { return ""; } }
46
public string Icon {get { return "pidgin"; } }
48
public ICollection<IItem> Items {
49
get { return statuses; }
52
public ICollection<IItem> ChildrenOfItem (IItem item)
57
public void UpdateItems () {
58
XmlDocument statuses_xml = new XmlDocument ();
61
statuses_xml.Load (status_file);
62
foreach (XmlNode status in statuses_xml.GetElementsByTagName ("status")) {