コード例 #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
ファイル: PropertyPane.cs プロジェクト: JuliaABurch/Treefrog
        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);
     }
 }