Exemple #1
0
        /// <summary>
        /// Accept or discard current value of cell editor control
        /// </summary>
        /// <param name="AcceptChanges">Use the _editingControl's Text as new SubItem text or discard changes?</param>
        public void EndEditing(bool AcceptChanges)
        {
            if (_editingControl == null)
            {
                return;
            }

            SubItemEndEditingEventArgs e = new SubItemEndEditingEventArgs(
                _editItem,                             // The item being edited
                _editSubItem,                          // The subitem index being edited
                AcceptChanges ?
                _editingControl.Text :                 // Use editControl text if changes are accepted
                _editItem.SubItems[_editSubItem].Text, // or the original subitem's text, if changes are discarded
                !AcceptChanges                         // Cancel?
                );

            OnSubItemEndEditing(e);

            if (!string.IsNullOrEmpty(e.DisplayText))
            {
                _editItem.SubItems[_editSubItem].Text = e.DisplayText;
            }

            _editingControl.Leave    -= _editControl_Leave;
            _editingControl.KeyPress -= _editControl_KeyPress;

            _editingControl.Visible = false;

            _editingControl = null;
            _editItem       = null;
            _editSubItem    = -1;
        }
Exemple #2
0
 protected void OnSubItemEndEditing(SubItemEndEditingEventArgs e)
 {
     if (SubItemEndEditing != null)
     {
         SubItemEndEditing(this, e);
     }
 }
Exemple #3
0
 private void lvFTPList_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e)
 {
     if (lvFTPList.SelectedItems.Count > 0 && !e.Cancel && !string.IsNullOrEmpty(e.DisplayText))
     {
         FtpListItem file = (FtpListItem)lvFTPList.SelectedItems[0].Tag;
         if (file.Name != e.DisplayText)
         {
             Client.Rename(file.FullName, URLHelpers.CombineURL(currentDirectory, e.DisplayText));
             RefreshDirectory();
         }
     }
 }
Exemple #4
0
 protected void OnSubItemEndEditing(SubItemEndEditingEventArgs e)
 {
     if (SubItemEndEditing != null)
         SubItemEndEditing(this, e);
 }
Exemple #5
0
        /// <summary>
        /// Accept or discard current value of cell editor control
        /// </summary>
        /// <param name="AcceptChanges">Use the _editingControl's Text as new SubItem text or discard changes?</param>
        public void EndEditing(bool AcceptChanges)
        {
            if (_editingControl == null)
                return;

            SubItemEndEditingEventArgs e = new SubItemEndEditingEventArgs(
                _editItem, // The item being edited
                _editSubItem, // The subitem index being edited
                AcceptChanges ?
                    _editingControl.Text : // Use editControl text if changes are accepted
                    _editItem.SubItems[_editSubItem].Text, // or the original subitem's text, if changes are discarded
                !AcceptChanges // Cancel?
                );

            OnSubItemEndEditing(e);

            if (!string.IsNullOrEmpty(e.DisplayText))
            {
                _editItem.SubItems[_editSubItem].Text = e.DisplayText;
            }

            _editingControl.Leave -= _editControl_Leave;
            _editingControl.KeyPress -= _editControl_KeyPress;

            _editingControl.Visible = false;

            _editingControl = null;
            _editItem = null;
            _editSubItem = -1;
        }
Exemple #6
0
 private void lvFTPList_SubItemEndEditing(object sender, SubItemEndEditingEventArgs e)
 {
     if (lvFTPList.SelectedItems.Count > 0 && !e.Cancel && !string.IsNullOrEmpty(e.DisplayText))
     {
         FtpListItem file = (FtpListItem)lvFTPList.SelectedItems[0].Tag;
         if (file.Name != e.DisplayText)
         {
             Client.Rename(file.FullName, URLHelpers.CombineURL(currentDirectory, e.DisplayText));
             RefreshDirectory();
         }
     }
 }