本文主要是介绍C# + AE 判断图层类型,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在C# + ArcEngine开发中,判断axMapControl中的图层是什么样的类型,代码如下
if (axMapControl1.LayerCount> 0)
{
for (inti = 0; i < axMapControl1.LayerCount; i++)
{
ILayer pLayer = axMapControl1.get_Layer(i);
if (pLayer is IFeatureLayer)
{
MessageBox.Show("IFeatureLayer name : " +pLayer.Name);
}
else if (pLayer is IRasterLayer)
{
MessageBox.Show("IRasterLayer name : " +pLayer.Name);
}
}
}
更多类型的判断,写法类似。
这篇关于C# + AE 判断图层类型的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!