diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-11-13 23:45:05 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-11-13 23:45:05 +0200 |
| commit | ac99f9c47f1342467e2a4cb4b4253f9d1cac975c (patch) | |
| tree | 769662514064ce0a42822571f2a41ff493cdf5ed /Software/Visual_Studio/Tango.BL/ObservableEntity.cs | |
| parent | 5bb0034f312316bfda66a6ee8d2675b6672f5411 (diff) | |
| download | Tango-ac99f9c47f1342467e2a4cb4b4253f9d1cac975c.tar.gz Tango-ac99f9c47f1342467e2a4cb4b4253f9d1cac975c.zip | |
Improvements on FSE configuration sites.
Diffstat (limited to 'Software/Visual_Studio/Tango.BL/ObservableEntity.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/ObservableEntity.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs index 71ac2294a..656b138b4 100644 --- a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs +++ b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs @@ -30,6 +30,7 @@ using Newtonsoft.Json.Linq; using Tango.BL.ActionLogs; using Tango.BL.ValueObjects; using LiteDB; +using System.Linq.Expressions; namespace Tango.BL { @@ -666,6 +667,23 @@ namespace Tango.BL } } + public void RaisePropertyChanged<F>(Expression<Func<T, F>> expression) + { + MemberExpression member = expression.Body as MemberExpression; + if (member == null) + throw new ArgumentException(string.Format( + "Expression '{0}' refers to a method, not a property.", + expression.ToString())); + + PropertyInfo propInfo = member.Member as PropertyInfo; + if (propInfo == null) + throw new ArgumentException(string.Format( + "Expression '{0}' refers to a field, not a property.", + expression.ToString())); + + RaisePropertyChanged(propInfo.Name); + } + #endregion #region Action Log |
