示例#1
0
 public void ShowBlock(Point pLocation)
 {
     if (HighLight)
     {
         Canvas.AddRectangle(pLocation.X, pLocation.Y, Width, Height, _Color, 2, Color.Yellow);
     }
     else
     {
         Canvas.AddRectangle(pLocation.X, pLocation.Y, Width, Height, _Color, 1, Color.Black);
     }
 }
示例#2
0
        public override void MouseUp(MouseEventArgs e)
        {
            if (IsDrawing)
            {
                IsDrawing = false;

                // Mouse up means that we want to draw our final result, so we longer need creation shapes.
                CreationDrawable = null;

                // The final drawn result.
                var rectangle = GetRectangle(true);

                // Add final result to the Canvas.
                if (rectangle.Width > 0 && rectangle.Height > 0)
                {
                    Canvas.AddRectangle(rectangle);
                }

                RepaintCanvas();
            }
        }