This document is archived and information here might be outdated.  Recommended version.


IEditor.SelectionCount Property (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (Editor)  

IEditor.SelectionCount Property

The number of selected features which are editable.

[Visual Basic .NET]
Public ReadOnly Property SelectionCount As Integer
[C#]
public int SelectionCount {get;}

Product Availability

Available with ArcGIS Desktop.

Remarks

This property returns the Map's total number of selected features belonging to editable layers.
[C#]

public void GetMapSelection()
{  
  //Get a reference to IApplication app in ICommand::OnCreate hook parameter.
  IEditor sEditor=app.FindExtensionByName("ESRI Object Editor") as IEditor;
  IEnumFeature enumFeature=sEditor.EditSelection;
  enumFeature.Reset();
  IFeature selFeature=enumFeature.Next();
  for (int fCount=0; fCount < sEditor.SelectionCount; fCount++)
  { 
    IGeometry selGeometry=selFeature.Shape;
    'Code to do something with the geometry
     System.Windows.Forms.MessageBox.Show(selGeometry.GeometryType);
     selFeature=enumFeature.Next;
  }
}

See Also

IEditor Interface

.NET Snippets

Flip Line Direction

.NET Samples

Curve conversion add-in (Code Files: CurveConversionDockWin)