aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2018-12-29 00:22:20 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2018-12-29 00:22:20 +0200
commit7b69f9a96ab82e3a6e2345092600edf5854f5f4f (patch)
tree8a292b63d442da08ee93bc90658172a7603abf38 /Software/Visual_Studio/Tango.CodeGeneration
parent68a9642a95545368ed7e9f9a7e2836f86143b439 (diff)
downloadTango-7b69f9a96ab82e3a6e2345092600edf5854f5f4f.tar.gz
Tango-7b69f9a96ab82e3a6e2345092600edf5854f5f4f.zip
Added DISPENSERS & SPOOLS tables.
Modified Observable Entities to have an On****Changed methods !
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration')
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml23
1 files changed, 20 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml
index daa4e7d51..dfcceb1dd 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml
@@ -77,15 +77,32 @@ namespace Tango.BL.Entities
@if (!prop.Name.EndsWith("Guid"))
{
<div>
- @(prop.Name)Changed?.Invoke(this, value);
+ On@(prop.Name)Changed(value);
</div>
- }
- RaisePropertyChanged(nameof(@(prop.Name)));
+ }
}
}
}
</div>
}
+
+
+ @foreach (var prop in Model.Fields)
+ {
+ if (!prop.Name.EndsWith("Guid"))
+ {
+ <div>
+ /// <summary>
+ /// Called when the @(prop.Name) has changed.
+ /// </summary>
+ protected virtual void On@(prop.Name)Changed(@(prop.Type) @(prop.Name.ToLower()))
+ {
+ @(prop.Name)Changed?.Invoke(this, @(prop.Name.ToLower()));
+ RaisePropertyChanged(nameof(@(prop.Name)));
+ }
+ </div>
+ }
+ }
/// <summary>
/// Initializes a new instance of the <see cref="@(Model.Name)" /> class.