MonoDevelop Addins: hello world, tyring to find all references and files in project
[CSharpForFun/.git] / ServiceStack / T4TemplateTest / T4TemplateTest / PreprocessedT4Template.cs
1 // ------------------------------------------------------------------------------
2 //  <autogenerated>
3 //      This code was generated by a tool.
4 //      Mono Runtime Version: 4.0.30319.17020
5 // 
6 //      Changes to this file may cause incorrect behavior and will be lost if 
7 //      the code is regenerated.
8 //  </autogenerated>
9 // ------------------------------------------------------------------------------
10
11 namespace T4TemplateTest {
12     using System.Linq;
13     using System.Text;
14     using System.Collections.Generic;
15     using System;
16     
17     
18     public partial class PreprocessedT4Template : PreprocessedT4TemplateBase {
19         
20         public virtual string TransformText() {
21             this.GenerationEnvironment = null;
22             
23             #line 1 "/home/gustavo/github/CSharpForFun/ServiceStack/T4TemplateTest/T4TemplateTest/PreprocessedT4Template.tt"
24             this.Write("");
25             
26             #line default
27             #line hidden
28             
29             #line 6 "/home/gustavo/github/CSharpForFun/ServiceStack/T4TemplateTest/T4TemplateTest/PreprocessedT4Template.tt"
30             this.Write("\n\n");
31             
32             #line default
33             #line hidden
34             return this.GenerationEnvironment.ToString();
35         }
36         
37         public virtual void Initialize() {
38         }
39     }
40     
41     public class PreprocessedT4TemplateBase {
42         
43         private global::System.Text.StringBuilder builder;
44         
45         private global::System.Collections.Generic.IDictionary<string, object> session;
46         
47         private global::System.CodeDom.Compiler.CompilerErrorCollection errors;
48         
49         private string currentIndent = string.Empty;
50         
51         private global::System.Collections.Generic.Stack<int> indents;
52         
53         private ToStringInstanceHelper _toStringHelper = new ToStringInstanceHelper();
54         
55         public virtual global::System.Collections.Generic.IDictionary<string, object> Session {
56             get {
57                 return this.session;
58             }
59             set {
60                 this.session = value;
61             }
62         }
63         
64         public global::System.Text.StringBuilder GenerationEnvironment {
65             get {
66                 if ((this.builder == null)) {
67                     this.builder = new global::System.Text.StringBuilder();
68                 }
69                 return this.builder;
70             }
71             set {
72                 this.builder = value;
73             }
74         }
75         
76         protected global::System.CodeDom.Compiler.CompilerErrorCollection Errors {
77             get {
78                 if ((this.errors == null)) {
79                     this.errors = new global::System.CodeDom.Compiler.CompilerErrorCollection();
80                 }
81                 return this.errors;
82             }
83         }
84         
85         public string CurrentIndent {
86             get {
87                 return this.currentIndent;
88             }
89         }
90         
91         private global::System.Collections.Generic.Stack<int> Indents {
92             get {
93                 if ((this.indents == null)) {
94                     this.indents = new global::System.Collections.Generic.Stack<int>();
95                 }
96                 return this.indents;
97             }
98         }
99         
100         public ToStringInstanceHelper ToStringHelper {
101             get {
102                 return this._toStringHelper;
103             }
104         }
105         
106         public void Error(string message) {
107             this.Errors.Add(new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message));
108         }
109         
110         public void Warning(string message) {
111             global::System.CodeDom.Compiler.CompilerError val = new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message);
112             val.IsWarning = true;
113             this.Errors.Add(val);
114         }
115         
116         public string PopIndent() {
117             if ((this.Indents.Count == 0)) {
118                 return string.Empty;
119             }
120             int lastPos = (this.currentIndent.Length - this.Indents.Pop());
121             string last = this.currentIndent.Substring(lastPos);
122             this.currentIndent = this.currentIndent.Substring(0, lastPos);
123             return last;
124         }
125         
126         public void PushIndent(string indent) {
127             this.Indents.Push(indent.Length);
128             this.currentIndent = (this.currentIndent + indent);
129         }
130         
131         public void ClearIndent() {
132             this.currentIndent = string.Empty;
133             this.Indents.Clear();
134         }
135         
136         public void Write(string textToAppend) {
137             this.GenerationEnvironment.Append(textToAppend);
138         }
139         
140         public void Write(string format, params object[] args) {
141             this.GenerationEnvironment.AppendFormat(format, args);
142         }
143         
144         public void WriteLine(string textToAppend) {
145             this.GenerationEnvironment.Append(this.currentIndent);
146             this.GenerationEnvironment.AppendLine(textToAppend);
147         }
148         
149         public void WriteLine(string format, params object[] args) {
150             this.GenerationEnvironment.Append(this.currentIndent);
151             this.GenerationEnvironment.AppendFormat(format, args);
152             this.GenerationEnvironment.AppendLine();
153         }
154         
155         public class ToStringInstanceHelper {
156             
157             private global::System.IFormatProvider formatProvider = global::System.Globalization.CultureInfo.InvariantCulture;
158             
159             public global::System.IFormatProvider FormatProvider {
160                 get {
161                     return this.formatProvider;
162                 }
163                 set {
164                     if ((this.formatProvider == null)) {
165                         throw new global::System.ArgumentNullException("formatProvider");
166                     }
167                     this.formatProvider = value;
168                 }
169             }
170             
171             public string ToStringWithCulture(object objectToConvert) {
172                 if ((objectToConvert == null)) {
173                     throw new global::System.ArgumentNullException("objectToConvert");
174                 }
175                 global::System.Type type = objectToConvert.GetType();
176                 global::System.Type iConvertibleType = typeof(global::System.IConvertible);
177                 if (iConvertibleType.IsAssignableFrom(type)) {
178                     return ((global::System.IConvertible)(objectToConvert)).ToString(this.formatProvider);
179                 }
180                 global::System.Reflection.MethodInfo methInfo = type.GetMethod("ToString", new global::System.Type[] {
181                             iConvertibleType});
182                 if ((methInfo != null)) {
183                     return ((string)(methInfo.Invoke(objectToConvert, new object[] {
184                                 this.formatProvider})));
185                 }
186                 return objectToConvert.ToString();
187             }
188         }
189     }
190 }