From: Gustavo Martin Morcuende Date: Sun, 11 Jan 2015 21:14:04 +0000 (+0100) Subject: MonoDevelop Addins: hello world, tyring to find all references and files in project X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;ds=sidebyside;p=CSharpForFun%2F.git MonoDevelop Addins: hello world, tyring to find all references and files in project --- diff --git a/MonoDevelop/addins/MonoDevelop.HelloWorld/MonoDevelop.HelloWorld/ShowFilesDialog.cs b/MonoDevelop/addins/MonoDevelop.HelloWorld/MonoDevelop.HelloWorld/ShowFilesDialog.cs index bcbe6ed..38f1d09 100644 --- a/MonoDevelop/addins/MonoDevelop.HelloWorld/MonoDevelop.HelloWorld/ShowFilesDialog.cs +++ b/MonoDevelop/addins/MonoDevelop.HelloWorld/MonoDevelop.HelloWorld/ShowFilesDialog.cs @@ -14,6 +14,7 @@ * limitations under the License. */ using System; +using System.Linq; using MonoDevelop.Projects; using System.Text; @@ -34,11 +35,13 @@ namespace MonoDevelop.HelloWorld var fileNames = new StringBuilder (); fileNames.Append ("Project name: " + project.Name); fileNames.Append (Environment.NewLine); - foreach (var file in project.Files) + // IT DOESN'T FIND ALL REFERENCES IN PROJECT!!! WHAT CAN I DO??? :( + project.GetItemFiles (true).ForEach (file => { - fileNames.Append(file.Name); + fileNames.Append (file.FullPath); fileNames.Append (Environment.NewLine); - } + }); + this.ShowFilesTextView.Buffer.Text = fileNames.ToString (); } } diff --git a/ServiceStack/T4TemplateTest/T4TemplateTest/Column.cs b/ServiceStack/T4TemplateTest/T4TemplateTest/Column.cs new file mode 100644 index 0000000..4b8117c --- /dev/null +++ b/ServiceStack/T4TemplateTest/T4TemplateTest/Column.cs @@ -0,0 +1,27 @@ +// /** +// * Copyright 2015 Gustavo Martin Morcuende +// * +// * Licensed under the Apache License, Version 2.0 (the "License"); +// * you may not use this file except in compliance with the License. +// * You may obtain a copy of the License at +// * +// * http://www.apache.org/licenses/LICENSE-2.0 +// * +// * Unless required by applicable law or agreed to in writing, software +// * distributed under the License is distributed on an "AS IS" BASIS, +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// * See the License for the specific language governing permissions and +// * limitations under the License. +// */ +using System; + +namespace T4TemplateTest +{ + public class Column + { + public Column () + { + } + } +} + diff --git a/ServiceStack/T4TemplateTest/T4TemplateTest/MyClass.cs b/ServiceStack/T4TemplateTest/T4TemplateTest/MyClass.cs new file mode 100644 index 0000000..d42d641 --- /dev/null +++ b/ServiceStack/T4TemplateTest/T4TemplateTest/MyClass.cs @@ -0,0 +1,27 @@ +// /** +// * Copyright 2015 Gustavo Martin Morcuende +// * +// * Licensed under the Apache License, Version 2.0 (the "License"); +// * you may not use this file except in compliance with the License. +// * You may obtain a copy of the License at +// * +// * http://www.apache.org/licenses/LICENSE-2.0 +// * +// * Unless required by applicable law or agreed to in writing, software +// * distributed under the License is distributed on an "AS IS" BASIS, +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// * See the License for the specific language governing permissions and +// * limitations under the License. +// */ +using System; + +namespace T4TemplateTest +{ + public class MyClass + { + public MyClass () + { + } + } +} + diff --git a/ServiceStack/T4TemplateTest/T4TemplateTest/MySQLSchemaReader.cs b/ServiceStack/T4TemplateTest/T4TemplateTest/MySQLSchemaReader.cs new file mode 100644 index 0000000..7fbbb16 --- /dev/null +++ b/ServiceStack/T4TemplateTest/T4TemplateTest/MySQLSchemaReader.cs @@ -0,0 +1,26 @@ +// Copyright 2015 Gustavo Martin Morcuende +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +using System; + +namespace T4TemplateTest +{ + public class MySQLSchemaReader + { + public MySQLSchemaReader () + { + } + } +} + diff --git a/ServiceStack/T4TemplateTest/T4TemplateTest/PreprocessedT4Template.cs b/ServiceStack/T4TemplateTest/T4TemplateTest/PreprocessedT4Template.cs new file mode 100644 index 0000000..bd65e5d --- /dev/null +++ b/ServiceStack/T4TemplateTest/T4TemplateTest/PreprocessedT4Template.cs @@ -0,0 +1,190 @@ +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Mono Runtime Version: 4.0.30319.17020 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ + +namespace T4TemplateTest { + using System.Linq; + using System.Text; + using System.Collections.Generic; + using System; + + + public partial class PreprocessedT4Template : PreprocessedT4TemplateBase { + + public virtual string TransformText() { + this.GenerationEnvironment = null; + + #line 1 "/home/gustavo/github/CSharpForFun/ServiceStack/T4TemplateTest/T4TemplateTest/PreprocessedT4Template.tt" + this.Write(""); + + #line default + #line hidden + + #line 6 "/home/gustavo/github/CSharpForFun/ServiceStack/T4TemplateTest/T4TemplateTest/PreprocessedT4Template.tt" + this.Write("\n\n"); + + #line default + #line hidden + return this.GenerationEnvironment.ToString(); + } + + public virtual void Initialize() { + } + } + + public class PreprocessedT4TemplateBase { + + private global::System.Text.StringBuilder builder; + + private global::System.Collections.Generic.IDictionary session; + + private global::System.CodeDom.Compiler.CompilerErrorCollection errors; + + private string currentIndent = string.Empty; + + private global::System.Collections.Generic.Stack indents; + + private ToStringInstanceHelper _toStringHelper = new ToStringInstanceHelper(); + + public virtual global::System.Collections.Generic.IDictionary Session { + get { + return this.session; + } + set { + this.session = value; + } + } + + public global::System.Text.StringBuilder GenerationEnvironment { + get { + if ((this.builder == null)) { + this.builder = new global::System.Text.StringBuilder(); + } + return this.builder; + } + set { + this.builder = value; + } + } + + protected global::System.CodeDom.Compiler.CompilerErrorCollection Errors { + get { + if ((this.errors == null)) { + this.errors = new global::System.CodeDom.Compiler.CompilerErrorCollection(); + } + return this.errors; + } + } + + public string CurrentIndent { + get { + return this.currentIndent; + } + } + + private global::System.Collections.Generic.Stack Indents { + get { + if ((this.indents == null)) { + this.indents = new global::System.Collections.Generic.Stack(); + } + return this.indents; + } + } + + public ToStringInstanceHelper ToStringHelper { + get { + return this._toStringHelper; + } + } + + public void Error(string message) { + this.Errors.Add(new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message)); + } + + public void Warning(string message) { + global::System.CodeDom.Compiler.CompilerError val = new global::System.CodeDom.Compiler.CompilerError(null, -1, -1, null, message); + val.IsWarning = true; + this.Errors.Add(val); + } + + public string PopIndent() { + if ((this.Indents.Count == 0)) { + return string.Empty; + } + int lastPos = (this.currentIndent.Length - this.Indents.Pop()); + string last = this.currentIndent.Substring(lastPos); + this.currentIndent = this.currentIndent.Substring(0, lastPos); + return last; + } + + public void PushIndent(string indent) { + this.Indents.Push(indent.Length); + this.currentIndent = (this.currentIndent + indent); + } + + public void ClearIndent() { + this.currentIndent = string.Empty; + this.Indents.Clear(); + } + + public void Write(string textToAppend) { + this.GenerationEnvironment.Append(textToAppend); + } + + public void Write(string format, params object[] args) { + this.GenerationEnvironment.AppendFormat(format, args); + } + + public void WriteLine(string textToAppend) { + this.GenerationEnvironment.Append(this.currentIndent); + this.GenerationEnvironment.AppendLine(textToAppend); + } + + public void WriteLine(string format, params object[] args) { + this.GenerationEnvironment.Append(this.currentIndent); + this.GenerationEnvironment.AppendFormat(format, args); + this.GenerationEnvironment.AppendLine(); + } + + public class ToStringInstanceHelper { + + private global::System.IFormatProvider formatProvider = global::System.Globalization.CultureInfo.InvariantCulture; + + public global::System.IFormatProvider FormatProvider { + get { + return this.formatProvider; + } + set { + if ((this.formatProvider == null)) { + throw new global::System.ArgumentNullException("formatProvider"); + } + this.formatProvider = value; + } + } + + public string ToStringWithCulture(object objectToConvert) { + if ((objectToConvert == null)) { + throw new global::System.ArgumentNullException("objectToConvert"); + } + global::System.Type type = objectToConvert.GetType(); + global::System.Type iConvertibleType = typeof(global::System.IConvertible); + if (iConvertibleType.IsAssignableFrom(type)) { + return ((global::System.IConvertible)(objectToConvert)).ToString(this.formatProvider); + } + global::System.Reflection.MethodInfo methInfo = type.GetMethod("ToString", new global::System.Type[] { + iConvertibleType}); + if ((methInfo != null)) { + return ((string)(methInfo.Invoke(objectToConvert, new object[] { + this.formatProvider}))); + } + return objectToConvert.ToString(); + } + } + } +} diff --git a/ServiceStack/T4TemplateTest/T4TemplateTest/PreprocessedT4Template.tt b/ServiceStack/T4TemplateTest/T4TemplateTest/PreprocessedT4Template.tt new file mode 100644 index 0000000..e7f90f0 --- /dev/null +++ b/ServiceStack/T4TemplateTest/T4TemplateTest/PreprocessedT4Template.tt @@ -0,0 +1,7 @@ +<#@ template language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> + + diff --git a/ServiceStack/T4TemplateTest/T4TemplateTest/SchemaReader.cs b/ServiceStack/T4TemplateTest/T4TemplateTest/SchemaReader.cs new file mode 100644 index 0000000..99f2be8 --- /dev/null +++ b/ServiceStack/T4TemplateTest/T4TemplateTest/SchemaReader.cs @@ -0,0 +1,26 @@ +// Copyright 2015 Gustavo Martin Morcuende +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +using System; + +namespace T4TemplateTest +{ + public class SchemaReader + { + public SchemaReader () + { + } + } +} + diff --git a/ServiceStack/T4TemplateTest/T4TemplateTest/Table.cs b/ServiceStack/T4TemplateTest/T4TemplateTest/Table.cs new file mode 100644 index 0000000..3f5dd93 --- /dev/null +++ b/ServiceStack/T4TemplateTest/T4TemplateTest/Table.cs @@ -0,0 +1,27 @@ +// /** +// * Copyright 2015 Gustavo Martin Morcuende +// * +// * Licensed under the Apache License, Version 2.0 (the "License"); +// * you may not use this file except in compliance with the License. +// * You may obtain a copy of the License at +// * +// * http://www.apache.org/licenses/LICENSE-2.0 +// * +// * Unless required by applicable law or agreed to in writing, software +// * distributed under the License is distributed on an "AS IS" BASIS, +// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// * See the License for the specific language governing permissions and +// * limitations under the License. +// */ +using System; + +namespace T4TemplateTest +{ + public class Table + { + public Table () + { + } + } +} + diff --git a/ServiceStack/T4TemplateTest/T4TemplateTest/app.config b/ServiceStack/T4TemplateTest/T4TemplateTest/app.config new file mode 100644 index 0000000..6a6c40b --- /dev/null +++ b/ServiceStack/T4TemplateTest/T4TemplateTest/app.config @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/ServiceStack/T4TemplateTest/T4TemplateTest/packages.config b/ServiceStack/T4TemplateTest/T4TemplateTest/packages.config new file mode 100644 index 0000000..58c50dc --- /dev/null +++ b/ServiceStack/T4TemplateTest/T4TemplateTest/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file