This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > NetworkAnalyst > ESRI.ArcGIS.NetworkAnalyst > Interfaces > IN > INALayer2 Interface > INALayer2.AttachContext Method (ArcObjects .NET 10.5 SDK) |
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
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.