コード例 #1
0
 public void loadLookAndFeelIntoICB()
 {
     imgStyle = new ImageCollection();
     icbStyle.Properties.SmallImages = imgStyle;
     for (int i = 0; i < SkinManager.Default.Skins.Count; i++)
     {
         string skinName = SkinManager.Default.Skins[i].SkinName;
         imgStyle.AddImage(SkinCollectionHelper.GetSkinIcon(skinName, SkinIconsSize.Small), skinName);
         icbStyle.Properties.Items.Add(new ImageComboBoxItem(skinName, i));
         if (skinName == Properties.Settings.Default.Theme)
         {
             icbStyle.SelectedIndex = i;
         }
     }
     dlafStyle.LookAndFeel.SetSkinStyle(Properties.Settings.Default.Theme);
 }
コード例 #2
0
        private void ListSkins()
        {
            int idx = 0;
            ImageComboBoxItem selectedItem = null;

            ImageList imlSkinIcons = new ImageList();

            imlSkinIcons.ImageSize         = new System.Drawing.Size(16, 16);
            imlSkinIcons.ColorDepth        = ColorDepth.Depth32Bit;
            cboSkin.Properties.SmallImages = imlSkinIcons;

            SkinContainerCollection skins = SkinManager.Default.Skins;

            for (int i = 0; i < skins.Count; i++)
            {
                string skName = skins[i].SkinName;

                System.Drawing.Image img = SkinCollectionHelper.GetSkinIcon(skName, SkinIconsSize.Small);
                imlSkinIcons.Images.Add(img);

                ImageComboBoxItem item = new ImageComboBoxItem();
                item.Value       = skins[i];
                item.Description = skName;
                item.ImageIndex  = idx;

                if (skName.Equals(StudioContext.SkinName))
                {
                    selectedItem = item;
                }

                cboSkin.Properties.Items.Add(item);

                idx++;
            }

            // Set current style in combo
            if (selectedItem != null)
            {
                cboSkin.SelectedItem = selectedItem;
            }
        }
コード例 #3
0
        private void ListSkins()
        {
            ImageComboBoxItem item;

            SkinContainerCollection skins = SkinManager.Default.Skins;

            foreach (SkinContainer skin in skins)
            {
                imlIcons.Images.Add(SkinCollectionHelper.GetSkinIcon(skin.SkinName, SkinIconsSize.Small));

                item             = new ImageComboBoxItem();
                item.Description = skin.SkinName;
                item.Value       = skin;
                item.ImageIndex  = imlIcons.Images.Count - 1;

                cboSkin.Properties.Items.Add(item);

                if (UserLookAndFeel.DefaultSkinName.Equals(skin.SkinName))
                {
                    cboSkin.SelectedItem = item;
                }
            }
        }