private void Cleanup() { if (this.wpfTextViewHost != null) { this.wpfTextViewHost.Closed -= OnTextViewHostClosed; this.wpfTextViewHost = null; } if (this.textView != null) { this.textView.BufferGraph.GraphBuffersChanged -= OnGraphBuffersChanged; this.textView.BufferGraph.GraphBufferContentTypeChanged -= OnGraphBufferContentTypeChanged; this.textView.Caret.PositionChanged -= OnCaretPositionChanged; this.textView.TextViewModel.EditBuffer.PostChanged -= OnBufferPostChanged; this.textView = null; } if (this.visual != null) { this.visual.ViewBuffer -= OnViewBuffer; this.visual = null; } if (this.settings != null) { this.settings.SettingsChanged -= OnSettingsChanged; this.settings = null; } this.extensionRegistry = null; }
public DevViewMargin(IWpfTextViewHost wpfTextViewHost, IFileExtensionRegistryService fers) { model = new DevMarginViewModel(); this.wpfTextViewHost = wpfTextViewHost; this.extensionRegistry = fers; this.visual = new DevMarginVisual(model); this.visual.ViewBuffer += OnViewBuffer; VsfSettings.SettingsUpdated += OnSettingsUpdated; this.wpfTextViewHost.Closed += OnTextViewHostClosed; UpdateVisibility(); InitializeTextView(); RefreshBufferGraphList(); this.model.RefreshView(wpfTextViewHost.TextView); }
public DevViewMargin(IWpfTextViewHost wpfTextViewHost, IFileExtensionRegistryService fers, IVsfSettings settings) { model = new DevMarginViewModel(); this.wpfTextViewHost = wpfTextViewHost; this.extensionRegistry = fers; this.settings = settings; this.settings.SettingsChanged += OnSettingsChanged; this.wpfTextViewHost.Closed += OnTextViewHostClosed; this.visual = new DevMarginVisual(model, settings); this.visual.ViewBuffer += OnViewBuffer; UpdateVisibility(); InitializeTextView(); RefreshBufferGraphList(); this.model.RefreshView(wpfTextViewHost.TextView); }
private void Cleanup() { if ( this.wpfTextViewHost != null ) { this.wpfTextViewHost.Closed -= OnTextViewHostClosed; this.wpfTextViewHost = null; } if ( this.textView != null ) { this.textView.BufferGraph.GraphBuffersChanged -= OnGraphBuffersChanged; this.textView.BufferGraph.GraphBufferContentTypeChanged -= OnGraphBufferContentTypeChanged; this.textView.Caret.PositionChanged -= OnCaretPositionChanged; this.textView.TextViewModel.EditBuffer.PostChanged -= OnBufferPostChanged; this.textView = null; } if ( this.visual != null ) { this.visual.ViewBuffer -= OnViewBuffer; this.visual = null; } if ( this.settings != null ) { this.settings.SettingsChanged -= OnSettingsChanged; this.settings = null; } this.extensionRegistry = null; }