1
// ItemSourceItemSource.cs
3
// GNOME Do is the legal property of its developers, whose names are too numerous
4
// to list here. Please refer to the COPYRIGHT file distributed with this
5
// source distribution.
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.
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.
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/>.
22
using System.Collections.Generic;
30
internal class ItemSourceItemSource : ItemSource
33
public class ItemSourceItem : Item {
35
public ItemSource Source { get; private set; }
37
public override string Name { get { return Source.Name; } }
38
public override string Description { get { return Source.Description; } }
39
public override string Icon { get { return Source.Icon; } }
41
public ItemSourceItem (ItemSource source)
47
IEnumerable<Item> items;
49
public ItemSourceItemSource ()
51
items = Enumerable.Empty<Item> ();
54
public override IEnumerable<Type> SupportedItemTypes
56
get { yield return typeof (ItemSourceItem); }
59
public override string Name {
60
get { return Catalog.GetString ("GNOME Do Item Sources"); }
63
public override string Description {
64
get { return Catalog.GetString ("Item Sources providing all items GNOME Do knows about."); }
67
public override string Icon {
68
get { return "gnome-do"; }
71
public override IEnumerable<Item> Items {
75
public override void UpdateItems ()
77
items = PluginManager.ItemSources
78
.Select (source => new ItemSourceItem (source))
82
public override IEnumerable<Item> ChildrenOfItem (Item item)
84
return (item as ItemSourceItem).Source.Safe.Items;