Pond |
The PondContourCollection type exposes the following members.
| Name | Description | |
|---|---|---|
| PondContourCollection | Initializes a new instance of the PondContourCollection class. | |
| PondContourCollection(PondContour) | Initializes a new instance of the PondContourCollection class from an array of PondContours. |
| Name | Description | |
|---|---|---|
| Count | Gets the number of contours in the collection. | |
| ItemInt32 | ||
| ItemString |
| Name | Description | |
|---|---|---|
| Add(PondContour) | Adds a contour to the collection. | |
| Add(PondContour) | Adds multiple contours to the collection from an array of PondContours. | |
| Clear | Removes all contours from the collection. | |
| Contains | Determines whether the collection contains a contour with the specified ID. | |
| GetEnumerator | Implements the method declared in the IEnumerable interface. This method returns an enumerator for this collection. | |
| GetObjectEnumerator | Implements the method declared in the IEnumerable interface. This method returns an enumerator for this collection. | |
| IndexOf | Gets the index of the contour with the specified ID in the collection. | |
| Remove | Removes the contour with the specified ID from the collection. | |
| RemoveAt | Removes the contour at the specified index from the collection. | |
| Set(PondContour) | Sets (replaces) an existing contour in the collection, or adds it if not present. | |
| Set(PondContour) | Sets (replaces) multiple contours in the collection. |
Collection Organization:
The contours are sorted by area in descending order (outermost to innermost). The pond's outer boundary will always be the first contour in the collection. Each PondContour represents a contour at a specific elevation.
Snapshot Pattern:
This collection implements a snapshot pattern for data access and modification:
Example Usage:
1// Retrieve contour (gets independent copy) 2var contour = collection[contourId]; 3 4// Create modified version with same ID 5var offsetContour = contour.GetOffsetContour(5.0, 2.0); 6var modifiedContour = new PondContour(offsetContour.ToPolyline(), contour.Id); 7 8// Update collection (required for changes to take effect) 9collection.Set(modifiedContour);