9using System.ComponentModel;
21 INotifyPropertyChanged,
22 INotifyPropertyChanging
31 private PropertyChangedEventHandler _nonSerializableChangedHandlers;
32 private PropertyChangedEventHandler _serializableChangedHandlers;
37 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Design",
38 "CA1062:ValidateArgumentsOfPublicMethods")]
44 _serializableChangedHandlers = (PropertyChangedEventHandler)
45 System.Delegate.Combine(_serializableChangedHandlers, value);
47 _nonSerializableChangedHandlers = (PropertyChangedEventHandler)
48 System.Delegate.Combine(_nonSerializableChangedHandlers, value);
53 _serializableChangedHandlers = (PropertyChangedEventHandler)
54 System.Delegate.Remove(_serializableChangedHandlers, value);
56 _nonSerializableChangedHandlers = (PropertyChangedEventHandler)
57 System.Delegate.Remove(_nonSerializableChangedHandlers, value);
69 return value.Method.IsPublic &&
70 value.Method.DeclaringType !=
null &&
71 (value.Method.DeclaringType.IsSerializable || value.Method.IsStatic);
84 [EditorBrowsable(EditorBrowsableState.Advanced)]
87 if (_nonSerializableChangedHandlers !=
null)
88 _nonSerializableChangedHandlers.Invoke(
this,
89 new PropertyChangedEventArgs(propertyName));
90 if (_serializableChangedHandlers !=
null)
91 _serializableChangedHandlers.Invoke(
this,
92 new PropertyChangedEventArgs(propertyName));
105 [EditorBrowsable(EditorBrowsableState.Advanced)]
108 if (_nonSerializableChangedHandlers !=
null)
109 _nonSerializableChangedHandlers.Invoke(
this,
111 if (_serializableChangedHandlers !=
null)
112 _serializableChangedHandlers.Invoke(
this,
126 [EditorBrowsable(EditorBrowsableState.Advanced)]
140 [EditorBrowsable(EditorBrowsableState.Advanced)]
155 [EditorBrowsable(EditorBrowsableState.Advanced)]
162 private PropertyChangingEventHandler _nonSerializableChangingHandlers;
163 private PropertyChangingEventHandler _serializableChangingHandlers;
168 [System.Diagnostics.CodeAnalysis.SuppressMessage(
"Microsoft.Design",
169 "CA1062:ValidateArgumentsOfPublicMethods")]
175 _serializableChangingHandlers = (PropertyChangingEventHandler)
176 System.Delegate.Combine(_serializableChangingHandlers, value);
178 _nonSerializableChangingHandlers = (PropertyChangingEventHandler)
179 System.Delegate.Combine(_nonSerializableChangingHandlers, value);
184 _serializableChangingHandlers = (PropertyChangingEventHandler)
185 System.Delegate.Remove(_serializableChangingHandlers, value);
187 _nonSerializableChangingHandlers = (PropertyChangingEventHandler)
188 System.Delegate.Remove(_nonSerializableChangingHandlers, value);
200 [EditorBrowsable(EditorBrowsableState.Advanced)]
215 [EditorBrowsable(EditorBrowsableState.Advanced)]
231 [EditorBrowsable(EditorBrowsableState.Advanced)]
234 if (_nonSerializableChangingHandlers !=
null)
235 _nonSerializableChangingHandlers.Invoke(
this,
236 new PropertyChangingEventArgs(propertyName));
237 if (_serializableChangingHandlers !=
null)
238 _serializableChangingHandlers.Invoke(
this,
239 new PropertyChangingEventArgs(propertyName));
252 [EditorBrowsable(EditorBrowsableState.Advanced)]
266 return value.Method.IsPublic &&
267 value.Method.DeclaringType !=
null &&
268 (value.Method.DeclaringType.IsSerializable || value.Method.IsStatic);
This class implements INotifyPropertyChanged and INotifyPropertyChanging in a serialization-safe mann...
virtual void OnIsDirtyChanging()
Call this method to raise the PropertyChanging event for all object properties.
virtual void OnPropertyChanged(string propertyName)
Call this method to raise the PropertyChanged event for a specific property.
virtual bool ShouldHandlerSerialize(PropertyChangingEventHandler value)
Override this method to change the default logic for determining if the event handler should be seria...
PropertyChangedEventHandler PropertyChanged
Implements a serialization-safe PropertyChanged event.
virtual void OnPropertyChanged(IPropertyInfo propertyInfo)
Call this method to raise the PropertyChanged event for a specific property.
virtual void OnMetaPropertyChanged(string propertyName)
PropertyChangingEventHandler PropertyChanging
Implements a serialization-safe PropertyChanging event.
BindableBase()
Creates an instance of the object.
virtual void OnUnknownPropertyChanged()
Call this method to raise the PropertyChanged event for all object properties.
virtual void OnPropertyChanging(IPropertyInfo propertyInfo)
Call this method to raise the PropertyChanging event for a specific property.
virtual bool ShouldHandlerSerialize(PropertyChangedEventHandler value)
Override this method to change the default logic for determining if the event handler should be seria...
virtual void OnPropertyChanging(string propertyName)
Call this method to raise the PropertyChanging event for a specific property.
virtual void OnIsDirtyChanged()
Call this method to raise the PropertyChanged event for all object properties.
virtual void OnUnknownPropertyChanging()
Call this method to raise the PropertyChanging event for all object properties.
Inherit from this base class to easily create a serializable class.
string Name
Gets the member name value.
Maintains metadata about a property.
@ Serializable
Prevents updating or inserting until the transaction is complete.