Esempio n. 1
0
        private static ImageSource GetImage(DependencyObject owner, string file, __VSUIDATAFORMAT format, out bool themeIcon)
        {
            IVsImageService imageService = ServiceProvider.GlobalProvider.GetService(typeof(SVsImageService)) as IVsImageService;
            BitmapSource    result       = null;
            uint            iconSource   = (uint)__VSIconSource.IS_Unknown;

            if (imageService != null && !string.IsNullOrWhiteSpace(file))
            {
                IVsUIObject image = imageService.GetIconForFileEx(file, format, out iconSource);
                if (image != null)
                {
                    object imageData = GetObjectData(image);
                    result = imageData as BitmapSource;
                }
            }

            themeIcon = (iconSource == (uint)__VSIconSource.IS_VisualStudio);

            if (themeIcon && result != null && owner != null)
            {
                return(ThemeImage(owner, result));
            }

            return(result);
        }
Esempio n. 2
0
        private static ImageSource GetImage(DependencyObject owner, string file, __VSUIDATAFORMAT format, out bool themeIcon)
        {
            IVsImageService imageService = ServiceProvider.GlobalProvider.GetService(typeof(SVsImageService)) as IVsImageService;
            BitmapSource result = null;
            uint iconSource = (uint)__VSIconSource.IS_Unknown;

            if (imageService != null && !string.IsNullOrWhiteSpace(file))
            {
                IVsUIObject image = imageService.GetIconForFileEx(file, format, out iconSource);
                if (image != null)
                {
                    object imageData = GetObjectData(image);
                    result = imageData as BitmapSource;
                }
            }

            themeIcon = (iconSource == (uint)__VSIconSource.IS_VisualStudio);

            if (themeIcon && result != null && owner != null)
            {
                return ThemeImage(owner, result);
            }

            return result;
        }
 public Property(VsUIPropertyDescriptor desc, __VSUIDATAFORMAT format, object value)
 {
     this.Name   = desc.name;
     this.Type   = desc.type;
     this.Format = format;
     this.Value  = value;
 }
Esempio n. 4
0
 public VsUIObject(object value, string type, __VSUIDATAFORMAT format)
 {
     _data   = value;
     _type   = type;
     _format = (uint)format;
 }
Esempio n. 5
0
 public VsUIObject(object value, string type, __VSUIDATAFORMAT format) {
     _data = value;
     _type = type;
     _format = (uint)format;
 }