void UpdatePreview() { XshdSyntaxDefinition xshd = (XshdSyntaxDefinition)languageComboBox.SelectedItem; if (xshd != null) { var customizationsForCurrentLanguage = customizationList.Where(c => c.Language == null || c.Language == xshd.Name); CustomizingHighlighter.ApplyCustomizationsToDefaultElements(textEditor, customizationsForCurrentLanguage); ApplyToRendering(textEditor, customizationsForCurrentLanguage); var item = (IHighlightingItem)listBox.SelectedItem; TextView textView = textEditor.TextArea.TextView; foldingManager.Clear(); textMarkerService.RemoveAll(m => true); textView.LineTransformers.Remove(colorizer); colorizer = null; if (item != null) { if (item.ParentDefinition != null) { var highlighter = new CustomizingHighlighter( new DocumentHighlighter(textView.Document, item.ParentDefinition), customizationsForCurrentLanguage ); colorizer = new HighlightingColorizer(highlighter); textView.LineTransformers.Add(colorizer); } textEditor.Select(0, 0); bracketHighlighter.SetHighlight(null); textEditor.Options.HighlightCurrentLine = false; item.ShowExample(textEditor.TextArea); ITextMarker m = textMarkerService.TextMarkers.SingleOrDefault(); if (m != null && m.Tag != null) { ((Action <IHighlightingItem, ITextMarker>)m.Tag)(item, m); } } } }
void UpdatePreview() { XshdSyntaxDefinition xshd = (XshdSyntaxDefinition)languageComboBox.SelectedItem; if (xshd != null) { var customizationsForCurrentLanguage = customizationList.Where(c => c.Language == null || c.Language == xshd.Name); CustomizingHighlighter.ApplyCustomizationsToDefaultElements(textEditor, customizationsForCurrentLanguage); ApplyToRendering(textEditor, customizationsForCurrentLanguage); var item = (IHighlightingItem)listBox.SelectedItem; TextView textView = textEditor.TextArea.TextView; foldingManager.Clear(); textMarkerService.RemoveAll(m => true); textView.LineTransformers.Remove(colorizer); colorizer = null; if (item != null) { if (item.ParentDefinition != null) { var highlighter = new CustomizingHighlighter( new DocumentHighlighter(textView.Document, item.ParentDefinition), customizationsForCurrentLanguage ); colorizer = new HighlightingColorizer(highlighter); textView.LineTransformers.Add(colorizer); } textEditor.Select(0, 0); bracketHighlighter.SetHighlight(null); item.ShowExample(textEditor.TextArea); ITextMarker m = textMarkerService.TextMarkers.SingleOrDefault(); if (m != null && m.Tag != null) { ((Action<IHighlightingItem, ITextMarker>)m.Tag)(item, m); } } } }