diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-15 12:50:03 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-15 12:50:03 +0200 |
| commit | 0f6d30eb6a003eee2ebc3008a45170e0c2bb8cdd (patch) | |
| tree | 85e05583eb7a2a6323a8156b8db30a946c74c60b /Software/Visual_Studio/Tango.CodeGeneration/Templates | |
| parent | 6ffe8dafa65ee428aa9866d8b13d1d96e440023a (diff) | |
| download | Tango-0f6d30eb6a003eee2ebc3008a45170e0c2bb8cdd.tar.gz Tango-0f6d30eb6a003eee2ebc3008a45170e0c2bb8cdd.zip | |
Optimized accuracy of CSV recordings!
Diffstat (limited to 'Software/Visual_Studio/Tango.CodeGeneration/Templates')
| -rw-r--r-- | Software/Visual_Studio/Tango.CodeGeneration/Templates/EntityCodeFile.cshtml | 25 |
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> } |
