~cszikszoy/do-plugins/fix-confluence

« back to all changes in this revision

Viewing changes to DiskMounter/src/UnmountAction.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:
21
21
using System.Linq;
22
22
 
23
23
using Mono.Unix;
 
24
 
24
25
using Do.Universe;
 
26
using Do.Platform;
25
27
 
26
28
namespace DiskMounter
27
29
{
32
34
                }
33
35
                
34
36
                public override string Description {
35
 
                        get { return Catalog.GetString ("Unmount volume"); }
 
37
                        get { return Catalog.GetString ("Unmount or eject a volume"); }
36
38
                }
37
39
                
38
40
                public override string Icon {
39
 
                        get { return "hdd_unmount"; }
 
41
                        get { return "media-eject"; }
40
42
                }
41
43
                
42
44
                public override IEnumerable<Type> SupportedItemTypes {
43
 
                        get {
44
 
                                return new Type[] {
45
 
                                        typeof (DriveItem),
46
 
                                };
47
 
                        }
 
45
                        get { yield return typeof (DriveItem); }
48
46
                }
49
47
                
50
48
                public override bool SupportsItem (Item item) 
59
57
                
60
58
                public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modItems)
61
59
                {
62
 
                        (items.First ()
63
 
                         as DriveItem).Unmount ();
64
 
                        return null;
 
60
                        Services.Application.RunOnThread (() => {
 
61
                                (items.First () as DriveItem).Unmount ();
 
62
                        });
 
63
                        yield break;
65
64
                }
66
65
        }
67
66
}