~do-plugins/do-plugins/trunk

« back to all changes in this revision

Viewing changes to YouTube/src/YouTubeSubscriptionItemSource.cs

  • Committer: Luis Montiel
  • Date: 2009-01-20 18:56:52 UTC
  • mto: (680.2.3 youtube-plugin)
  • mto: This revision was merged to the branch mainline in revision 535.
  • Revision ID: luis@luis-laptop-20090120185652-76y1t3zrx9uhsodg
fixed .mdp files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// YouTubeSubscriptionItemSource.cs created with MonoDevelop
 
2
// User: luis at 01:57 p 07/09/2008
 
3
//
 
4
// To change standard headers go to Edit->Preferences->Coding->Standard Headers
 
5
//
 
6
 
 
7
using System;
 
8
using System.Collections.Generic;
 
9
using System.Threading;
 
10
using Mono.Unix;
 
11
using Do.Universe;
 
12
 
 
13
namespace YouTube
 
14
{
 
15
        
 
16
        
 
17
        public class YouTubeSubscriptionItemSource : ItemSource
 
18
        {
 
19
                public YouTubeSubscriptionItemSource()
 
20
                {
 
21
                }
 
22
                
 
23
                public override IEnumerable<Type> SupportedItemTypes {
 
24
                        get {
 
25
                                return new Type[] {
 
26
                                        typeof (YouTubeSubscriptionItem),
 
27
                                };
 
28
                        }
 
29
                }
 
30
                
 
31
                public override string Name { get { return "Youtube Subscriptions"; } }
 
32
                public override string Description { get { return "Your YouTube subscriptions"; } }
 
33
                public override string Icon {get { return "youtube_user.png@" + GetType ().Assembly.FullName; } }
 
34
                
 
35
                public override IEnumerable<Item> Items {
 
36
                        get { return Youtube.subscriptions; }
 
37
                }
 
38
                
 
39
                public override IEnumerable<Item> ChildrenOfItem (Item item)
 
40
                {
 
41
                        return null;
 
42
                }
 
43
                
 
44
                public override void UpdateItems ()
 
45
                {
 
46
                        try {
 
47
                                Thread thread = new Thread ((ThreadStart) (Youtube.updateSubscriptions));
 
48
                                thread.IsBackground = true;
 
49
                                thread.Start ();
 
50
                        } catch (Exception e) {
 
51
                                Console.Error.WriteLine (e.Message);
 
52
                        }
 
53
                }               
 
54
        }
 
55
}
 
56