Vba コードを C# に変換しようとしています。私は本当に近づいていますが、なぜこのエラーが発生し続けるのか理解できます。エラー メソッド グループ 'NextFeature' を非デリゲート タイプ 'ESRI.ArcGIS.Carto.IFeatureSelection' に変換できません。メソッドを呼び出すつもりでしたか?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.ArcMapUI;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geodatabase;
namespace ArcMapAddin1
{
public partial class frmParcelReader : Form
{
public frmParcelReader()
{
InitializeComponent();
}
public void ReadData()
{
//IMxDocument pMxDoc = default(IMxDocument);
IMxDocument pMxDoc = ArcMapAddin1.ArcMap.Document;
//IMap pMap = default(IMap);
IMap pMap = pMxDoc.FocusMap;
//IFeatureSelection pFLayer = default(IFeatureSelection);
IFeatureLayer pLayer = pMap.get_Layer(0) as IFeatureLayer;
IFeatureSelection pFLayer = pLayer as IFeatureSelection;
string stopHere2 = "";
for (int Count = 0; Count <= pMap.LayerCount - 1; Count++) {
//if (pMap.LayerCount == "sde.GIS.parcels_adacounty")
if (pLayer.Name == "sde.GIS.parcels_adacounty")
{
//pFLayer = pMap.get_Layer(0)
//string thisString = pFLayer.SelectionSet.IDs.ToString();
IFeatureCursor pFCursor = null;
//pFLayer.SelectionSet.Search(null, false, pFCursor);
//IFeature pFLayer = pLayer(IFeature);
pFLayer = pFCursor.NextFeature;
if (pFLayer.SelectionSet.Count != 0) {
//lblParcel.Text = pF.Value.Fields.FindField("PARCEL");
//lblPrimaryOwner.Text = pF.Value(pF.Fields.FindField("PRIMOWNER"));
//lblMailingAddress.Text = pF.Value(pF.Fields.FindField("ADDCONCAT"));
//lblPropertyAddress.Text = pF.Value(pF.Fields.FindField("ADDRESS"));
} else {
//if (sender == "Button")
// MessageBox.Show("Please select a Parcel.");
}
break; // TODO: might not be correct. Was : Exit For
}
}
}
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
ReadData();
}
}
}