Exemplo n.º 1
0
        public void DrawingPanelRightMouseButtonPressed(int mouseX, int mouseY)
        {
            RightClickPopUp = null;
            var clickedOnSelectedShape = SelectedShapes.Where(s => s.Contains(mouseX, mouseY)).ToList().Count > 0;

            if (SelectedShapes.Count > 1 && clickedOnSelectedShape)
            {
                var tmpSelectedShapes = new GroupShapes();
                foreach (var shape in SelectedShapes)
                {
                    tmpSelectedShapes.Add(shape);
                }
                RightClickPopUp = tmpSelectedShapes.CreateRightClickPopUp();
            }
            else
            {
                var shape = DrawnShapes.LastOrDefault(s => s.Contains(mouseX, mouseY));
                if (shape != null)
                {
                    RightClickPopUp = shape.CreateRightClickPopUp();
                }
            }
            if (RightClickPopUp != null)
            {
                _g.OpenRightClickPopUp();
            }
        }
Exemplo n.º 2
0
        public void AddRemoveSelectedShape(int x, int y)
        {
            var shape = DrawnShapes.LastOrDefault(s => s.Contains(x, y));

            if (shape == null)
            {
                SelectedShapes.Clear();
            }
            else
            {
                if (!SelectedShapes.Contains(shape))
                {
                    SelectedShapes.Add(shape);
                }
                else
                {
                    SelectedShapes.Remove(shape);
                }
            }
            _g.RefreshView();
        }