Exemple #1
0
        private void AddTileControl(PreviewTileView tile)
        {
            PreviewTileControl control = new PreviewTileControl(tile, base.ClientRectangle, 5);

            control.SuspendLayout();
            base.Controls.Add(control);
            control.ResumeLayout(false);
        }
Exemple #2
0
 private void UpdateTiles()
 {
     RectangleF[] tileLayout = this.Component.GetTileLayout();
     for (int i = 0; i < this.Component.TileCount; i++)
     {
         PreviewTileView item = new PreviewTileView(this.Component.GetTile(i))
         {
             NormalizedRectangle = tileLayout[i]
         };
         this._tileViews.Add(item);
     }
     if (this._tileViews.Count > 0)
     {
         this._tileViews[0].Selected = true;
     }
 }
        // Methods
        public PreviewTileControl(PreviewTileView tile, Rectangle parentRectangle, int parentImageBoxInsetWidth)
        {
            EventHandler handler = null;

            this._tile = tile;
            if (handler == null)
            {
                handler = delegate(object sender, EventArgs e)
                {
                    Bitmap iconImage = ((PreviewTile)sender).IconImage;
                    this.BackgroundImage = iconImage;
                    base.Invalidate();
                };
            }
            this._tile.ImageChanged += handler;
            this._tile.Actived      += new EventHandler(this.OnActived);
            this.InitializeComponent();
            this.SetParentImageBoxRectangle(parentRectangle, parentImageBoxInsetWidth);
        }