~cszikszoy/do-plugins/MA-Config-Extension

« back to all changes in this revision

Viewing changes to GoogleDocs/src/GDocsTrashDocument.cs

  • Committer: Peng Deng
  • Date: 2009-06-17 20:43:58 UTC
  • mfrom: (618.2.3 gdoc-fix)
  • Revision ID: dengpeng@gmail.com-20090617204358-hob41x2dapj5kngh
Merge minor fixes/improvements to GDocs plugin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* GDocsTrashDocument.cs
2
 
 *
3
 
 * GNOME Do is the legal property of its developers. Please refer to the
4
 
 * COPYRIGHT file distributed with this
5
 
 * source distribution.
6
 
 *
7
 
 * This program is free software: you can redistribute it and/or modify
8
 
 * it under the terms of the GNU General Public License as published by
9
 
 * the Free Software Foundation, either version 3 of the License, or
10
 
 * (at your option) any later version.
11
 
 *
12
 
 * This program is distributed in the hope that it will be useful,
13
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 * GNU General Public License for more details.
16
 
 *
17
 
 * You should have received a copy of the GNU General Public License
18
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 
 */
 
1
// GDocsTrashDocument.cs
 
2
// 
 
3
// Copyright (C) 2009 GNOME Do
 
4
// 
 
5
// This program is free software: you can redistribute it and/or modify
 
6
// it under the terms of the GNU General Public License as published by
 
7
// the Free Software Foundation, either version 3 of the License, or
 
8
// (at your option) any later version.
 
9
// 
 
10
// This program is distributed in the hope that it will be useful,
 
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
// GNU General Public License for more details.
 
14
// 
 
15
// You should have received a copy of the GNU General Public License
 
16
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
17
 
21
18
using System;
22
19
using System.Text;
24
21
using System.Linq;
25
22
using Mono.Unix;
26
23
 
27
 
 
 
24
using Do.Platform;
28
25
using Do.Universe;
29
26
 
30
27
using Google.GData.Client;
40
37
                
41
38
                public override string Description {
42
39
                        get { return Catalog.GetString ("Move a document into Trash at Google Docs"); }
43
 
        }
 
40
                }
44
41
                        
45
42
                public override string Icon {
46
 
                        //get { return "gDocsTrashIcon.png@" + GetType ().Assembly.FullName; }
47
43
                        get { return "user-trash";}
48
44
                }
49
45
                
50
46
                public override IEnumerable<Type> SupportedItemTypes {
51
 
                        get {
52
 
                                return new Type[] {
53
 
                                        typeof (GDocsItem),     
54
 
                                };
55
 
                        }
 
47
                        get { yield return typeof (GDocsAbstractItem); }
56
48
                }
57
49
                
58
 
        public override bool SupportsItem (Item item) 
59
 
        {
 
50
                public override bool SupportsItem (Item item) 
 
51
                {
60
52
                        return true;
61
 
        }
62
 
 
63
 
        public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modifierItems) 
64
 
        {                                               
65
 
            GDocs.TrashDocument (items.First () as GDocsItem);
 
53
                }
 
54
                
 
55
                public override IEnumerable<Item> Perform (IEnumerable<Item> items, IEnumerable<Item> modifierItems) 
 
56
                {
 
57
                        Services.Application.RunOnThread (() => {
 
58
                                GDocs.TrashDocument (items.First () as GDocsAbstractItem);
 
59
                        });
66
60
                        yield break;
67
 
        }
 
61
                }
68
62
        }
69
63
}