Gets the number of existing Points in the Multipoint.

Namespace:  ESRI.ArcGISExplorer.Geometry

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public int PointCount { get; }
Visual Basic (Declaration)
Public ReadOnly Property PointCount As Integer

Field Value

An integer indicating the number of Points in the Multipoint.

Examples

The code below shows two alternative ways to iterate through the Points comprising a Multipoint; firstly by using GetPoint and PointCount to enumerate over each vertex in a Multipoint by point index number, and secondly by using a foreach (For Each in Visual Basic) statement and the GetPoints method. The code assumes there is an existing Multipoint called mpt. Instances of the Point class are fully-qualified to avoid namespace clashes with System.Drawing.Point.
CopyC#
// For an existing single part Multipoint called mpt, GetPoint and PointCount can be used to iterate points by index number.
for (int pointIndx = 0; pointIndx < mpt.PointCount; pointIndx++)
{
    // Use GetPoint to get a copy of the specific point.
    System.Diagnostics.Debug.WriteLine(mpt.GetPoint(pointIndx).ToString());
}
// Alternatively, Points can be iterated by using foreach.
foreach (ESRI.ArcGISExplorer.Geometry.Point pt in mpt.GetPoints())
{
    System.Diagnostics.Debug.WriteLine(pt.ToString());
}
CopyVB.NET
' For an existing single part Multipoint called mpt, GetPoint and PointCount can be used to iterate points by index number.
Dim pointIndx As Integer = 0
While pointIndx < mpt.PointCount
    ' Use GetPoint to get a copy of the specific point.
    System.Diagnostics.Debug.WriteLine(mpt.GetPoint(pointIndx).ToString())
    System.Math.Max(System.Threading.Interlocked.Increment(pointIndx), pointIndx - 1)
End While
' Alternatively, Points can be iterated by using foreach.
For Each pt As ESRI.ArcGISExplorer.Geometry.Point In mpt.GetPoints()
    System.Diagnostics.Debug.WriteLine(pt.ToString())
Next

See Also