// 从集合中和视觉上同时删除 public void PhysicalDeleteItem( OrderItem orderitem) { // 从listview中消失 orderitem.DeleteFromListView(); this.Remove(orderitem); }
public new void Clear() { for (int i = 0; i < this.Count; i++) { OrderItem item = this[i]; item.DeleteFromListView(); } base.Clear(); }
// 标记删除 public void MaskDeleteItem( bool bRemoveFromList, OrderItem orderitem) { if (orderitem.ItemDisplayState == ItemDisplayState.New) { PhysicalDeleteItem(orderitem); return; } orderitem.ItemDisplayState = ItemDisplayState.Deleted; orderitem.Changed = true; // 从listview中消失? if (bRemoveFromList == true) { orderitem.DeleteFromListView(); } else { orderitem.RefreshListView(); } }
// 标记删除 public void MaskDeleteItem( bool bRemoveFromList, OrderItem orderitem) { if (orderitem.ItemDisplayState == ItemDisplayState.New) { PhysicalDeleteItem(orderitem); return; } orderitem.ItemDisplayState = ItemDisplayState.Deleted; orderitem.Changed = true; // 从listview中消失? if (bRemoveFromList == true) orderitem.DeleteFromListView(); else { orderitem.RefreshListView(); } }