aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesStaticCollectionsFile.cshtml
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-08-20 19:43:15 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-08-20 19:43:15 +0300
commit51afc4f6a17383e91a72c2ce060e82604d43c3a8 (patch)
treec0aa029d9864fc8f03b69716a42eda5efe65ccd5 /Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesStaticCollectionsFile.cshtml
parent2ea6653199844f5607d17a8912eb7a99e2471610 (diff)
downloadTango-51afc4f6a17383e91a72c2ce060e82604d43c3a8.tar.gz
Tango-51afc4f6a17383e91a72c2ce060e82604d43c3a8.zip
Working on new Machine Studio DB.
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesStaticCollectionsFile.cshtml')
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesStaticCollectionsFile.cshtml57
1 files changed, 57 insertions, 0 deletions
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..f6a4a8793
--- /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>
+ private void InitCollectionSources()
+ {
+ @foreach (var prop in Model.Properties)
+ {
+ <div>
+ @(prop.Name)ViewSource = CreateCollectionView(@(prop.Name));
+ </div>
+ }
+ }
+ }
+}