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

« back to all changes in this revision

Viewing changes to external/mono-addins/Test/FileContentExtension/FileContentExtensionNode.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 Mono.Addins;
 
4
using SimpleApp;
 
5
 
 
6
namespace FileContentExtension
 
7
{
 
8
        public class FileContentExtensionNode: TypeExtensionNode, IWriter
 
9
        {
 
10
                [NodeAttribute]
 
11
                protected string fileName;
 
12
                
 
13
                [NodeAttribute (Localizable=true)]
 
14
                protected string title;
 
15
                
 
16
                public string FileName {
 
17
                        get { return fileName; }
 
18
                }
 
19
                
 
20
                public string Title {
 
21
                        get { return title; }
 
22
                }
 
23
                
 
24
                public override object CreateInstance ()
 
25
                {
 
26
                        return this;
 
27
                }
 
28
                
 
29
                string IWriter.Title {
 
30
                        get { return "File: " + fileName; }
 
31
                }
 
32
                
 
33
                string IWriter.Write ()
 
34
                {
 
35
                        string s = "file:" + fileName;
 
36
                        foreach (string c in GetChildObjects ())
 
37
                                s += "[" + c + "]";
 
38
                        return s;
 
39
                }
 
40
                
 
41
                public override string ToString ()
 
42
                {
 
43
                        return title;
 
44
                }
 
45
                
 
46
                public string Test (string test)
 
47
                {
 
48
                        return test;
 
49
                }
 
50
        }
 
51
        
 
52
        public class ContentExtensionNode: TypeExtensionNode
 
53
        {
 
54
                [NodeAttribute]
 
55
                protected string xpath;
 
56
                
 
57
                public string XPath {
 
58
                        get { return xpath; }
 
59
                }
 
60
                
 
61
                public override object CreateInstance ()
 
62
                {
 
63
                        return xpath;
 
64
                }
 
65
        }
 
66
}