aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-11-15 16:05:39 +0200
committerShlomo Hecht <shlomo@twine-s.com>2018-11-15 16:05:39 +0200
commita1f8844fe49ff35da98d8f0105e92ead3aa811dc (patch)
treeb8c73aae71ba5b8e38b93432d2b70222ed1a8b8b /Software/Visual_Studio/Tango.CodeGeneration
parent5daf3604b73bae541cea080b8302ee28d76eb662 (diff)
parenta614e97ebbb2b6ce557b6c428e3501bb1bcad626 (diff)
downloadTango-a1f8844fe49ff35da98d8f0105e92ead3aa811dc.tar.gz
Tango-a1f8844fe49ff35da98d8f0105e92ead3aa811dc.zip
merge
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration')
-rw-r--r--Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml25
1 files changed, 24 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml
index 2231c30f1..daa4e7d51 100644
--- a/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml
+++ b/Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml
@@ -34,6 +34,16 @@ namespace Tango.BL.Entities
{
@foreach (var prop in Model.Fields)
{
+ if (!prop.Name.EndsWith("Guid"))
+ {
+ <div>
+ public event EventHandler<@(prop.Type)> @(prop.Name)Changed;
+ </div>
+ }
+ }
+
+ @foreach (var prop in Model.Fields)
+ {
<div>
protected @(prop.Type) _@(prop.Name.ToLower());
@if (prop.DbDescription != null)
@@ -59,7 +69,20 @@ namespace Tango.BL.Entities
public @(prop.Construct || prop.Complex ? "virtual" : "") @(prop.Type) @(prop.Name)
{
get { return _@(prop.Name.ToLower()); }
- set { _@(prop.Name.ToLower()) = value; RaisePropertyChanged(nameof(@(prop.Name))); }
+ set
+ {
+ if (_@(prop.Name.ToLower()) != value)
+ {
+ _@(prop.Name.ToLower()) = value;
+ @if (!prop.Name.EndsWith("Guid"))
+ {
+ <div>
+ @(prop.Name)Changed?.Invoke(this, value);
+ </div>
+ }
+ RaisePropertyChanged(nameof(@(prop.Name)));
+ }
+ }
}
</div>
}