/// <summary> /// 마우스 키를 눌렀을 때 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void wTree_MouseDown(object sender, MouseEventArgs e) { Point pt; wTreeNode selectedNode = GetNodeFromPoint(e.Location, out pt); //int index = 0; wTreeNodeItemMouseArgs args = new wTreeNodeItemMouseArgs(new MouseEventArgs(e.Button, e.Clicks, pt.X, pt.Y, e.Delta)); wTreeNodeItem item = (selectedNode == null) ? null : selectedNode.GetItemFromPoint(pt); if (E_TreeNodeMouseDown != null) { E_TreeNodeMouseDown(selectedNode, item, args); } if (args.IsCanceled) { return; } _pressedNode = selectedNode; _pressedItem = item; if (_pressedItem != null && _pressedItem.ItemType == wTreeNodeItemTypes.CheckBox) { } else { if ((ModifierKeys & Keys.Control) != Keys.Control)//Control을 안눌렀다면 이전의 선택부분을 모두 지움.. { if ((ModifierKeys & Keys.Shift) == Keys.Shift) { if (_isShiftDown)//이전에 shift를 누른 채 떼지 않았다면.. { //_pressedNode = _lastMouseUp;//이전에 클릭했던 지점부터 시작.. //SelectedNode = _lastMouseUp; int tempSelecting = VisibleNodes.IndexOf(selectedNode); SelectionHandler.drawSelectingNodes(VisibleNodes.IndexOf(_lastMouseUpNode), tempSelecting); _isShiftDown = true; } else { SelectionHandler.ClearAllSelections(); //_pressedNode = _lastMouseUp;//이전에 클릭했던 지점부터 시작.. //SelectedNode = _lastMouseUp; int tempSelectingStart = VisibleNodes.IndexOf(_lastMouseUpNode); int tempSelecting = VisibleNodes.IndexOf(selectedNode); SelectionHandler.drawSelectingNodes(tempSelectingStart, tempSelecting); _isShiftDown = true; } DrawHandler.ReDrawTree(false); } else { SelectionHandler.ClearAllSelections(); //SetNodeSelected(selectedNode, pt); DrawHandler.ReDrawTree(false); } //this.Focus(); } } if (EditorHandler.ActivatedEditor != null || _ownerTree.Focused == false) { ReleaseFocus(); } }