BrightIdeasSoftware.VirtualObjectListView.RemoveObjects C# (CSharp) Метод

RemoveObjects() публичный Метод

Remove all of the given objects from the control

Nulls and model objects that are not in the ListView are silently ignored.

Due to problems in the underlying ListView, if you remove all the objects from the control using this method and the list scroll vertically when you do so, then when you subsequenially add more objects to the control, the vertical scroll bar will become confused and the control will draw one or more blank lines at the top of the list.

public RemoveObjects ( ICollection modelObjects ) : void
modelObjects ICollection Collection of objects to be removed
Результат void
        public override void RemoveObjects(ICollection modelObjects)
        {
            if (this.VirtualListDataSource == null)
                return;

            // Give the world a chance to cancel or change the removed objects
            ItemsRemovingEventArgs args = new ItemsRemovingEventArgs(modelObjects);
            this.OnItemsRemoving(args);
            if (args.Canceled)
                return;

            try {
                this.BeginUpdate();
                this.VirtualListDataSource.RemoveObjects(args.ObjectsToRemove);
                this.BuildList();
            }
            finally {
                this.EndUpdate();
            }
        }