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

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

Remove the given collection of models from this source.
public RemoveObjects ( ICollection modelObjects ) : void
modelObjects ICollection
Результат void
        public override void RemoveObjects(ICollection modelObjects) {

            // We have to unselect any object that is about to be deleted
            List<int> indicesToRemove = new List<int>();
            foreach (object modelObject in modelObjects) {
                int i = this.GetObjectIndex(modelObject);
                if (i >= 0)
                    indicesToRemove.Add(i);
            }

            // Sort the indices from highest to lowest so that we
            // remove latter ones before earlier ones. In this way, the
            // indices of the rows doesn't change after the deletes.
            indicesToRemove.Sort();
            indicesToRemove.Reverse();

            foreach (int i in indicesToRemove) 
                this.listView.SelectedIndices.Remove(i);

            // Remove the objects from the unfiltered list
            foreach (object modelObject in modelObjects)
                this.fullObjectList.Remove(modelObject);

            this.FilterObjects();
            this.RebuildIndexMap();
        }