System.Web.UI.Design.DesignerRegionCollection.Remove Method

Removes the specified System.Web.UI.Design.DesignerRegion object from the collection.

Syntax

public void Remove (DesignerRegion region)

Parameters

region
The System.Web.UI.Design.DesignerRegion to remove from the collection.

Remarks

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.

Note:

When you remove an item from the collection, the indexes change for subsequent items in the collection.

Requirements

Namespace: System.Web.UI.Design
Assembly: System.Design (in System.Design.dll)
Assembly Versions: 2.0.0.0