~ubuntu-branches/ubuntu/karmic/mono-addins/karmic

« back to all changes in this revision

Viewing changes to Samples/TextEditorLib/ExtensionNodes/FileTemplateNode.cs

  • Committer: Bazaar Package Importer
  • Author(s): Mirco Bauer
  • Date: 2007-07-14 12:07:48 UTC
  • Revision ID: james.westby@ubuntu.com-20070714120748-2elczfsjlrdsrpms
Tags: upstream-0.2
ImportĀ upstreamĀ versionĀ 0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
using System;
 
3
using System.IO;
 
4
using Mono.Addins;
 
5
 
 
6
namespace TextEditor
 
7
{
 
8
        public class FileTemplateNode: ExtensionNode
 
9
        {
 
10
                [NodeAttribute]
 
11
                string resource;
 
12
                
 
13
                [NodeAttribute]
 
14
                string name;
 
15
                
 
16
                public string Name {
 
17
                        get { return name != null ? name : Id; }
 
18
                }
 
19
                
 
20
                public virtual string GetContent ()
 
21
                {
 
22
                        using (StreamReader sr = new StreamReader(Addin.GetResource (resource))) {
 
23
                                return sr.ReadToEnd (); 
 
24
                        }
 
25
                }
 
26
        }
 
27
}