ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data Namespace / Contingency Class / GetContingentValues Method
Example Version

GetContingentValues Method (Contingency)
Syntax

Return Value

Example
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;
                }
            }
        }
    }
}
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3.4 or higher.
See Also