Ejemplo n.º 1
0
 IImageSourceService Create(Lazy <IBackgroundImageOptionDefinition, IBackgroundImageOptionDefinitionMetadata> lazy)
 {
     if (!imageSourceServices.TryGetValue(lazy.Value, out var imageSourceService))
     {
         imageSourceServices.Add(lazy.Value, imageSourceService = new ImageSourceService(themeService, backgroundImageSettingsService.GetSettings(lazy)));
     }
     return(imageSourceService);
 }
Ejemplo n.º 2
0
        public IImageSourceService Create(IWpfTextView wpfTextView)
        {
            if (wpfTextView == null)
            {
                throw new ArgumentNullException(nameof(wpfTextView));
            }
            var lazy = backgroundImageOptionDefinitionService.GetOptionDefinition(wpfTextView);
            IImageSourceService imageSourceService;

            if (!imageSourceServices.TryGetValue(lazy.Value, out imageSourceService))
            {
                imageSourceServices.Add(lazy.Value, imageSourceService = new ImageSourceService(themeManager, backgroundImageSettingsService.GetSettings(lazy)));
            }
            return(imageSourceService);
        }