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


INALayer2.AttachContext Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (NetworkAnalyst)  

INALayer2.AttachContext Method

Sets the NALayer to reference the NAContext and the sublayers to reference the NAClasses of the NAContext.

[Visual Basic .NET]
Public Sub AttachContext ( _
    ByVal NAContext As INAContext _
)
[C#]
public void AttachContext (
    INAContext NAContext
);
[C++]
HRESULT AttachContext(
  INAContext* NAContext
);
[C++]

Parameters NAContext [in]
NAContext is a parameter of type INAContext

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Network Analyst Extension.

Remarks

AttachContext sets the NALayer's NAContext to be the input context and reconnects the NALayer's sublayers to the context. 

You must first call INAContextEdit.Bind on the NAContext prior to passing it in to AttachContext.

This method should only be used with NAContext objects created via INALayer2.CopyContext.  It should also only be used within Server or Engine applications, using these functions within ArcMap will lead to unexpected behavior within the Network Analyst tools.

See Also

INALayer2 Interface