ICodedValueDomain Interface

Provides access to members that return and modify coded value domain values.

Description

The ICodedValueDomaininterface****is used to define new coded value domains and to get information about existing domains.

When To Use

ICodedValueDomain is the interface on a CodedValueDomain object used to get and set the properties of a coded value domain object. For example, use the ICodedValueDomain interface when creating a new CodedValueDomain to add and remove valid coded values.

Members

Name Description
Method AddCode Adds a (value, name) code.
Read-only property CodeCount The number of codes for the associated attribute.
Method DeleteCode Deletes a code with the specified value.
Read-only property Name The code name for the specified code index.
Read-only property Value The value for the specified code index.

ICodedValueDomain.AddCode Method

Adds a (value, name) code.

Public Sub AddCode ( _
    ByVal Value As Object, _
    ByVal Name As String _
)
public void AddCode (
    object Value,
    string Name
);

Description

The AddCodemethod adds a code to the domain.

Remarks

The AddCodemethod adds a new coded value to the coded value domain. AddCode requires a value for the coded value as a Variant, and the name of the coded value, which is a user friendly description for that coded value, as a String. The value supplied for the variant parameter must be of the correct type for the domain (e.g., Numeric values for a numeric domain, string values for a string domain).

If AddCode is called on a domain that is already created, the IWorkspaceDomains2::AlterDomain method must be called to persist the change.

ICodedValueDomain.CodeCount Property

The number of codes for the associated attribute.

Public ReadOnly Property CodeCount As Integer
public int CodeCount {get;}

Description

The CodeCountproperty returns the number of codes in this coded value domain.

ICodedValueDomain.DeleteCode Method

Deletes a code with the specified value.

Public Sub DeleteCode ( _
    ByVal Value As Object _
)
public void DeleteCode (
    object Value
);

Description

DeleteCodefunction removes the coded value from this domain. The parameter represents the value of the coded value to be removed, not the description.

Remarks

If DeleteCode is called on a domain that is already created, the IWorkspaceDomains2::AlterDomain method must be called to persist the change.

ICodedValueDomain.Name Property

The code name for the specified code index.

Public Function get_Name ( _
    ByVal Index As Integer _
) As String
public string get_Name (
    int Index
);

Description

Name returns the name associated with a given coded value belonging to this domain by the index parameter passed in. The return value is a string type.

Remarks

This property returns the name of valid coded value for the ith coded value in the coded value domain, where i is the index of the coded value as a Long . The name is returned as a String .

ICodedValueDomain.Value Property

The value for the specified code index.

Public Function get_Value ( _
    ByVal Index As Integer _
) As Object
public object get_Value (
    int Index
);

Remarks

This property returns the coded value for the specified position in the coded value domain. The type of object returned depends on the type of field associated with the domain; for example, if the domain applies to Text fields, the value returned will be a string. The IDomain.FieldType property can be used to determine the type of field associated with a domain.

Classes that implement ICodedValueDomain

Classes Description
CodedValueDomain Esri Attribute set constraint object.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.