aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-08-26 10:55:44 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-08-26 10:55:44 +0300
commit6e2fbaffeec9d6e3518ea9706eea107a4f1b348c (patch)
treef50b3d8962dd37188061f8f52c1a7aeff1642232 /Software/Visual_Studio/Tango.CodeGeneration
parentdb3dc558ec5fe5f3584081795865cd22f912da7d (diff)
parente6704dce7a2b7f6d5f9bbf1b8374cc7f00ea061e (diff)
downloadTango-6e2fbaffeec9d6e3518ea9706eea107a4f1b348c.tar.gz
Tango-6e2fbaffeec9d6e3518ea9706eea107a4f1b348c.zip
merge
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration')
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/ObservablesStaticCollectionsFile.cs12
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj4
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml1
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesStaticCollectionsFile.cshtml57
5 files changed, 74 insertions, 2 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/ObservablesStaticCollectionsFile.cs b/Software/Visual_Studio/Tango.CodeGeneration/ObservablesStaticCollectionsFile.cs
new file mode 100644
index 000000000..0e4e4bf3e
--- /dev/null
+++ b/Software/Visual_Studio/Tango.CodeGeneration/ObservablesStaticCollectionsFile.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.CodeGeneration
+{
+ public class ObservablesStaticCollectionsFile : Class
+ {
+ }
+}
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.CodeGeneration/Properties/AssemblyInfo.cs
index 3aa9e6fbd..20dcb4bd3 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Properties/AssemblyInfo.cs
@@ -3,5 +3,5 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Tango - Code Generation Components")]
-[assembly: AssemblyVersion("2.0.14.1633")]
+[assembly: AssemblyVersion("2.0.16.1159")]
[assembly: ComVisible(false)] \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj
index a9517f3b2..ef89bd682 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Tango.CodeGeneration.csproj
@@ -70,6 +70,7 @@
<Compile Include="EntityCodeFile.cs" />
<Compile Include="EnumerationField.cs" />
<Compile Include="ObservablesContextCodeFile.cs" />
+ <Compile Include="ObservablesStaticCollectionsFile.cs" />
<Compile Include="ProtoEnumFile.cs" />
<Compile Include="ProtoMessageFile.cs" />
<Compile Include="ProtoProperty.cs" />
@@ -114,11 +115,12 @@
<EmbeddedResource Include="Templates\ProtoMessageFile.cshtml" />
<EmbeddedResource Include="Templates\ProtoEnumFile.cshtml" />
<EmbeddedResource Include="Templates\EntityCodeFileJavaExtension.cshtml" />
+ <EmbeddedResource Include="Templates\ObservablesStaticCollectionsFile.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</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/EntityCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml
index 873668545..cb8760755 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml
@@ -74,6 +74,7 @@ namespace Tango.BL.Entities
{
<div>
@(prop.Name) = new @(prop.Type)();
+ @(prop.Name).EnableCrossThreadOperations();
</div>
}
}
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesStaticCollectionsFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesStaticCollectionsFile.cshtml
new file mode 100644
index 000000000..8fc0dffce
--- /dev/null
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesStaticCollectionsFile.cshtml
@@ -0,0 +1,57 @@
+//------------------------------------------------------------------------------
+// <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.Collections.ObjectModel;
+using System.ComponentModel;
+using Tango.BL.Entities;
+
+namespace Tango.BL
+{
+ public partial class @(Model.Name)
+ {
+ @foreach (var prop in Model.Properties)
+ {
+ <div>
+ private @(prop.Type) _@(prop.Name.ToLower());
+ /// <summary>
+ /// Gets or sets the @(prop.Name).
+ /// </summary>
+ public @(prop.Type) @(prop.Name)
+ {
+ get { return _@(prop.Name.ToLower()); }
+ set { _@(prop.Name.ToLower()) = value; RaisePropertyChanged(nameof(@(prop.Name))); }
+ }
+
+ private ICollectionView _@(prop.Name.ToLower())ViewSource;
+ /// <summary>
+ /// Gets or sets the @(prop.Name) View Source.
+ ///</summary>
+ public ICollectionView @(prop.Name)ViewSource
+ {
+ get { return _@(prop.Name.ToLower())ViewSource; }
+ set { _@(prop.Name.ToLower())ViewSource = value; RaisePropertyChanged(nameof(@(prop.Name)ViewSource)); }
+ }
+ </div>
+ }
+
+ /// <summary>
+ /// Initialize collection sources.
+ /// </summary>
+ public void InitCollectionSources()
+ {
+ @foreach (var prop in Model.Properties)
+ {
+ <div>
+ @(prop.Name)ViewSource = CreateCollectionView(@(prop.Name));
+ </div>
+ }
+ }
+ }
+}