ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Data Namespace / ContingentNullValue Class
Members Example

In This Topic
    ContingentNullValue Class
    In This Topic
    Represents that a null value is allowed in a Contingency.
    Syntax
    public sealed class ContingentNullValue : ContingentValue 
    Public NotInheritable Class ContingentNullValue 
       Inherits ContingentValue
    Example
    Explore cotingent attribute values
    public void ExploreContingentValues(Table table)
    {
        using (TableDefinition tableDefinition = table.GetDefinition())
        {
            IReadOnlyList<Contingency> contingencies = tableDefinition.GetContingencies();
            foreach (Contingency contingency in contingencies)
            {
                // Field group 
                FieldGroup filedGroup = contingency.FieldGroup;
                string fieldGroupName = filedGroup.Name;
                IReadOnlyList<string> fieldInFieldGroup = filedGroup.FieldNames;
                bool isEditRestriction = filedGroup.IsRestrictive;
    
                int contingencyId = contingency.ID;
                Subtype subtype = contingency.Subtype;
                bool isContingencyRetired = contingency.IsRetired;
    
                // Contingent values 
                IReadOnlyDictionary<string, ContingentValue> contingentValuesByFieldName = contingency.GetContingentValues();
                foreach (KeyValuePair<string, ContingentValue> contingentValueKeyValuePair in contingentValuesByFieldName)
                {
                    string attributeFieldName = contingentValueKeyValuePair.Key;
    
                    // Contingent value type associated with the attribute field
                    ContingentValue contingentValue = contingentValueKeyValuePair.Value;
    
                    switch (contingentValue)
                    {
                        case ContingentCodedValue contingentCodedValue:
                            string codedValueDomainName = contingentCodedValue.Name;
                            object codedValueDomainValue = contingentCodedValue.CodedValue;
                            break;
                        case ContingentRangeValue contingentRangeValue:
                            object rangeDomainMaxValue = contingentRangeValue.Max;
                            object rangeDomainMinValue = contingentRangeValue.Min;
                            break;
                        case ContingentAnyValue contingentAnyValue:
                            // Any value type
                            break;
                        case ContingentNullValue contingentNullValue:
                            // Null value
                            break;
                    }
                }
            }
        }
    }
    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;
                    }
                }
            }
        }
    }
    
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.Data.ContingentValue
          ArcGIS.Core.Data.ContingentNullValue

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.4 or higher.
    See Also