This document is archived and information here might be outdated.  Recommended version.


ILayerFactoryHelper.CreateLayersFromName Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Carto > ESRI.ArcGIS.Carto > Interfaces > IL > ILayerFactoryHelper Interface > ILayerFactoryHelper.CreateLayersFromName Method
ArcGIS Developer Help

ILayerFactoryHelper.CreateLayersFromName Method

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*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

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.

Remarks

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.

See Also

ILayerFactoryHelper Interface