Exemplo n.º 1
0
        private void UpdateImageLists()
        {
            ImageList imgList = new ImageList();

            imgList.ImageSize  = new Size(16, 16);
            imgList.ColorDepth = ColorDepth.Depth32Bit;

            List <Image> lStdImages = new List <Image>();

            foreach (Image imgStd in ext.pluginHost.MainWindow.ClientIcons.Images)
            {
                lStdImages.Add(imgStd);
            }
            imgList.Images.AddRange(lStdImages.ToArray());

            Debug.Assert(imgList.Images.Count >= (int)PwIcon.Count);

            List <Image> lCustom = UIUtil.BuildImageListEx(
                mActiveDb.CustomIcons, 16, 16);

            if ((lCustom != null) && (lCustom.Count > 0))
            {
                imgList.Images.AddRange(lCustom.ToArray());
            }

            if (UIUtil.VistaStyleListsSupported)
            {
                mCustomTreeViewEx.ImageList = imgList;
            }
            else
            {
                List <Image> vAllImages = new List <Image>();
                foreach (Image imgClient in imgList.Images)
                {
                    vAllImages.Add(imgClient);
                }
                vAllImages.AddRange(lCustom);
                Debug.Assert(imgList.Images.Count == vAllImages.Count);

                ImageList imgSafe = UIUtil.ConvertImageList24(vAllImages, 16, 16,
                                                              AppDefs.ColorControlNormal);
                mCustomTreeViewEx.ImageList = imgSafe;
            }
        }