Exemplo n.º 1
0
        /// <summary>
        /// Sets the image of specified itemBinder
        /// </summary>
        /// <param name="itemBinder"></param>
        public void SetImage(ItemBinder itemBinder)
        {
            Text            = "";
            BackgroundImage = null;

            Bitmap image = itemBinder.GetImage(IconData.ICON_WIDTH, IconData.ICON_HEIGHT);

            if (image != null)
            {
                BackgroundImage = image;
            }
            else
            {
                Text      = string.Format("({0})", itemBinder.itemData.name);
                TextAlign = ContentAlignment.MiddleCenter;
            }
        }
        protected void SetImage()
        {
            imageLabel.Anchor          = AnchorStyles.None;
            imageLabel.Text            = "";
            imageLabel.BackgroundImage = null;

            Bitmap image = itemBinder.GetImage(IconData.ICON_WIDTH, IconData.ICON_HEIGHT);

            if (image != null)
            {
                imageLabel.BackgroundImage = image;
            }
            else
            {
                imageLabel.Text      = string.Format("({0})", itemBinder.itemData.name);
                imageLabel.TextAlign = ContentAlignment.MiddleCenter;
            }
        }