aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-02-25 11:02:07 +0200
committerShlomo Hecht <shlomo@twine-s.com>2019-02-25 11:02:07 +0200
commitb462fdd744f491b04137fd99863f6cb6c623cfa0 (patch)
tree2f69f8e953450a0452442c24f3809aec84ce7db0 /Software/Visual_Studio/Tango.CodeGeneration
parenta8ddb23154fe5111c9509fa0a83dcc36adcba4ee (diff)
parent44a35db8a2929fb3f6aa56ed08185e066292f106 (diff)
downloadTango-b462fdd744f491b04137fd99863f6cb6c623cfa0.tar.gz
Tango-b462fdd744f491b04137fd99863f6cb6c623cfa0.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration')
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Class.cs5
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs5
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/EntityDTOCodeFile.cs19
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/EntityInheritedDTOCodeFile.cs23
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Property.cs5
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj6
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityDTOCodeFile.cshtml44
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityInheritedDTOCodeFile.cshtml24
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml15
9 files changed, 137 insertions, 9 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Class.cs b/Software/Visual_Studio/Tango.CodeGeneration/Class.cs
index 6f1f4f3b9..5a8ea1e74 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Class.cs
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Class.cs
@@ -17,6 +17,11 @@ namespace Tango.CodeGeneration
/// </summary>
public String Name { get; set; }
+ /// <summary>
+ /// Gets or sets the description.
+ /// </summary>
+ public String Description { get; set; }
+
public List<String> InheritsFrom { get; set; }
/// <summary>
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs
index 9216f5c29..958754a60 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs
+++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityCodeFile.cs
@@ -28,11 +28,6 @@ namespace Tango.CodeGeneration
public List<EntityCodeFileField> Fields { get; set; }
/// <summary>
- /// Gets or sets the description.
- /// </summary>
- public String Description { get; set; }
-
- /// <summary>
/// Initializes a new instance of the <see cref="EntityCodeFile"/> class.
/// </summary>
/// <param name="name">The code file name.</param>
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityDTOCodeFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityDTOCodeFile.cs
new file mode 100644
index 000000000..eb97dcd90
--- /dev/null
+++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityDTOCodeFile.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.CodeGeneration
+{
+ /// <summary>
+ /// Represents a database entity DTO code file.
+ /// </summary>
+ /// <seealso cref="Tango.CodeGeneration.Class" />
+ public class EntityDTOCodeFile : Class
+ {
+ public String ObservableType { get; set; }
+
+ public String InheritedType { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/EntityInheritedDTOCodeFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/EntityInheritedDTOCodeFile.cs
new file mode 100644
index 000000000..297050d69
--- /dev/null
+++ b/Software/Visual_Studio/Tango.CodeGeneration/EntityInheritedDTOCodeFile.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.CodeGeneration
+{
+ /// <summary>
+ /// Represents a database entity DTO code file.
+ /// </summary>
+ /// <seealso cref="Tango.CodeGeneration.Class" />
+ public class EntityInheritedDTOCodeFile : Class
+ {
+ public String BaseClass { get; set; }
+
+ public EntityInheritedDTOCodeFile(String name, String baseClass)
+ {
+ Name = name;
+ BaseClass = baseClass;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Property.cs b/Software/Visual_Studio/Tango.CodeGeneration/Property.cs
index d7ca5f4a8..cb27ca2a4 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Property.cs
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Property.cs
@@ -23,6 +23,11 @@ namespace Tango.CodeGeneration
public String Type { get; set; }
/// <summary>
+ /// Gets or sets the property description.
+ /// </summary>
+ public String Description { get; set; }
+
+ /// <summary>
/// Gets or sets the property setter modifier.
/// </summary>
public CodeObjectModifier SetterModifier { get; set; }
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj
index 98c063a86..a3b02afd5 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj
@@ -65,6 +65,8 @@
<Compile Include="CodeObject.cs" />
<Compile Include="CustomResolver.cs" />
<Compile Include="DpProperty.cs" />
+ <Compile Include="EntityInheritedDTOCodeFile.cs" />
+ <Compile Include="EntityDTOCodeFile.cs" />
<Compile Include="EntityCodeFileJavaExtension.cs" />
<Compile Include="EntityCodeFileJava.cs" />
<Compile Include="EntityCodeFile.cs" />
@@ -120,11 +122,13 @@
<EmbeddedResource Include="Templates\ObservablesStaticCollectionsFile.cshtml" />
<EmbeddedResource Include="Templates\EntityInheritedCodeFile.cshtml" />
<EmbeddedResource Include="Templates\TangoWebClientCodeFile.cshtml" />
+ <EmbeddedResource Include="Templates\EntityDTOCodeFile.cshtml" />
+ <EmbeddedResource Include="Templates\EntityInheritedDTOCodeFile.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
+ <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityDTOCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityDTOCodeFile.cshtml
new file mode 100644
index 000000000..7992aeb86
--- /dev/null
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityDTOCodeFile.cshtml
@@ -0,0 +1,44 @@
+@{
+ Tango.CodeGeneration.EntityDTOCodeFile model = Model as Tango.CodeGeneration.EntityDTOCodeFile;
+}
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Tango Observables Generator
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated. Do not modify!
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.BL.Entities;
+
+namespace Tango.BL.DTO
+{
+ @if (model.Description != null)
+ {
+ <div>
+ /// <summary>
+ /// @(model.Description)
+ /// </summary>
+ </div>
+ }
+ public abstract class @(model.Name) : ObservableEntityDTO<@(model.InheritedType), @(model.ObservableType)>
+ {
+ @foreach (var prop in model.Properties)
+ {
+ <div>
+ /// <summary>
+ /// @(prop.Description)
+ /// </summary>
+ public @(prop.Type) @(prop.Name) { get; set; }
+
+ </div>
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityInheritedDTOCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityInheritedDTOCodeFile.cshtml
new file mode 100644
index 000000000..2501b37d1
--- /dev/null
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityInheritedDTOCodeFile.cshtml
@@ -0,0 +1,24 @@
+@{
+ Tango.CodeGeneration.EntityInheritedDTOCodeFile model = Model as Tango.CodeGeneration.EntityInheritedDTOCodeFile;
+}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.BL.DTO
+{
+ @if (model.Description != null)
+ {
+ <div>
+ /// <summary>
+ /// @(model.Description)
+ /// </summary>
+ </div>
+ }
+ public class @(model.Name) : @(model.BaseClass)
+ {
+
+ }
+}
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml
index 100171849..7d9ebc075 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/TangoWebClientCodeFile.cshtml
@@ -1,10 +1,9 @@
@{
Tango.CodeGeneration.TangoWebClientCodeFile model = Model as Tango.CodeGeneration.TangoWebClientCodeFile;
}
-
+using System;
using System.Threading.Tasks;
using Tango.Web;
-using Tango.Web.Authentication;
namespace @(model.Namespace)
{
@@ -19,7 +18,7 @@ namespace @(model.Namespace)
/// </summary>
/// <param name="environment">The environment.</param>
/// <param name="token">Existing token.</param>
- public @(model.Name)(DeploymentSlot environment, WebToken token) : base(environment, "@(model.ControllerName)", token)
+ public @(model.Name)(DeploymentSlot environment, String token) : base(environment, "@(model.ControllerName)", token)
{
}
@@ -33,6 +32,16 @@ namespace @(model.Namespace)
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="@(model.Name)"/> class.
+ /// </summary>
+ /// <param name="address">The service address.</param>
+ /// <param name="token">Existing token.</param>
+ public @(model.Name)(String address, String token) : base(address, "@(model.ControllerName)", token)
+ {
+
+ }
+
@foreach (var action in model.Actions)
{
<div>