aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesAdapterFile.cshtml
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2017-12-19 10:25:40 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2017-12-19 10:25:40 +0200
commitafc7a07d285e08d905c58dd5978441c155b2f296 (patch)
treea2f4f51ef2747ae3a2aded2637a352ce8ef85934 /Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesAdapterFile.cshtml
parentad35c9c2df0001157ea13312382f3cdfdad67f06 (diff)
downloadTango-afc7a07d285e08d905c58dd5978441c155b2f296.tar.gz
Tango-afc7a07d285e08d905c58dd5978441c155b2f296.zip
MERGE.
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesAdapterFile.cshtml')
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesAdapterFile.cshtml46
1 files changed, 46 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesAdapterFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesAdapterFile.cshtml
new file mode 100644
index 000000000..856b8ac42
--- /dev/null
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/ObservablesAdapterFile.cshtml
@@ -0,0 +1,46 @@
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+
+namespace Tango.DAL.Observables
+{
+ 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>
+ }
+ }
+ }
+}