diff options
Diffstat (limited to 'Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Utils/PropertyChangedWeakEventManager.cs')
| -rw-r--r-- | Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Utils/PropertyChangedWeakEventManager.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Utils/PropertyChangedWeakEventManager.cs b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Utils/PropertyChangedWeakEventManager.cs new file mode 100644 index 000000000..9b70c8f54 --- /dev/null +++ b/Software/Visual_Studio/Scripting/Tango.Scripting.Editors/Utils/PropertyChangedWeakEventManager.cs @@ -0,0 +1,26 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) + +using System; +using System.ComponentModel; + +namespace Tango.Scripting.Editors.Utils +{ + /// <summary> + /// WeakEventManager for INotifyPropertyChanged.PropertyChanged. + /// </summary> + public sealed class PropertyChangedWeakEventManager : WeakEventManagerBase<PropertyChangedWeakEventManager, INotifyPropertyChanged> + { + /// <inheritdoc/> + protected override void StartListening(INotifyPropertyChanged source) + { + source.PropertyChanged += DeliverEvent; + } + + /// <inheritdoc/> + protected override void StopListening(INotifyPropertyChanged source) + { + source.PropertyChanged -= DeliverEvent; + } + } +} |
