示例#1
0
        private PictureBox GetBallView(Ball b, ICollection <Ball> legal, IReadOnlyList <ComboItem> names)
        {
            var img = SpriteUtil.GetBallSprite((int)b);
            var pb  = new PictureBox
            {
                Size                  = img.Size,
                Image                 = img,
                BackgroundImage       = legal.Contains(b) ? Resources.slotSet : Resources.slotDel,
                BackgroundImageLayout = ImageLayout.Tile
            };

            pb.MouseEnter += (_, __) => Text = names.First(z => z.Value == (int)b).Text;
            pb.Click      += (_, __) => SelectBall(b);
            return(pb);
        }