diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-07 15:34:42 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-07 15:34:42 +0200 |
| commit | 4cf1e800a5743d1194281703a4bcd6df0a910e8f (patch) | |
| tree | ea790b84cf9021c5d1d3cb74018107ee86bd457a /Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/TextEditorWeakEventManager.cs | |
| parent | b18d75447928658826f05a7f1ab0279ac7cb671a (diff) | |
| download | Tango-4cf1e800a5743d1194281703a4bcd6df0a910e8f.tar.gz Tango-4cf1e800a5743d1194281703a4bcd6df0a910e8f.zip | |
Added Avalon editor as SideChain.
Implemented scripting control in SharedUI..
Diffstat (limited to 'Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/TextEditorWeakEventManager.cs')
| -rw-r--r-- | Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/TextEditorWeakEventManager.cs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/TextEditorWeakEventManager.cs b/Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/TextEditorWeakEventManager.cs new file mode 100644 index 000000000..986762f92 --- /dev/null +++ b/Software/Visual_Studio/SideChains/ICSharpCode.AvalonEdit/TextEditorWeakEventManager.cs @@ -0,0 +1,52 @@ +// 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 ICSharpCode.AvalonEdit.Utils; +using System; + +namespace ICSharpCode.AvalonEdit +{ + /// <summary> + /// Contains weak event managers for <see cref="ITextEditorComponent"/>. + /// </summary> + public static class TextEditorWeakEventManager + { + /// <summary> + /// Weak event manager for the <see cref="ITextEditorComponent.DocumentChanged"/> event. + /// </summary> + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public sealed class DocumentChanged : WeakEventManagerBase<DocumentChanged, ITextEditorComponent> + { + /// <inheritdoc/> + protected override void StartListening(ITextEditorComponent source) + { + source.DocumentChanged += DeliverEvent; + } + + /// <inheritdoc/> + protected override void StopListening(ITextEditorComponent source) + { + source.DocumentChanged -= DeliverEvent; + } + } + + /// <summary> + /// Weak event manager for the <see cref="ITextEditorComponent.OptionChanged"/> event. + /// </summary> + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] + public sealed class OptionChanged : WeakEventManagerBase<OptionChanged, ITextEditorComponent> + { + /// <inheritdoc/> + protected override void StartListening(ITextEditorComponent source) + { + source.OptionChanged += DeliverEvent; + } + + /// <inheritdoc/> + protected override void StopListening(ITextEditorComponent source) + { + source.OptionChanged -= DeliverEvent; + } + } + } +} |
