Interface ISubtypes

Namespace
ESRI.ArcGIS.Geodatabase
Assembly
ESRI.Server.Geodatabase.dll

Provides access to members that return and modify subtype information.

[Guid("AEF78514-848F-11D2-AABA-00C04FA37B82")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ISubtypes

Properties

DefaultSubtypeCode

The default subtype associated with the class.

int DefaultSubtypeCode { get; set; }

Property Value

int

Remarks

This property sets or returns the value of the default subtype code for the associated class.

DefaultValue[int, string]

The default value for the associated attribute.

object DefaultValue[int SubtypeCode, string FieldName] { get; set; }

Parameters

SubtypeCode int
FieldName string

Property Value

object

Remarks

This property return the default value for a particular field associated with a subtype. It requires the subtype code as a Long and the field name as a String . You can use the IField::Type property to determine the type of field that you are passing into the function so you will know what data type is being returned.

Domain[int, string]

The domain given the subtype and field.

IDomain Domain[int SubtypeCode, string FieldName] { get; set; }

Parameters

SubtypeCode int
FieldName string

Property Value

IDomain

Remarks

This property returns or sets an IDomain object associated with a particular subtype code and field. The subtype code is required as a Long and field name as a String.

HasSubtype

Indicates if the table has subtypes.

bool HasSubtype { get; }

Property Value

bool

Remarks

This property returns a boolean value indicating if the object class has subtypes defined. If there are no subtypes defined, it returns FALSE , if there are subypes defined it returns TRUE.

SubtypeFieldIndex

The subtype field index.

int SubtypeFieldIndex { get; }

Property Value

int

Remarks

This property returns the index of the field in the object class which stores the subtype codes. The field index is returned as a Long.

SubtypeFieldName

The subtype field name.

string SubtypeFieldName { get; set; }

Property Value

string

Remarks

The SubtypeFieldName property is used to either set or return string value for the field that contains the subtypes for this object class. To assign the subtype field, set SubtypeFieldName equal to the name of the field:

SubtypeName[int]

The subtype name.

string SubtypeName[int SubtypeCode] { get; }

Parameters

SubtypeCode int

Property Value

string

Remarks

This property returns the name of a subtype for a given subtype code for the associated object class. The subtype code is required as a Long and returns the name of the subtype as a String.

Subtypes

The subtypes associated with the class.

IEnumSubtype Subtypes { get; }

Property Value

IEnumSubtype

Remarks

Every ObjectClass has a default subtype code. If the user has not explicitly specified a default subtype or a subtype field, then DefaultSubtypeCode will return a subtype code of zero. Additionally, you can query the HasSubtype property; a value of False indicates an absence of a default subtype code, True indicates the presence of a default subtype code.

If the client instead asks for the enumeration of subtypes associated with an ObjectClass and no subtype has been previously added to the ObjectClass, then the enumerator will contain a single entry with a code of zero. The subtype field index value will be –1 if a default subtype has not been previously specified. Subtypes may only be short or long integers (esriFieldTypeSmallInteger or esriFieldTypeInteger). When setting the default subtype code, if one already exists, then it will be deleted. A subtype field must have been specified prior to setting the subtype code value.

Every type of field, except for esriFieldTypeShape, may have a default value. When setting the default value (which my be assigned on a subtype basis), it will be checked against the field’s associated Domain (if one exists) for validity.

This property returns all of the subtypes for the associated object class. Subtypes returns an IEnumSubtype enumeration which you can loop through to get all of the subtypes.

Methods

AddSubtype(int, string)

Adds the subtype to the set of associated subtypes.

void AddSubtype(int SubtypeCode, string SubtypeName)

Parameters

SubtypeCode int
SubtypeName string

Remarks

AddSubtype will create a new subtype for the associated object class. This method requires a subtype code as a Long and a subtype name as a String. Before adding subtypes, use the ISubtypes::SubtypeFieldName property to set the subtypes field.

Once created, you can use the ISubtypes::DefaultValue property to set default values for this subtypes fields, and the ISubtypes::Domain property to assign domains to fields for the subtype.

DeleteSubtype(int)

Deletes the subtype from the set of associated subtypes.

void DeleteSubtype(int SubtypeCode)

Parameters

SubtypeCode int

Remarks

DeleteSubtype will delete a subtype for the associated object class. Calling DeleteSubtype will also remove any reference to that subtype in the geodatabase.