Removes the specified System.Web.UI.Design.DesignerRegion object from the collection.
- region
- The System.Web.UI.Design.DesignerRegion to remove from the collection.
The DesignerRegionCollection.Remove(DesignerRegion) method removes the first occurrence of the specified region from the collection. If the System.Web.UI.Design.DesignerRegionCollection object does not contain the specified region, the collection remains unchanged. No exception is thrown.
The DesignerRegionCollection.Remove(DesignerRegion) method determines equality by using the object.Equals(object) method on the System.Web.UI.Design.DesignerRegion object.
The DesignerRegionCollection.Remove(DesignerRegion) method performs a linear search; therefore, the average execution time is proportional to the DesignerRegionCollection.Count property. Because template region collections are typically small, the performance of the linear search operation is not critical.
To remove a region at a particular index from the collection, use the DesignerRegionCollection.RemoveAt(int) method. To remove all regions from the collection, use the DesignerRegionCollection.Clear method.
When you remove an item from the collection, the indexes change for subsequent items in the collection.