ArcEngine判断要素集是否存在

根据要素集名称进行判断

        private bool IWorkspaceIsExistDataset(IWorkspace pWorkspace,string strname)
        {
            IEnumDataset pEnumDataset = pWorkspace.get_Datasets(esriDatasetType.esriDTFeatureDataset);
            pEnumDataset.Reset();
            IDataset pDataset = pEnumDataset.Next();

            bool ExistDataset = false;

            #region 判断要素集是否存在

            while (pDataset != null)
            {
                if (pDataset.Name == strname)
                {
                    ExistDataset = true;
                    break;
                }

                pDataset = pEnumDataset.Next();
            }

            return ExistDataset;

        }

 

posted @ 2016-06-08 15:28  恋上微笑的天使  阅读(1032)  评论(0编辑  收藏  举报