~cszikszoy/do-plugins/pastebin

« back to all changes in this revision

Viewing changes to Twitter/src/TwitterFriendSource.cs

Adding missing files and Archive plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// TwitterFriendSource.cs created with MonoDevelop
 
2
// User: alex at 5:19 PM 4/15/2008
 
3
//
 
4
// To change standard headers go to Edit->Preferences->Coding->Standard Headers
 
5
//
 
6
 
 
7
using System;
 
8
using System.Threading;
 
9
using System.Collections.Generic;
 
10
 
 
11
using Do.Universe;
 
12
 
 
13
namespace Twitter
 
14
{       
 
15
        public sealed class TwitterFriendSource : IItemSource
 
16
        {
 
17
                List<IItem> items;
 
18
                
 
19
                public TwitterFriendSource()
 
20
                {
 
21
                        items = new List<IItem> ();
 
22
                        UpdateItems ();
 
23
                }
 
24
                
 
25
                public string Name { get { return "Twitter Friends"; } }
 
26
                public string Description { get { return "Indexes your Twitter Friends"; } }
 
27
                public string Icon { get { return "system-users"; } }
 
28
                
 
29
                public Type[] SupportedItemTypes
 
30
                {
 
31
                        get {
 
32
                                return new Type[] {
 
33
                                        typeof (ContactItem),
 
34
                                };
 
35
                        }
 
36
                }
 
37
                
 
38
                public ICollection<IItem> Items
 
39
                {
 
40
                        get { return items; }
 
41
                }
 
42
                
 
43
                public ICollection<IItem> ChildrenOfItem (IItem parent)
 
44
                {
 
45
                        return null;
 
46
                }
 
47
                
 
48
                public void UpdateItems ()
 
49
                {
 
50
                        Thread updateRunner = new Thread( new ThreadStart(Twitter.GetTwitterFriends));
 
51
                        updateRunner.Start ();
 
52
                        items = Twitter.Friends;
 
53
                }
 
54
        }
 
55
}