void Config_Updated(object sender, ConfigUpdatedEventArgs e) { if (e.UpdatedFeature.HasAnyFlag(Features.SyntaxHighlight | Features.ScrollbarMarkers) == false) { return; } var setVisible = Config.Instance.MarkerOptions.HasAnyFlag(MarkerOptions.CodeMarginMask); var visible = Visibility == Visibility.Visible; if (setVisible == false && visible) { Visibility = Visibility.Collapsed; _TextView.TextBuffer.Changed -= TextView_TextBufferChanged; _ScrollBar.TrackSpanChanged -= OnMappingChanged; } else if (setVisible && visible == false) { Visibility = Visibility.Visible; _TextView.TextBuffer.Changed += TextView_TextBufferChanged; _ScrollBar.TrackSpanChanged += OnMappingChanged; } if (Visibility == Visibility.Visible) { InvalidateVisual(); } }
void SettingsSaved(object sender, ConfigUpdatedEventArgs eventArgs) { if (eventArgs.UpdatedFeature.MatchFlags(Features.SyntaxHighlight)) { FormatUpdated(sender, eventArgs); } }
void Config_Updated(object sender, ConfigUpdatedEventArgs e) { if (e.UpdatedFeature.HasAnyFlag(Features.SyntaxHighlight | Features.ScrollbarMarkers) == false) { return; } var setVisible = Config.Instance.MarkerOptions.HasAnyFlag(MarkerOptions.MemberMarginMask); var visible = Visibility == Visibility.Visible; if (setVisible == false && visible) { Visibility = Visibility.Collapsed; _SymbolReferenceMarker.UnhookEvents(); } else if (setVisible && visible == false) { Visibility = Visibility.Visible; if (Config.Instance.MarkerOptions.MatchFlags(MarkerOptions.SymbolReference)) { _SymbolReferenceMarker.HookEvents(); } } if (Visibility == Visibility.Visible) { if (e.UpdatedFeature.MatchFlags(Features.SyntaxHighlight)) { UpdateSyntaxColors(); } InvalidateVisual(); } }
private void ApplicationConfigUpdated(object sender, ConfigUpdatedEventArgs e) { _currentConfig = Application.Config; _currentConfigXml = Application.Config.ToXml(); SaveWorkingConfig(); Logger.LogInfo(Message.ConfigSubsystemConfigUpdated, e.UpdatedParameterName, e.SubsystemName, e.OldValue, e.NewValue); }
void SettingsUpdated(object sender, ConfigUpdatedEventArgs eventArgs) { if (eventArgs.UpdatedFeature.MatchFlags(Features.SyntaxHighlight)) { var t = eventArgs.Parameter as string; if (t != null) { Decorate(new[] { ServicesHelper.Instance.ClassificationTypeRegistry.GetClassificationType(t) }, true); } else { Decorate(_ClassificationFormatMap.CurrentPriorityOrder, false); } } }
void ConfigUpdated(object sender, ConfigUpdatedEventArgs e) { if (e.UpdatedFeature.MatchFlags(Features.SmartBar)) { View.VisualElement.PreviewKeyUp -= ViewKeyUp; if (Config.Instance.SmartBarOptions.MatchFlags(SmartBarOptions.ShiftToggleDisplay)) { View.VisualElement.PreviewKeyUp += ViewKeyUp; } View.Selection.SelectionChanged -= ViewSelectionChanged; if (Config.Instance.SmartBarOptions.MatchFlags(SmartBarOptions.ManualDisplaySmartBar) == false) { View.Selection.SelectionChanged += ViewSelectionChanged; } } }
void Config_Updated(object sender, ConfigUpdatedEventArgs e) { if (e.UpdatedFeature.MatchFlags(Features.ScrollbarMarkers) == false) { return; } var setVisible = Config.Instance.MarkerOptions.MatchFlags(MarkerOptions.LineNumber); var visible = Visibility == Visibility.Visible; if (setVisible == false && visible) { Visibility = Visibility.Collapsed; _TextView.TextBuffer.Changed -= TextView_TextBufferChanged; _ScrollBar.TrackSpanChanged -= OnMappingChanged; InvalidateVisual(); } else if (setVisible && visible == false) { Visibility = Visibility.Visible; Setup(); InvalidateVisual(); } }
static void Update(object sender, ConfigUpdatedEventArgs e) { if (e.UpdatedFeature.MatchFlags(Features.SyntaxHighlight) == false) { return; } var o = (sender as Config).SpecialHighlightOptions; AllBraces = o.HasAnyFlag(SpecialHighlightOptions.AllBraces); AllParentheses = o.HasAnyFlag(SpecialHighlightOptions.AllParentheses); var sp = o.MatchFlags(SpecialHighlightOptions.SpecialPunctuation); if (sp) { KeywordBraceTags = TransientKeywordTagHolder.BoldBraces.Clone(); MemberBraceTags = TransientMemberTagHolder.BoldBraces.Clone(); MemberDeclarationBraceTags = TransientMemberTagHolder.BoldDeclarationBraces.Clone(); } else { KeywordBraceTags = TransientKeywordTagHolder.Default.Clone(); MemberBraceTags = TransientMemberTagHolder.Default.Clone(); MemberDeclarationBraceTags = TransientMemberTagHolder.DeclarationBraces.Clone(); } if (o.MatchFlags(SpecialHighlightOptions.BranchBrace) == false) { KeywordBraceTags.Branching = sp ? ClassificationTagHelper.BoldBraceTag : null; } if (o.MatchFlags(SpecialHighlightOptions.CastBrace) == false) { KeywordBraceTags.TypeCast = sp ? ClassificationTagHelper.BoldBraceTag : null; } if (o.MatchFlags(SpecialHighlightOptions.LoopBrace) == false) { KeywordBraceTags.Loop = sp ? ClassificationTagHelper.BoldBraceTag : null; } if (o.MatchFlags(SpecialHighlightOptions.ResourceBrace) == false) { KeywordBraceTags.Resource = sp ? ClassificationTagHelper.BoldBraceTag : null; } if (o.MatchFlags(SpecialHighlightOptions.ParameterBrace) == false) { MemberBraceTags.Constructor = sp ? ClassificationTagHelper.BoldBraceTag : null; MemberBraceTags.Method = sp ? ClassificationTagHelper.BoldBraceTag : null; } if (o.MatchFlags(SpecialHighlightOptions.DeclarationBrace) == false) { MemberDeclarationBraceTags.Class = MemberDeclarationBraceTags.Constructor = MemberDeclarationBraceTags.Delegate = MemberDeclarationBraceTags.Enum = MemberDeclarationBraceTags.Event = MemberDeclarationBraceTags.Field = MemberDeclarationBraceTags.Interface = MemberDeclarationBraceTags.Method = MemberDeclarationBraceTags.Namespace = MemberDeclarationBraceTags.Property = MemberDeclarationBraceTags.Struct = sp ? ClassificationTagHelper.BoldDeclarationBraceTag : ClassificationTagHelper.DeclarationBraceTag; } LocalFunctionDeclaration = o.MatchFlags(SpecialHighlightOptions.LocalFunctionDeclaration); NonPrivateField = o.MatchFlags(SpecialHighlightOptions.NonPrivateField); }