From 3e665934f3f01b2cdd3de3fbc2c03ae27ac5740e Mon Sep 17 00:00:00 2001 From: Roy Date: Wed, 6 Dec 2017 10:11:45 +0200 Subject: Moved ExtendedObject & RelayCommand to Core. CodeGeneration EntityCodeFile working + cycle reference! --- .../Tango.CodeGeneration/EntityCodeFile.cs | 29 ++++++++++ .../Tango.CodeGeneration/FilterGLCodeFile.cs | 17 ------ .../Visual_Studio/Tango.CodeGeneration/Helper.cs | 8 +-- .../Tango.CodeGeneration.csproj | 6 ++- .../Templates/EntityCodeFile.cshtml | 61 ++++++++++++++++++++++ .../Tango.CodeGeneration/packages.config | 2 +- 6 files changed, 101 insertions(+), 22 deletions(-) create mode 100644 Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs delete mode 100644 Software/Visual_Studio/Tango.CodeGeneration/FilterGLCodeFile.cs create mode 100644 Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml (limited to 'Software/Visual_Studio/Tango.CodeGeneration') diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs new file mode 100644 index 000000000..a6512dbee --- /dev/null +++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.CodeGeneration +{ + public class EntityCodeFile : Class + { + public String TableName { get; set; } + + public List Fields { get; set; } + + public EntityCodeFile(String name) : base(name) + { + Fields = new List(); + } + } + + public class EntityCodeFileField + { + public String Name { get; set; } + public String FieldName { get; set; } + public String Type { get; set; } + public String Description { get; set; } + public bool Construct { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/FilterGLCodeFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/FilterGLCodeFile.cs deleted file mode 100644 index f560711d0..000000000 --- a/Software/Visual_Studio/Tango.CodeGeneration/FilterGLCodeFile.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tango.CodeGeneration -{ - public class FilterGLCodeFile : Class - { - public FilterGLCodeFile(String name) - : base(name) - { - - } - } -} diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Helper.cs b/Software/Visual_Studio/Tango.CodeGeneration/Helper.cs index 0ca012be9..2e0e449f1 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Helper.cs +++ b/Software/Visual_Studio/Tango.CodeGeneration/Helper.cs @@ -30,12 +30,14 @@ namespace Tango.CodeGeneration public static String GetTemplate(String name) { var assembly = Assembly.GetAssembly(typeof(Helper)); - var resourceName = "CodeGenerator.Templates." + name + ".cshtml"; + var resourceName = typeof(Helper).Namespace + ".Templates." + name + ".cshtml"; using (Stream stream = assembly.GetManifestResourceStream(resourceName)) - using (StreamReader reader = new StreamReader(stream)) { - return reader.ReadToEnd(); + using (StreamReader reader = new StreamReader(stream)) + { + return reader.ReadToEnd(); + } } } diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj index 989cfdf8d..e9f1fd586 100644 --- a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj +++ b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj @@ -47,6 +47,9 @@ + + ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll + @@ -61,7 +64,7 @@ - + @@ -89,6 +92,7 @@ +