aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration/Templates
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/Templates
parentdb3dc558ec5fe5f3584081795865cd22f912da7d (diff)
parente6704dce7a2b7f6d5f9bbf1b8374cc7f00ea061e (diff)
downloadTango-6e2fbaffeec9d6e3518ea9706eea107a4f1b348c.tar.gz
Tango-6e2fbaffeec9d6e3518ea9706eea107a4f1b348c.zip
merge
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration/Templates')
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml1
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesStaticCollectionsFile.cshtml57
2 files changed, 58 insertions, 0 deletions
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>
+ }
+ }
+ }
+}