@@ -29,7 +29,7 @@ namespace EntityMaxLengthTrim
29
29
/// <remarks></remarks>
30
30
/// <seealso cref="System.ComponentModel.INotifyPropertyChanged" />
31
31
/// =================================================================================================
32
- public class EntityPropChangeEventBase : INotifyPropertyChanged
32
+ public abstract class EntityPropChangeEventBase : INotifyPropertyChanged
33
33
{
34
34
/// <summary>
35
35
/// Property changed event handler
@@ -41,7 +41,9 @@ public class EntityPropChangeEventBase : INotifyPropertyChanged
41
41
/// </summary>
42
42
/// <param name="callingEntity">Calling entity</param>
43
43
/// <param name="propertyName">Changed property name</param>
44
- protected virtual void OnPropertyChanged < T > ( T callingEntity , string propertyName )
44
+ /// <typeparam name="TEntity">Calling entity type</typeparam>
45
+ protected virtual void OnPropertyChanged < TEntity > ( TEntity callingEntity , string propertyName )
46
+ where TEntity : class
45
47
{
46
48
StringInterceptor . ApplyStringMaxAllowedLength ( callingEntity , propertyName , false ) ;
47
49
PropertyChanged ? . Invoke ( callingEntity , new PropertyChangedEventArgs ( propertyName ) ) ;
@@ -54,10 +56,11 @@ protected virtual void OnPropertyChanged<T>(T callingEntity, string propertyName
54
56
/// <param name="propertyName">Changed property name</param>
55
57
/// <param name="getValue">Get property value</param>
56
58
/// <param name="setValue">Set property value</param>
57
- /// <typeparam name="T ">Calling entity type</typeparam>
59
+ /// <typeparam name="TEntity ">Calling entity type</typeparam>
58
60
/// <returns></returns>
59
- protected virtual void SetContent < T > ( T callingEntity , string propertyName , ref string getValue ,
61
+ protected virtual void SetContent < TEntity > ( TEntity callingEntity , string propertyName , ref string getValue ,
60
62
ref string setValue )
63
+ where TEntity : class
61
64
{
62
65
if ( getValue == setValue ) return ;
63
66
@@ -74,10 +77,11 @@ protected virtual void SetContent<T>(T callingEntity, string propertyName, ref s
74
77
/// <param name="getValue">Get property value</param>
75
78
/// <param name="setValue">Set property value</param>
76
79
/// <param name="length">Property maximum allowed length.</param>
77
- /// <typeparam name="T ">Calling entity type</typeparam>
80
+ /// <typeparam name="TEntity ">Calling entity type</typeparam>
78
81
/// <returns></returns>
79
- protected virtual void SetContent < T > ( T callingEntity , string propertyName , ref string getValue ,
82
+ protected virtual void SetContent < TEntity > ( TEntity callingEntity , string propertyName , ref string getValue ,
80
83
ref string setValue , int length )
84
+ where TEntity : class
81
85
{
82
86
if ( getValue == setValue ) return ;
83
87
0 commit comments