/// <summary> /// Creates image list and image monikers for project icons. /// Must be called on UI thread. /// </summary> public static void LoadProjectImages() { if (_monikerImageList == null) { IVsImageService2 imageService = VisualRustPackage.GetGlobalService(typeof(SVsImageService)) as IVsImageService2; if (_imageList == null) { _imageList = new ImageList(); } _imageList.Images.Add(Resources.RustProjectNode); _imageList.Images.Add(Resources.RustFileNode); _imageList.Images.Add(Resources.CargoManifestNode); _monikerImageList = imageService.CreateMonikerImageListFromHIMAGELIST(_imageList.Handle); imageService.AddCustomImageList(_monikerImageList); ImageMoniker[] monikers = new ImageMoniker[3]; _monikerImageList.GetImageMonikers(0, 3, monikers); ProjectNodeImage = monikers[0]; RustFileNodeImage = monikers[1]; CargoManifestNodeImage = monikers[2]; } }
/// <summary> /// Creates image list and image monikers for project icons. /// Must be called on UI thread. /// </summary> public static void LoadProjectImages() { if (_monikerImageList == null) { IVsImageService2 imageService = VsAppShell.Current.GetGlobalService <IVsImageService2>(typeof(SVsImageService)); _imageList = new ImageList(); foreach (var b in _bitmaps) { _imageList.Images.Add(b); } _monikerImageList = imageService.CreateMonikerImageListFromHIMAGELIST(_imageList.Handle); imageService.AddCustomImageList(_monikerImageList); ImageMoniker[] monikers = new ImageMoniker[_bitmaps.Length]; _monikerImageList.GetImageMonikers(0, _bitmaps.Length, monikers); ProjectNodeImage = monikers[0]; RFileNodeImage = monikers[1]; RDataFileNodeImage = monikers[2]; RdFileNodeImage = monikers[3]; RMarkdownFileNodeImage = monikers[4]; SqlFileNodeImage = monikers[5]; SqlProcFileNodeImage = monikers[6]; } }
/// <summary> /// Creates image list and image monikers for project icons. /// Must be called on UI thread. /// </summary> public static void LoadProjectImages() { if (_monikerImageList == null) { IVsImageService2 imageService = VsAppShell.Current.GetGlobalService <IVsImageService2>(typeof(SVsImageService)); if (_imageList == null) { _imageList = new ImageList(); } _imageList.Images.Add(Resources.RProjectNode); _imageList.Images.Add(Resources.RFileNode); _imageList.Images.Add(Resources.RDataNode); _monikerImageList = imageService.CreateMonikerImageListFromHIMAGELIST(_imageList.Handle); imageService.AddCustomImageList(_monikerImageList); ImageMoniker[] monikers = new ImageMoniker[3]; _monikerImageList.GetImageMonikers(0, 3, monikers); ProjectNodeImage = monikers[0]; RFileNodeImage = monikers[1]; RDataFileNodeImage = monikers[2]; } }