Пример #1
0
        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);
        }
Пример #2
0
 protected void OnSubItemEndEditing(SubItemEndEditingEventArgs e)
 {
     if (SubItemEndEditing != null)
     {
         SubItemEndEditing(this, e);
     }
 }
Пример #3
0
        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);
            }
        }
Пример #4
0
        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;
        }
Пример #5
0
 protected void OnSubItemEndEditing(SubItemEndEditingEventArgs e)
 {
     if (SubItemEndEditing != null) {
         SubItemEndEditing(this, e);
     }
 }