예제 #1
0
        public static ICatalogItem CreateCatalog(IDatasetName dsNameSource,ICatalogItem parent,IWorkspaceCatalogItem workspaceItem)
        {
            if (dsNameSource == null)
                return null;

            if (dsNameSource is IWorkspaceName)
            {
                return new WorkspaceCatalogItem(dsNameSource, parent);
            }

            ICatalogItem catalogItem = null;
            switch (dsNameSource.Type)
            {
                case esriDatasetType.esriDTFeatureDataset:
                    catalogItem = new FeatureDatasetCatalogItem(dsNameSource, parent);
                    break;

                case esriDatasetType.esriDTFeatureClass:
                    catalogItem = new FeatureClassCatalogItem(dsNameSource, parent);
                    break;

                case esriDatasetType.esriDTTable:
                    catalogItem = new TableCatalogItem(dsNameSource, parent);
                    break;

                case esriDatasetType.esriDTTerrain:
                    catalogItem = new TerrainCatalogItem(dsNameSource, parent);
                    break;

                case esriDatasetType.esriDTTin:
                    catalogItem = new TinCatalogItem(dsNameSource, parent);
                    break;

                case esriDatasetType.esriDTTopology:
                    catalogItem = new TopologyCatalogItem(dsNameSource, parent);
                    break;

                case esriDatasetType.esriDTRasterCatalog:
                    catalogItem = new RasterCatalogCatalogItem(dsNameSource, parent);
                    break;

                case esriDatasetType.esriDTRasterDataset:
                case esriDatasetType.esriDTMosaicDataset:
                    catalogItem= new RasterSetCatalogItem(dsNameSource, parent);
                    break;

                case esriDatasetType.esriDTRasterBand:
                    catalogItem= new RasterBandCatalogItem(dsNameSource, parent);
                    break;

                default:
                    return null;
            }
            if (catalogItem != null)
                catalogItem.WorkspaceItem = workspaceItem;

            return catalogItem;
        }