protected void RegisterImages()
        {
            if (!_imageRegistered && _serviceProvider != null)
            {
                _dispatcher.Invoke(() =>
                {
                    _imageRegistered = true;

                    //ImageSource imgDir = BitmapFrame.Create(new Uri("pack://application:,,,/WebEssentials2012;component/Resources/graph_atdir.png", UriKind.RelativeOrAbsolute));
                    //ImageSource imgId = BitmapFrame.Create(new Uri("pack://application:,,,/WebEssentials2012;component/Resources/graph_id.png", UriKind.RelativeOrAbsolute));
                    //ImageSource imgClass = BitmapFrame.Create(new Uri("pack://application:,,,/WebEssentials2012;component/Resources/graph_class.png", UriKind.RelativeOrAbsolute));
                    ImageSource imgParent = BitmapFrame.Create(new Uri("pack://application:,,,/WebEssentials2012;component/Resources/graph_parent.png", UriKind.RelativeOrAbsolute));
                    ImageSource imgChild  = BitmapFrame.Create(new Uri("pack://application:,,,/WebEssentials2012;component/Resources/graph_class.png", UriKind.RelativeOrAbsolute));

                    IVsImageService imageService = (IVsImageService)_serviceProvider.GetService(typeof(SVsImageService));
                    //imageService.Add(_imageDir, WpfPropertyValue.CreateIconObject(imgDir));
                    //imageService.Add(_imageId, WpfPropertyValue.CreateIconObject(imgId));
                    //imageService.Add(_imageClass, WpfPropertyValue.CreateIconObject(imgClass));
                    imageService.Add(Images.Parent, WpfPropertyValue.CreateIconObject(imgParent));
                    imageService.Add(Images.Child, WpfPropertyValue.CreateIconObject(imgChild));
                });
            }
        }
Esempio n. 2
0
 public LazyImage(Func <ImageSource> imageCreator)
 {
     instance = new Lazy <IVsUIObject>(() => WpfPropertyValue.CreateIconObject(imageCreator()));
 }