GetContingentValues Method (Table)
Gets the possible contingent values for the given field name based on the values of the row buffer.
Get possible contingent values
public void GetPossibleContingentValues(FeatureClass parcels, string zoningFieldName = "Zone")
{
using (RowBuffer rowBuffer = parcels.CreateRowBuffer())
{
IReadOnlyDictionary<FieldGroup, IReadOnlyList<ContingentValue>> possibleZonings = parcels.GetContingentValues(rowBuffer, zoningFieldName);
IEnumerable<FieldGroup> possibleFieldGroups = possibleZonings.Keys;
foreach (FieldGroup possibleFieldGroup in possibleFieldGroups)
{
IReadOnlyList<ContingentValue> possibleZoningValues = possibleZonings[possibleFieldGroup];
foreach (ContingentValue possibleZoningValue in possibleZoningValues)
{
switch (possibleZoningValue)
{
case ContingentCodedValue codedValue:
string codedValueDomainName = codedValue.Name;
object codedValueDomainValue = codedValue.CodedValue;
break;
case ContingentRangeValue rangeValue:
object rangeDomainMaxValue = rangeValue.Max;
object rangeDomainMinValue = rangeValue.Min;
break;
case ContingentAnyValue contingentAnyValue:
// Any value type
break;
case ContingentNullValue contingentNullValue:
// Null value
break;
}
}
}
}
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3.4 or higher.