Example #1
0
        void CreateExplicitTextProperties(ClassificationInfo info)
        {
            var props = info.Lazy.Value.CreateThemeResourceDictionary(themeService.Theme);

            info.ExplicitResourceDictionary = props;
            info.ExplicitTextProperties     = ClassificationFontUtils.Create(info.ExplicitResourceDictionary);
        }
Example #2
0
        void CreateInheritedTextProperties(ClassificationInfo info)
        {
            var list = new List <IClassificationType>();

            AddBaseTypes(list, info.ClassificationType);
            info.InheritedResourceDictionary = CreateInheritedResourceDictionary(defaultResourceDictionary, list);
            info.InheritedTextProperties     = ClassificationFontUtils.Create(info.InheritedResourceDictionary);
        }
Example #3
0
        public ResourceDictionary CreateResourceDictionary(ITheme theme)
        {
            if (resourceDictionary == null)
            {
                resourceDictionary = textEditorFormatDefinition.Value.CreateResourceDictionary(theme);
                if (baseType != null)
                {
                    ClassificationFontUtils.Merge(baseType.CreateResourceDictionary(theme), resourceDictionary);
                }
            }

            var bg = GetWindowBackground(theme);

            Debug.Assert(bg != null);
            resourceDictionary[EditorFormatMapConstants.TextViewBackgroundId] = bg;

            return(resourceDictionary);
        }
 ResourceDictionary CreatePlainTextDictionary(ResourceDictionary textProps) =>
 ClassificationFontUtils.CreateResourceDictionary(textProps, plainTextPropertiesToCopy);
Example #5
0
 void ReinitializeCache()
 {
     toClassificationInfo.Clear();
     ClassificationFontUtils.CopyTo(defaultResourceDictionary, editorFormatMap.GetProperties(EditorFormatMapConstants.PlainText));
     defaultTextFormattingRunProperties = ClassificationFontUtils.Create(defaultResourceDictionary);
 }