Пример #1
0
 private void ClearSourceExplorer()
 {
     CodeSourceView.Document = null;
     CodeSourceTree.Items.Clear();
     Parser?.Clear();
     HighlightedElements.Clear();
 }
Пример #2
0
        private void VixenPreviewControl_MouseUp(object sender, MouseEventArgs e)
        {
            HighlightedElements.Clear();
            if (_mouseCaptured)
            {
                if (_currentTool != Tools.Select)
                {
                    // If control is pressed, deselect the shape and immediately allow drawing another shape
                    if ((Control.ModifierKeys & Keys.Control) != 0)
                    {
                        _selectedDisplayItem.Shape.MouseUp(sender, e);
                        DeSelectSelectedDisplayItem();
                    }
                    else
                    {
                        _currentTool = Tools.Select;
                    }
                }

                if (_selectedDisplayItem != null)
                {
                    _selectedDisplayItem.Shape.MouseUp(sender, e);
                    OnSelectDisplayItem(this, _selectedDisplayItem);
                }
                // Ok, if this is true, we've got a rubber band and something is selected, now what?
                else if (SelectedDisplayItems.Count > 0)
                {
                    // If we only have one item, just select it and go on.
                    if (SelectedDisplayItems.Count == 1)
                    {
                        _selectedDisplayItem = SelectedDisplayItems[0];
                        _selectedDisplayItem.Shape.Select(true);
                        OnSelectDisplayItem(this, _selectedDisplayItem);
                        SelectedDisplayItems.Clear();
                    }
                    else
                    {
                        // Do nothing...
                    }
                }
            }
            ResetMouse();
        }