void Reinitialize() { mouseProcessorCollection?.Dispose(); var list = new List <IMouseProcessor>(); foreach (var provider in mouseProcessorProviders) { if (!wpfTextView.Roles.ContainsAny(provider.Metadata.TextViewRoles)) { continue; } if (!wpfTextView.TextDataModel.ContentType.IsOfAnyType(provider.Metadata.ContentTypes)) { continue; } var mouseProcessor = provider.Value.GetAssociatedProcessor(wpfTextView); if (!(mouseProcessor is null)) { list.Add(mouseProcessor); } } UIElement?manipulationElem = null; //TODO: mouseProcessorCollection = new MouseProcessorCollection(wpfTextView.VisualElement, manipulationElem, new DefaultTextViewMouseProcessor(wpfTextView, editorOperationsFactoryService), list.ToArray(), allowEventDelegate); }
public void Dispose() { wpfTextViewHost.TextView.Options.OptionChanged -= Options_OptionChanged; wpfTextViewHost.TextView.ZoomLevelChanged -= TextView_ZoomLevelChanged; IsVisibleChanged -= GlyphMargin_IsVisibleChanged; UnregisterEvents(); lineInfos?.Clear(); iconCanvas?.Children.Clear(); mouseProcessorCollection?.Dispose(); tagAggregator?.Dispose(); }
void WpfTextView_Closed(object sender, EventArgs e) { wpfTextView.Closed -= WpfTextView_Closed; wpfTextView.TextDataModel.ContentTypeChanged -= TextDataModel_ContentTypeChanged; mouseProcessorCollection.Dispose(); }