Ejemplo n.º 1
0
 protected override void OnMouseDown(MouseEventArgs e)
 {
     base.OnMouseDown(e);
     _focusedItem = null;
     if (_provider == null || _provider.Items == null || _provider.Items.Count == 0)
     {
         return;
     }
     FindFocusedLayer(e.Location, _provider);
     if (_focusedItem != null)
     {
         if (_helpers[_focusedItem].VisibleBounds.Contains(e.Location))
         {
             _focusedItem.IsVisible = !_focusedItem.IsVisible;
             SetAllChildrenVisible(_focusedItem, _focusedItem.IsVisible);
             _provider.RefreshViewer();
         }
         else if (_helpers[_focusedItem].EditBounds.Contains(e.Location) && _focusedItem.IsSelected)
         {
             _editLayerItem = _focusedItem;
             Invalidate();
             return;
         }
         else
         {
             if (_helpers[_focusedItem].GroupCollpaseBounds.Contains(e.Location))
             {
                 _helpers[_focusedItem].IsCollpased = !_helpers[_focusedItem].IsCollpased;
             }
         }
         if (_allowDrag && _focusedItem != null && !_helpers[_focusedItem].IsFixed)
         {
             Cursor         = dragCursor;
             _isDraging     = true;
             _dragLayerItem = _focusedItem;
             beginDrapPoint = e.Location;
         }
     }
     if (_textBox.Visible)
     {
         _textBox.Visible = false;
     }
     _currentLayerItem = _focusedItem;
     Invalidate();
 }
Ejemplo n.º 2
0
 private void propertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
 {
     _layersProvider.RefreshViewer();
 }