protected ClassificationFormatMapService(IThemeService themeService, IEditorFormatMapService editorFormatMapService, IEditorFormatDefinitionService editorFormatDefinitionService, IClassificationTypeRegistryService classificationTypeRegistryService) {
			this.themeService = themeService;
			this.editorFormatMapService = editorFormatMapService;
			this.editorFormatDefinitionService = editorFormatDefinitionService;
			this.classificationTypeRegistryService = classificationTypeRegistryService;
			toCategoryMap = new Dictionary<IEditorFormatMap, IClassificationFormatMap>();
		}
Пример #2
0
		protected EditorFormatMapService(IThemeService themeService, ITextAppearanceCategoryService textAppearanceCategoryService, IEditorFormatDefinitionService editorFormatDefinitionService) {
			this.themeService = themeService;
			this.textAppearanceCategoryService = textAppearanceCategoryService;
			this.editorFormatDefinitionService = editorFormatDefinitionService;
			toCategoryMap = new Dictionary<ITextAppearanceCategory, IEditorFormatMap>();
			cachedUpdaters = new List<CategoryEditorFormatMapUpdater>();
			dispatcher = Dispatcher.CurrentDispatcher;
		}
Пример #3
0
		public CategoryEditorFormatMap(Dispatcher dispatcher, IEditorFormatDefinitionService editorFormatDefinitionService) {
			if (dispatcher == null)
				throw new ArgumentNullException(nameof(dispatcher));
			if (editorFormatDefinitionService == null)
				throw new ArgumentNullException(nameof(editorFormatDefinitionService));
			this.dispatcher = dispatcher;
			this.editorFormatDefinitionService = editorFormatDefinitionService;
			batchChanges = new HashSet<string>(StringComparer.Ordinal);
			resourceDicts = new Dictionary<string, ResourceDictionary>(StringComparer.Ordinal);
		}
		public CategoryEditorFormatMapUpdater(IThemeService themeService, ITextAppearanceCategory textAppearanceCategory, IEditorFormatDefinitionService editorFormatDefinitionService, IEditorFormatMap editorFormatMap) {
			if (themeService == null)
				throw new ArgumentNullException(nameof(themeService));
			if (textAppearanceCategory == null)
				throw new ArgumentNullException(nameof(textAppearanceCategory));
			if (editorFormatDefinitionService == null)
				throw new ArgumentNullException(nameof(editorFormatDefinitionService));
			if (editorFormatMap == null)
				throw new ArgumentNullException(nameof(editorFormatMap));
			this.themeService = themeService;
			this.textAppearanceCategory = textAppearanceCategory;
			this.editorFormatDefinitionService = editorFormatDefinitionService;
			this.editorFormatMap = editorFormatMap;

			themeService.ThemeChangedHighPriority += ThemeService_ThemeChangedHighPriority;
			textAppearanceCategory.SettingsChanged += TextAppearanceCategory_SettingsChanged;
			InitializeAll();
		}
Пример #5
0
		public EditorFormatMapServiceImpl(IThemeService themeService, ITextAppearanceCategoryService textAppearanceCategoryService, IEditorFormatDefinitionService editorFormatDefinitionService)
			: base(themeService, textAppearanceCategoryService, editorFormatDefinitionService) {
		}
 protected ClassificationFormatMapService(IThemeService themeService, IEditorFormatMapService editorFormatMapService, IEditorFormatDefinitionService editorFormatDefinitionService, IClassificationTypeRegistryService classificationTypeRegistryService)
 {
     this.themeService                      = themeService;
     this.editorFormatMapService            = editorFormatMapService;
     this.editorFormatDefinitionService     = editorFormatDefinitionService;
     this.classificationTypeRegistryService = classificationTypeRegistryService;
     toCategoryMap = new Dictionary <IEditorFormatMap, IClassificationFormatMap>();
 }
        public CategoryClassificationFormatMap(IThemeService themeService, IEditorFormatMap editorFormatMap, IEditorFormatDefinitionService editorFormatDefinitionService, IClassificationTypeRegistryService classificationTypeRegistryService)
        {
            if (editorFormatDefinitionService == null)
            {
                throw new ArgumentNullException(nameof(editorFormatDefinitionService));
            }
            if (classificationTypeRegistryService == null)
            {
                throw new ArgumentNullException(nameof(classificationTypeRegistryService));
            }
            this.themeService                  = themeService ?? throw new ArgumentNullException(nameof(themeService));
            this.editorFormatMap               = editorFormatMap ?? throw new ArgumentNullException(nameof(editorFormatMap));
            toClassificationInfo               = new Dictionary <IClassificationType, ClassificationInfo>();
            toEditorFormatDefinition           = new Dictionary <IClassificationType, Lazy <EditorFormatDefinition, IClassificationFormatMetadata> >(editorFormatDefinitionService.ClassificationFormatDefinitions.Length);
            toClassificationTypeOrder          = new Dictionary <IClassificationType, int>();
            classificationToEditorFormatMapKey = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
            defaultResourceDictionary          = new ResourceDictionary();

            for (int i = 0; i < editorFormatDefinitionService.ClassificationFormatDefinitions.Length; i++)
            {
                var e = editorFormatDefinitionService.ClassificationFormatDefinitions[i];
                foreach (var ctString in e.Metadata.ClassificationTypeNames)
                {
                    var classificationType = classificationTypeRegistryService.GetClassificationType(ctString);
                    Debug.Assert(classificationType != null);
                    if (classificationType == null)
                    {
                        continue;
                    }
                    Debug.Assert(!toEditorFormatDefinition.ContainsKey(classificationType));
                    if (!toEditorFormatDefinition.ContainsKey(classificationType))
                    {
                        toClassificationTypeOrder.Add(classificationType, toClassificationTypeOrder.Count);
                        toEditorFormatDefinition.Add(classificationType, e);
                        classificationToEditorFormatMapKey.Add(classificationType.Classification, ((IEditorFormatMetadata)e.Metadata).Name);
                    }
                }
            }

            editorFormatMap.FormatMappingChanged += EditorFormatMap_FormatMappingChanged;

            ReinitializeCache();
        }
Пример #8
0
 public EditorFormatMapServiceImpl(IThemeService themeService, ITextAppearanceCategoryService textAppearanceCategoryService, IEditorFormatDefinitionService editorFormatDefinitionService)
     : base(themeService, textAppearanceCategoryService, editorFormatDefinitionService)
 {
 }
Пример #9
0
 protected EditorFormatMapService(IThemeService themeService, ITextAppearanceCategoryService textAppearanceCategoryService, IEditorFormatDefinitionService editorFormatDefinitionService)
 {
     this.themeService = themeService;
     this.textAppearanceCategoryService = textAppearanceCategoryService;
     this.editorFormatDefinitionService = editorFormatDefinitionService;
     toCategoryMap  = new Dictionary <ITextAppearanceCategory, IEditorFormatMap>();
     cachedUpdaters = new List <CategoryEditorFormatMapUpdater>();
     dispatcher     = Dispatcher.CurrentDispatcher;
 }
Пример #10
0
        public CategoryEditorFormatMapUpdater(IThemeManager themeManager, ITextEditorFontSettings textEditorFontSettings, IEditorFormatDefinitionService editorFormatDefinitionService, IEditorFormatMap editorFormatMap)
        {
            if (themeManager == null)
            {
                throw new ArgumentNullException(nameof(themeManager));
            }
            if (textEditorFontSettings == null)
            {
                throw new ArgumentNullException(nameof(textEditorFontSettings));
            }
            if (editorFormatDefinitionService == null)
            {
                throw new ArgumentNullException(nameof(editorFormatDefinitionService));
            }
            if (editorFormatMap == null)
            {
                throw new ArgumentNullException(nameof(editorFormatMap));
            }
            this.themeManager                  = themeManager;
            this.textEditorFontSettings        = textEditorFontSettings;
            this.editorFormatDefinitionService = editorFormatDefinitionService;
            this.editorFormatMap               = editorFormatMap;

            themeManager.ThemeChangedHighPriority  += ThemeManager_ThemeChangedHighPriority;
            textEditorFontSettings.SettingsChanged += TextEditorFontSettings_SettingsChanged;
            InitializeAll();
        }
Пример #11
0
 public EditorFormatMapService(IThemeService themeService, ITextEditorFontSettingsService textEditorFontSettingsService, IEditorFormatDefinitionService editorFormatDefinitionService)
 {
     this.themeService = themeService;
     this.textEditorFontSettingsService = textEditorFontSettingsService;
     this.editorFormatDefinitionService = editorFormatDefinitionService;
     this.toCategoryMap  = new Dictionary <ITextEditorFontSettings, IEditorFormatMap>();
     this.cachedUpdaters = new List <CategoryEditorFormatMapUpdater>();
     this.dispatcher     = Dispatcher.CurrentDispatcher;
 }
		ClassificationFormatMapServiceImpl(IThemeService themeService, IEditorFormatMapService editorFormatMapService, IEditorFormatDefinitionService editorFormatDefinitionService, IClassificationTypeRegistryService classificationTypeRegistryService)
			: base(themeService, editorFormatMapService, editorFormatDefinitionService, classificationTypeRegistryService) {
		}
 ClassificationFormatMapServiceImpl(IThemeService themeService, IEditorFormatMapService editorFormatMapService, IEditorFormatDefinitionService editorFormatDefinitionService, IClassificationTypeRegistryService classificationTypeRegistryService)
     : base(themeService, editorFormatMapService, editorFormatDefinitionService, classificationTypeRegistryService)
 {
 }
Пример #14
0
        public CategoryEditorFormatMapUpdater(IThemeService themeService, ITextAppearanceCategory textAppearanceCategory, IEditorFormatDefinitionService editorFormatDefinitionService, IEditorFormatMap editorFormatMap)
        {
            this.themeService                  = themeService ?? throw new ArgumentNullException(nameof(themeService));
            this.textAppearanceCategory        = textAppearanceCategory ?? throw new ArgumentNullException(nameof(textAppearanceCategory));
            this.editorFormatDefinitionService = editorFormatDefinitionService ?? throw new ArgumentNullException(nameof(editorFormatDefinitionService));
            this.editorFormatMap               = editorFormatMap ?? throw new ArgumentNullException(nameof(editorFormatMap));

            themeService.ThemeChangedHighPriority  += ThemeService_ThemeChangedHighPriority;
            textAppearanceCategory.SettingsChanged += TextAppearanceCategory_SettingsChanged;
            InitializeAll();
        }
Пример #15
0
 public EditorFormatMapService(IThemeManager themeManager, ITextEditorFontSettingsService textEditorFontSettingsService, IEditorFormatDefinitionService editorFormatDefinitionService)
 {
     this.themeManager = themeManager;
     this.textEditorFontSettingsService = textEditorFontSettingsService;
     this.editorFormatDefinitionService = editorFormatDefinitionService;
     this.toCategoryMap  = new Dictionary <ITextEditorFontSettings, IEditorFormatMap>();
     this.cachedUpdaters = new List <CategoryEditorFormatMapUpdater>();
 }