Exemple #1
0
        static void UpdateFormatCache(object sender, EventArgs args)
        {
            var defaultFormat = DefaultClassificationFormatMap.DefaultTextProperties;

            if (_DefaultFormatting == null)
            {
                _DefaultFormatting = defaultFormat;
            }
            else if (_DefaultFormatting.ForegroundBrushSame(defaultFormat.ForegroundBrush) == false)
            {
                Debug.WriteLine("DefaultFormatting Changed");
                // theme changed
                lock (_syncRoot) {
                    var formattings = new Dictionary <IClassificationType, TextFormattingRunProperties>(_BackupFormattings.Count);
                    LoadFormattings(formattings);
                    _BackupFormattings = formattings;
                    _DefaultFormatting = defaultFormat;
                }
            }
            lock (_syncRoot) {
                UpdateIdentifySymbolSource(_SyntaxStyleCache);
            }
        }