Esempio n. 1
0
        //[@XmlIgnoreAttribute]
        //public Dictionary<string, ModelIcon> IconsHashMap
        //{
        //    get { return iconsCache; }
        //    //set { icons = value; }
        //}

        public ModelIcon GetIcon(string name)
        {
            ModelIcon icon;

            if (!iconsCache.TryGetValue(name, out icon))
            {
                icon = iconsList.Find(a => a.Name == name);
                if (icon == null)
                {
                    System.Diagnostics.Trace.TraceError("Icon (" + name + ") not found. Warning icon shown instead. [" + DateTime.Now.ToString() + "]");
                    icon = new ModelIcon("messagebox_warning", "messagebox_warning", "");
                }
                iconsCache[name] = icon;
            }

            return(icon);
        }
Esempio n. 2
0
        private Button CreateIconButton(ModelIcon icon)
        {
            Button b = new Button();
            b.Name = icon.Name;
            b.FlatStyle = FlatStyle.Standard;
            b.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            b.Image = icon.Bitmap;
            b.Size = new Size(27, 27);
            toolTip1.SetToolTip(b, icon.Title + ", " + icon.Shortcut.ToString());
            b.Margin = new Padding(0);
            //b.Tag = icon.Shortcut;
            b.MouseHover += new EventHandler(b_MouseHover);
            b.Click += new EventHandler(b_Click);
            b.GotFocus += b_GotFocus;
            b.LostFocus += b_LostFocus;

            return b;
        }
Esempio n. 3
0
 public GalleryIconPropertySet(ModelIcon icon, RibbonLib.Ribbon ribbon)
 {
     this.icon = icon;
     this.itemImage = ribbon.ConvertToUIImage(icon.Bitmap);
 }