Я тут набросал кусочек программы, но она работает только с полигонами, а линии, полилинии и точки игнорит почему-то:
int count = 0;
while (count != pMap.LayerCount)
{
pI = pMap.get_Layer(count) as IIdentify;
pP = (m_application as IMxApplication).Display.DisplayTransformation.ToMapPoint(X, Y);
pIDArray = pI.Identify(pP);
if (pIDArray != null)
{
pFIO = pIDArray.get_Element(0) as IFeatureIdentifyObj;
pIO = pFIO as IIdentifyObj;
pRIO = pIO as IRowIdentifyObject;
IFields pFs = pRIO.Row.Fields;
IField pF;
int fcount = 0;
string bstr = "";
while (fcount != pFs.FieldCount)
{
pF = pFs.get_Field(fcount);
if (fcount == 1)
{
pGeometry = pRIO.Row.get_Value(fcount) as IGeometry;
if (pGeometry.GeometryType == esriGeometryType.esriGeometryLine)
bstr += pF.AliasName + " : " + "Линия\n";
if (pGeometry.GeometryType == esriGeometryType.esriGeometryPoint)
bstr += pF.AliasName + " : " + "Точка\n";
if (pGeometry.GeometryType == esriGeometryType.esriGeometryPolygon)
bstr += pF.AliasName + " : " + "Полигон\n";
if (pGeometry.GeometryType == esriGeometryType.esriGeometryPolyline)
bstr += pF.AliasName + " : " + "Полилиния\n";
}
else
bstr += pF.AliasName + " : " + pRIO.Row.get_Value(fcount).ToString() + "\n";
fcount++;
}
pIO.Flash((m_application as IMxApplication).Display);
count = 0;
Form1 pForm = new Form1(bstr, pIO.Layer.Name);
pForm.Activate();
break;
}
else
{
count++;
}
}