IDatasetContainer接口

The IDatasetContainer interface lets you move datasets between feature datasets and workspaces—both objects implement the interface.

Note that when moving feature classes into a feature dataset, the spatial reference of the source feature class must match the spatial reference of the target feature dataset into which it is being moved.

IDatasetContainer让你能够在工作区间与FeatureDataset之间移动数据集对象。IDatasetContainer只有AddDataset一个方法。要注意的一点是:在移动要素类进入要素数据集时,源数据集的空间参考要与目标数据集的空间参考匹配。

Public   Sub MoveDataset(pFeatureDataset As IFeatureDataset, _
    pDataset 
As IDataset, bRequireStandalone As Boolean)
    
  
Dim pDatasetContainer As IDatasetContainer
  
  
If bRequireStandalone Then
    
Set pDatasetContainer = pFeatureDataset.Workspace
  
Else
    
Set pDatasetContainer = pFeatureDataset
  
End If

  pDatasetContainer.AddDataset pDataset

End Sub

 

你可能感兴趣的:(contain)