遍历IFeatureDataset中的FeatureClass
IFeatureWorkspace m_FeatureWorkspace;
m_FeatureWorkspace=(IFeatureWorkspace)m_SdeWorkSpace; //将SDE工作空间转换成要素工作空间
IFeatureDataset m_FeatureDataset = m_FeatureWorkspace.OpenFeatureDataset(listBox_DataFiles.SelectedItem.ToString());
//利用IFeatureClassContainer对象遍历IFeatureDataset
IFeatureClassContainer m_FeatureClassContainer = (IFeatureClassContainer)m_FeatureDataset;
IEnumFeatureClass m_EnumFC = m_FeatureClassContainer.Classes;
IFeatureClass m_FeatureClass = m_EnumFC.Next();
while (m_FeatureClass != null)
{
IFeatureLayer m_FeatureLayer = new FeatureLayerClass();
m_FeatureLayer.FeatureClass = m_FeatureClass;
m_MapControl.Map.AddLayer(m_FeatureLayer); //加载到map窗口
m_FeatureClass = m_EnumFC.Next();
}
m_MapControl.ActiveView.Refresh();