/// <summary> /// Remove all items from this list /// </summary> /// <remark>This method can safely be called from background threads.</remark> public override void ClearObjects() { if (InvokeRequired) { Invoke(new MethodInvoker(ClearObjects)); } else { CheckStateMap.Clear(); SetObjects(new List <object>()); } }
/// <summary> /// Get the checkedness of an object from the model. Returning null means the /// model does know and the value from the control will be used. /// </summary> /// <param name="modelObject"></param> /// <returns></returns> protected override CheckState?GetCheckState(object modelObject) { if (CheckStateGetter != null) { return(base.GetCheckState(modelObject)); } CheckState state; if (modelObject != null && CheckStateMap.TryGetValue(modelObject, out state)) { return(state); } return(CheckState.Unchecked); }