~cszikszoy/do-plugins/fix-confluence

« back to all changes in this revision

Viewing changes to DiskMounter/src/DriveItemSource.cs

  • Committer: Peng Deng
  • Date: 2009-06-17 01:07:23 UTC
  • Revision ID: dengpeng@gmail.com-20090617010723-wopvd2omtyp4rwfv
Clean up DiskMounter, make DiskItem using IUriItem interface, and let FileAndFolder support browsing IUriItem

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
        public class DriveItemSource : ItemSource {
28
28
 
29
29
                List<Item> items;
30
 
                private static Gnome.Vfs.VolumeMonitor monitor;
31
 
 
 
30
                private static VolumeMonitor monitor;
 
31
                
32
32
                public DriveItemSource ()
33
33
                {
34
34
                        Vfs.Initialize ();
35
35
                        monitor = Gnome.Vfs.VolumeMonitor.Get ();
36
36
                        items = new List<Item> ();
37
37
                }
38
 
 
 
38
                
39
39
                public override string Name {
40
40
                        get { return "Drives"; }
41
41
                }
42
 
 
 
42
                
43
43
                public override string Description {
44
44
                        get { return "Available mounted and unmounted drives."; }
45
45
                }
46
 
 
 
46
                
47
47
                public override string Icon {
48
48
                        get { return "harddrive"; }
49
49
                }
50
 
 
 
50
                
51
51
                public override IEnumerable<Type> SupportedItemTypes {
52
 
                        get {
53
 
                                return new Type[] {
54
 
                                        typeof (DriveItem),
55
 
                                };
56
 
                        }
 
52
                        get { yield return typeof (DriveItem); }
57
53
                }
58
 
 
 
54
                
59
55
                public override IEnumerable<Item> Items {
60
56
                        get { return items; }
61
57
                }
62
 
 
 
58
                
63
59
                public override IEnumerable<Item> ChildrenOfItem (Item item)
64
60
                {
65
61
                        yield break;
66
62
                }
67
 
 
 
63
                
68
64
                public override void UpdateItems ()
69
65
                {
70
66
                        items.Clear ();
71
 
 
 
67
                        
72
68
                        foreach (Drive drive in monitor.ConnectedDrives){
73
69
                                items.Add (new DriveItem (drive));              
74
70
                        }