Beispiel #1
0
        public List <int> GetNumbers()
        {
            List <int> list = new List <int>();

            for (int i = 0; i < Children.Count; i++)
            {
                SolidColorBrush       brush = null;
                RoundedCornersPolygon rcp   = Children[i] as RoundedCornersPolygon;
                if (rcp != null)
                {
                    brush = (SolidColorBrush)rcp.Fill;
                }
                Ellipse ellipse = Children[i] as Ellipse;
                if (ellipse != null)
                {
                    brush = (SolidColorBrush)ellipse.Fill;
                }
                Rectangle rectangle = Children[i] as Rectangle;
                if (rectangle != null)
                {
                    brush = (SolidColorBrush)rectangle.Fill;
                }
                if (brush.Color.R == 255)
                {
                    list.Add(i);
                }
            }
            return(list);
        }
Beispiel #2
0
        private void InitCenterRightTop()
        {
            RoundedCornersPolygon rcp;

            if (Children.Count != 100 && Children.Count != 200)
            {
                rcp = new RoundedCornersPolygon();
            }
            else
            {
                rcp = (RoundedCornersPolygon)Children[55];
            }

            PointCollection pc;

            if (IsMembrane)
            {
                pc = new PointCollection
                {
                    new Point(0 + 1, 0 + 1),
                    new Point(_blockWidth - _canvasSize / 600, 0 + _canvasSize / 600),
                    new Point(_blockWidth - _canvasSize / 600, _blockWidth - _canvasSize / 600),
                    new Point(_blockWidth / 4 - _canvasSize / 600, _blockWidth - _canvasSize / 600),
                    new Point(0 + _canvasSize / 600, _blockWidth / 4 * 3 - _canvasSize / 600)
                };
            }
            else
            {
                pc = new PointCollection
                {
                    new Point(0, 0),
                    new Point(_blockWidth, 0),
                    new Point(_blockWidth, _blockWidth),
                    new Point(_blockWidth / 4, _blockWidth),
                    new Point(0, _blockWidth / 4 * 3)
                };
            }
            rcp.Points = pc;

            SetLeft(rcp, _bigCrevice + _blockWidth + (0 + 4) * (_blockWidth + _smallCrevice));
            SetTop(rcp, _canvasSize - _bigCrevice - _circularWidth - _normalCrevice - _blockWidth - 4 * (_blockWidth + _smallCrevice));

            rcp.ArcRoundness           = _blockWidth / 12;
            rcp.UseRoundnessPercentage = false;
            rcp.IsClosed = true;
            if (Children.Count != 100 && Children.Count != 200)
            {
                Children.Add(rcp);
            }
        }