This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > NetworkAnalyst > ESRI.ArcGIS.NetworkAnalyst > Interfaces > IN > INAClassDefinitionEdit Interface > INAClassDefinitionEdit.CandidateFieldNames Property (ArcObjects .NET 10.4 SDK) |
The field names that will be used by default for the network analyst class.
[Visual Basic .NET] Public Sub set_CandidateFieldNames ( _ ByVal FieldName As String, _ ByVal A_2 As IStringArray _ )
[C#] public void set_CandidateFieldNames ( string FieldName, IStringArray A_2 );
[C++]
HRESULT putref_CandidateFieldNames(
BSTR FieldName,
IStringArray*
);
[C++]
Parameters FieldName [in] FieldName is a parameter of type BSTR [in]
is a parameter of type IStringArray
CandidateFieldNames returns an IStringArray that contains an array of field names that are used to provide hints to the NAClassFieldMap for how to map input fields to fields on the NAClass.
This property is OK to be set at any time.
This example illustrates how to add candidate fields to the "Incidents" NAClassDefinition that can then be automatically mapped when loading network locations.
// Get the NAClass for "Incidents"
INAClass incidentsNAClass=naLayer.Context.NAClasses.get_ItemByName("Incidents") as INAClass;
// Get the current Candidate Fields and add a couple more values
IStringArray candidateFields=incidentsNAClass.ClassDefinition.get_CandidateFieldNames("Name");
candidateFields.Add("RestaurantName");
candidateFields.Add("Restaurant");
// Set the class to have the new candidate fields
INAClassDefinitionEdit naClassDefinitionEdit=incidentsNAClass.ClassDefinition as INAClassDefinitionEdit;
naClassDefinitionEdit.set_CandidateFieldNames("Name", candidateFields);
This example illustrates how to add candidate fields to the "Incidents" NAClassDefinition that can then be automatically mapped when loading network locations.
' Get the NAClass for "Incidents"
Dim incidentsNAClass As INAClass=naLayer.Context.NAClasses.ItemByName("Incidents")
' Get the current Candidate Fields and add a couple more values
Dim candidateFields As IStringArray=incidentsNAClass.ClassDefinition.CandidateFieldNames("Name")
candidateFields.Add("RestaurantName")
candidateFields.Add("Restaurant")
' Set the class to have the new candidate fields
Dim naClassDefinitionEdit As INAClassDefinitionEdit=incidentsNAClass.ClassDefinition
naClassDefinitionEdit.CandidateFieldNames("Name")=candidateFields