void thumbnailSelector_SelectionChanged(object sender, EventArgs e) { Controls.Thumbnail selected = thumbnailSelector.Selected; if (selected != null) { _selection = new Bootstrap.BrushPalette(selected.UserData); } else { _selection = null; } }
//----------------------- void thumbnailSelector_ThumbnailClick(object sender, MouseEventArgs e) { // if the user right-clicked on a brush thumbnail, // pop up the brush editor beneath it. if (e.Button == MouseButtons.Right) { Controls.Thumbnail thumbnail = (sender as Controls.Thumbnail); string brushName = thumbnail.UserData; brushEditor.Brush = new Bootstrap.Brush(brushName); popupEditBrush.Show(thumbnailSelector, new Point(thumbnail.Left, thumbnail.Bottom)); } }