private void ObjectListView_DeviceList_HeaderCheckBoxChanging(object sender, HeaderCheckBoxChangingEventArgs e)
 {
     ObjectListView olv = sender as ObjectListView;
     CheckState newState = e.NewCheckState;
     if (newState == CheckState.Checked)
     {
         // suppress message box
         _suppressErrorMessage = true;
         if (olv.Objects != null)
         {
             olv.CheckAll();
         }
         _suppressErrorMessage = false;
     }
     else if (newState == CheckState.Unchecked)
     {
         if (olv.Objects != null && olv.CheckedObjects.Count > 0)
         {
             olv.UncheckAll();
         }
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="args"></param>
 protected virtual void OnHeaderCheckBoxChanging(HeaderCheckBoxChangingEventArgs args)
 {
     if (this.HeaderCheckBoxChanging != null)
         this.HeaderCheckBoxChanging(this, args);
 }
Esempio n. 3
0
        private void ChangeHeaderCheckBoxState(OLVColumn column, CheckState newState)
        {
            // Tell the world the checkbox was clicked
            HeaderCheckBoxChangingEventArgs args = new HeaderCheckBoxChangingEventArgs();
            args.Column = column;
            args.NewCheckState = newState;

            this.OnHeaderCheckBoxChanging(args);
            if (args.Cancel || column.HeaderCheckState == args.NewCheckState)
                return;

            Stopwatch sw = Stopwatch.StartNew();

            column.HeaderCheckState = args.NewCheckState;
            this.HeaderControl.Invalidate(column);

            if (column.HeaderCheckBoxUpdatesRowCheckBoxes) {
                if (column.Index == 0)
                    this.UpdateAllPrimaryCheckBoxes(column);
                else
                    this.UpdateAllSubItemCheckBoxes(column);
            }

            Debug.WriteLine(String.Format("PERF - Changing row checkboxes on {2} objects took {0}ms / {1} ticks", sw.ElapsedMilliseconds, sw.ElapsedTicks, this.GetItemCount()));
        }
 private void ObjectListView_TeamFoldersMembers_HeaderCheckBoxChanging(object sender, HeaderCheckBoxChangingEventArgs e)
 {
     ObjectListView olv = sender as ObjectListView;
     CheckState newState = e.NewCheckState;
     if (newState == CheckState.Checked)
     {
         olv.CheckAll();
     }
     else if (newState == CheckState.Unchecked)
     {
         olv.UncheckAll();
     }
 }