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

« back to all changes in this revision

Viewing changes to external/mono-addins/Test/HelloWorldExtension/HelloWorldWriter.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
 
 
2
using System;
 
3
using SimpleApp;
 
4
using Mono.Addins;
 
5
 
 
6
[assembly: Addin ("HelloWorldExtension", "0.1.0", Namespace="SimpleApp")]
 
7
[assembly: AddinDependency ("Core", "0.1.0")]
 
8
 
 
9
namespace HelloWorldExtension
 
10
{
 
11
        [Extension ("/SimpleApp/Writers")]
 
12
        public class HelloWorldWriter: IWriter
 
13
        {
 
14
                public HelloWorldWriter ()
 
15
                {
 
16
                        Id = Guid.NewGuid ().ToString ();
 
17
                }
 
18
                
 
19
                public string Id { get; set; }
 
20
                
 
21
                public string Title {
 
22
                        get { return "Hello world message"; }
 
23
                }
 
24
                
 
25
                public string Write ()
 
26
                {
 
27
                        return "Hello world!";
 
28
                }
 
29
                
 
30
                public string Test (string test)
 
31
                {
 
32
                        switch (test) {
 
33
                        case "currentAddin":
 
34
                                return AddinManager.CurrentAddin.ToString ();
 
35
                        }
 
36
                        return "Unknown test";
 
37
                }
 
38
        }
 
39
}