public static List<IFeatureClass> getFClFromFGDB(string fileGDBPath)
{
IWorkspaceFactory pWorkspaceFactory = new FileGDBWorkspaceFactoryClass();
IWorkspace pWorkspace = pWorkspaceFactory.OpenFromFile(fileGDBPath, 0);
IFeatureWorkspace pFeatureWorkspace = pWorkspace as IFeatureWorkspace;
IEnumDataset pEnumDataset = pWorkspace.get_Datasets(esriDatasetType.esriDTAny) as IEnumDataset;
pEnumDataset.Reset();
IDataset pDataset = pEnumDataset.Next();
List<IFeatureClass> fcls = new List<IFeatureClass>();
if (pDataset is IFeatureDataset)
{
IFeatureDataset pFeatureDataset = pFeatureWorkspace.OpenFeatureDataset(pDataset.Name);
IEnumDataset pEnumDataset1 = pFeatureDataset.Subsets;
pEnumDataset1.Reset();
IDataset pDataset1 = pEnumDataset1.Next();
while (pDataset1 is IFeatureClass &&pDataset1 !=null)
{
IFeatureClass fcl= pFeatureWorkspace.OpenFeatureClass(pDataset1.Name);
fcls.Add(fcl);
pDataset1 = pEnumDataset1.Next();
}
}
return fcls;
}