3
// This is a simple command called MyCommand. If you're going to
4
// create a Command addin, you can start by copying this code
5
// to begin your own command class.
7
// GNOME Do is the legal property of its developers, whose names are too numerous
8
// to list here. Please refer to the COPYRIGHT file distributed with this
9
// source distribution.
11
// This program is free software: you can redistribute it and/or modify
12
// it under the terms of the GNU General Public License as published by
13
// the Free Software Foundation, either version 3 of the License, or
14
// (at your option) any later version.
16
// This program is distributed in the hope that it will be useful,
17
// but WITHOUT ANY WARRANTY; without even the implied warranty of
18
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
// GNU General Public License for more details.
21
// You should have received a copy of the GNU General Public License
22
// along with this program. If not, see <http://www.gnu.org/licenses/>.
28
namespace MyAddinNamespace
31
public class MyAction : IAction
36
return "The name of the action.";
40
public string Description {
42
return "A description of the action.";
48
// Look in /usr/share/icons/Tango/* for some great icons
49
// to use. Just return the name of the icon, without the
51
return "my-action-icon";
55
public Type[] SupportedItemTypes {
58
// Supported item types go here.
63
public bool SupportsItem (IItem item)
65
// Here, you can filter the items you support further. The argument
66
// is non-null is a subtype of one of your SupportedItemTypes.
70
public IItem[] Perform (IItem[] items, IItem[] modItems)
72
// This is where the magic happens.
74
// If you return a non-null, non-empty array of IItems, they will
75
// be presented to the user in the main window for a new search.
76
// You can return null if you don't want to provide any items to
77
// the user as a result of performing your command.
81
//////////////////////////////////////////////////////////////////////
82
/// If you don't plan on supporting modifier items (third pane), ///
83
/// you can safely leave all of the following methods as they are. ///
84
//////////////////////////////////////////////////////////////////////
86
public Type[] SupportedModifierItemTypes {
89
// Supported modifier item types go here.
94
public bool ModifierItemsOptional {
98
public bool SupportsModifierItemForItems (IItem[] items, IItem modItem)
103
public IItem[] DynamicModifierItemsForItem (IItem item)