Beispiel #1
0
 private void OnEditSubItemCompleted(EditSubItemEventArgs e)
 {
     if (EditSubItemCompleted != null)
     {
         EditSubItemCompleted(this, e);
     }
 }
Beispiel #2
0
 private void OnAfterEditSubItem(EditSubItemEventArgs e)
 {
     if (AfterEditSubItem != null)
     {
         AfterEditSubItem(this, e);
     }
 }
Beispiel #3
0
        private void tmpTextBox_Leave(object sender, EventArgs e)
        {
            TextBox tmpTb = sender as TextBox;

            string[] tmpIndex         = tmpTb.Tag as string[];
            int      itemRowIndex     = int.Parse(tmpIndex[0]);
            int      itemColumnIndex  = int.Parse(tmpIndex[1]);
            string   userSate         = tmpIndex[2];
            bool     isRemoveIfCancel = bool.Parse(tmpIndex[3]);

            ListViewItem.ListViewSubItem subItem = this.Items[itemRowIndex].SubItems[itemColumnIndex];
            string oldLabel = subItem.Text;
            string label    = tmpTb.Text;

            EditSubItemEventArgs editSubItemArgs = new EditSubItemEventArgs(oldLabel, label, itemRowIndex, itemColumnIndex, userSate, isRemoveIfCancel);

            OnAfterEditSubItem(editSubItemArgs);
            if (editSubItemArgs.IsCancelEdit)
            {
                if (editSubItemArgs.IsRemoveIfCancel)
                {
                    this.Items[itemRowIndex].Remove();
                }
                ClearTextBox();
                return;
            }
            //接受更改
            subItem.Text = label;
            //完成事件
            OnEditSubItemCompleted(editSubItemArgs);
            ClearTextBox();
        }
Beispiel #4
0
        private void tmpTextBox_Leave(object sender, EventArgs e)
        {
            TextBox tmpTb = sender as TextBox;
            string[] tmpIndex = tmpTb.Tag as string[];
            int itemRowIndex = int.Parse(tmpIndex[0]);
            int itemColumnIndex = int.Parse(tmpIndex[1]);
            string userSate = tmpIndex[2];
            bool isRemoveIfCancel = bool.Parse(tmpIndex[3]);
            ListViewItem.ListViewSubItem subItem = this.Items[itemRowIndex].SubItems[itemColumnIndex];
            string oldLabel = subItem.Text;
            string label = tmpTb.Text;

            EditSubItemEventArgs editSubItemArgs = new EditSubItemEventArgs(oldLabel, label, itemRowIndex, itemColumnIndex, userSate, isRemoveIfCancel);
            OnAfterEditSubItem(editSubItemArgs);
            if (editSubItemArgs.IsCancelEdit)
            {
                if (editSubItemArgs.IsRemoveIfCancel)
                {
                    this.Items[itemRowIndex].Remove();
                }
                ClearTextBox();
                return;
            }
            //接受更改
            subItem.Text = label;
            //完成事件
            OnEditSubItemCompleted(editSubItemArgs);
            ClearTextBox();
        }
Beispiel #5
0
 private void OnEditSubItemCompleted(EditSubItemEventArgs e)
 {
     if (EditSubItemCompleted != null)
     {
         EditSubItemCompleted(this, e);
     }
 }
Beispiel #6
0
 private void OnAfterEditSubItem(EditSubItemEventArgs e)
 {
     if (AfterEditSubItem != null)
     {
         AfterEditSubItem(this, e);
     }
 }