您的位置:首页 > 其它

MapXtreme删除图层中某个对象

2013-06-20 16:57 239 查看
private void DelFenceInTable(Table table,String tableAlias,int id)
{
try
{
SearchInfo si = MapInfo.Data.SearchInfoFactory.SearchWhere("");

IResultSetFeatureCollection ifs;

if (table != null) //Table exists close it
{
si = MapInfo.Data.SearchInfoFactory.SearchWhere("");

ifs = MapInfo.Engine.Session.Current.Catalog.Search(tableAlias, si);

foreach (Feature ft in ifs)
{
string ID = ft["ID"].ToString();
if (ID == id.ToString())
{
table.DeleteFeature(ft);
break;
}
}
table.Refresh();

}
}
catch (Exception ex)
{
ExceptionLog.Log("DelFenceInTable " + ex.ToString());
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: