/// <summary> /// /// </summary> /// <param name="args"></param> protected virtual void OnSubItemChecking(SubItemCheckingEventArgs args) { if (this.SubItemChecking != null) this.SubItemChecking(this, args); }
/// <summary> /// Toggle the check at the check box of the given cell /// </summary> /// <param name="rowObject"></param> /// <param name="column"></param> public virtual void ToggleSubItemCheckBox(object rowObject, OLVColumn column) { CheckState currentState = column.GetCheckState(rowObject); CheckState newState = CalculateToggledCheckState(column, currentState); SubItemCheckingEventArgs args = new SubItemCheckingEventArgs(column, this.ModelToItem(rowObject), column.Index, currentState, newState); this.OnSubItemChecking(args); if (args.Canceled) return; switch (args.NewValue) { case CheckState.Checked: this.CheckSubItem(rowObject, column); break; case CheckState.Indeterminate: this.CheckIndeterminateSubItem(rowObject, column); break; case CheckState.Unchecked: this.UncheckSubItem(rowObject, column); break; } }
private void objectListView1_SubItemChecking( object sender, SubItemCheckingEventArgs e ) { foreach( ListViewItem item in objectListView1.Items ) { string subName = item.SubItems[0].Text; if( item.SubItems[5].Text == "True" ) { user.action.changeState( subName, 1, true ); } else if( item.SubItems[5].Text == "False" ) { user.action.changeState( subName, 1, false ); } if( item.SubItems[6].Text == "True" ) { user.action.changeState( subName, 2, true ); } else if( item.SubItems[6].Text == "False" ) { user.action.changeState( subName, 2, false ); } } timerFast.Interval = 500; timerFast.Start(); timerFast.Tick += new EventHandler( timer3_Tick ); }