public void EndEditing(bool acceptChanges, Keys exitKey) { if (_inEndEditing || _editControl == null) { return; } _inEndEditing = true; SubItemEndEditingEventArgs e = new SubItemEndEditingEventArgs(_editItem, _editSubItem, acceptChanges ? _editControl.Text : _editItem.SubItems[_editSubItem].Text, !acceptChanges, exitKey); OnSubItemEndEditing(e); _editItem.SubItems[_editSubItem].Text = e.DisplayText; _editControl.Leave -= EditControlLeaveHandler; _editControl.KeyPress -= EditControlKeyPressHandler; _editControl.KeyDown -= EditControlKeyDownHandler; _editControl.PreviewKeyDown -= EditControlPreviewKeyDownHandler; _editControl.Visible = false; _editControl = null; _editItem = null; _editSubItem = -1; OnSubItemReset(EventArgs.Empty); _inEndEditing = false; OnEditingFinished(EventArgs.Empty); }
protected void OnSubItemEndEditing(SubItemEndEditingEventArgs e) { if (SubItemEndEditing != null) { SubItemEndEditing(this, e); } }
private void PropertyListEndEditingHandler(object sender, SubItemEndEditingEventArgs e) { if (e.SubItem == 1 && _controller.CanRenameSelectedProperty) { _controller.ActionRenameSelectedProperty(e.DisplayText); if (e.ExitKey == Keys.Tab) { _queuedEditItem = e.Item; _queuedEditIndex = 2; } } else if (e.SubItem == 2 && _controller.CanEditSelectedProperty) { _controller.ActionEditSelectedProperty(e.DisplayText); } }
public void EndEditing(bool acceptChanges, Keys exitKey) { if (_inEndEditing || _editControl == null) { return; } _inEndEditing = true; SubItemEndEditingEventArgs e = new SubItemEndEditingEventArgs(_editItem, _editSubItem, acceptChanges ? _editControl.Text : _editItem.SubItems[_editSubItem].Text, !acceptChanges, exitKey); OnSubItemEndEditing(e); _editItem.SubItems[_editSubItem].Text = e.DisplayText; _editControl.Leave -= EditControlLeaveHandler; _editControl.KeyPress -= EditControlKeyPressHandler; _editControl.KeyDown -= EditControlKeyDownHandler; _editControl.PreviewKeyDown -= EditControlPreviewKeyDownHandler; _editControl.Visible = false; _editControl = null; _editItem = null; _editSubItem = -1; OnSubItemReset(EventArgs.Empty); _inEndEditing = false; }
protected void OnSubItemEndEditing(SubItemEndEditingEventArgs e) { if (SubItemEndEditing != null) { SubItemEndEditing(this, e); } }