This document is archived and information here might be outdated. Recommended version. |
Given a name attempts to open it using the layer factories, if successful returns a layers enumerator.
[Visual Basic .NET] Public Function CreateLayersFromName ( _ ByVal Name As IName _ ) As IEnumLayer
[C#] public IEnumLayer CreateLayersFromName ( IName Name );
[C++]
HRESULT CreateLayersFromName(
IName* Name
);
[C++] Parameters Name [in]
Name is a parameter of type IName*
Use this method to create a data Layer or Layers from an IName object. Each IName instance is passed to CreateLayersFromName to return an enumerator of layers containing a new instance of each layer.
This is typically used for drag and drop. For example, if a feature layer is dragged from an ArcCatalog application and dropped onto the MapControl or PageLayoutControl, objects implementing IName can be extracted from the drop using the IName DataObjectHelper.
The CreateLayersFromName method is of limited use to ArcGIS Engine and ArcGIS for Server developers because there is only a small subset of layer factories present and registered in the 'Layer Factory' component category. The CreateLayersFromName method internally iterates the objects in the "Layer Factory" component category and uses the ILayerFactory::CanCreate and ILayerFactory::Create methods.