~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/mono-addins/Samples/TextEditorSWF/TextEditorSWF/ExtensionModel/ICommand.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
Import upstream version 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using System.Collections.Generic;
 
3
using System.Linq;
 
4
using System.Text;
 
5
using Mono.Addins;
 
6
 
 
7
namespace TextEditorSWF.ExtensionModel
 
8
{
 
9
        /// <summary>
 
10
        /// A user interface command.
 
11
        /// </summary>
 
12
        [TypeExtensionPoint (NodeType=typeof(CommandExtensionNode), ExtensionAttributeType=typeof(CommandAttribute))]
 
13
        public interface ICommand
 
14
        {
 
15
                /// <summary>
 
16
                /// Executes the command
 
17
                /// </summary>
 
18
                void Run ();
 
19
        }
 
20
 
 
21
        /// <summary>
 
22
        /// Attribute which can be used to declare new commands
 
23
        /// </summary>
 
24
        public class CommandAttribute : CustomExtensionAttribute
 
25
        {
 
26
                public CommandAttribute ()
 
27
                {
 
28
                }
 
29
 
 
30
                public CommandAttribute ([NodeAttribute ("Label")] string label)
 
31
                {
 
32
                        Label = label;
 
33
                }
 
34
 
 
35
                /// <summary>
 
36
                /// Resource that holds the command icon
 
37
                /// </summary>
 
38
                [NodeAttribute]
 
39
                public string IconResource { get; set; }
 
40
 
 
41
                /// <summary>
 
42
                /// File that holds the command icon
 
43
                /// </summary>
 
44
                [NodeAttribute]
 
45
                public string IconFile { get; set; }
 
46
 
 
47
                /// <summary>
 
48
                /// Label of the command
 
49
                /// </summary>
 
50
                [NodeAttribute]
 
51
                public string Label { get; set; }
 
52
        }
 
53
}