Public Property SubtypeFieldDescription As SubtypeFieldDescription
public SubtypeFieldDescription SubtypeFieldDescription {get; set;}
Public Property SubtypeFieldDescription As SubtypeFieldDescription
public SubtypeFieldDescription SubtypeFieldDescription {get; set;}
| Exception | Description |
|---|---|
| System.ArgumentException | The SubtypeFieldDescription does not exist in the TableDescription's list of FieldDescription objects. |
{
// Must be called within QueuedTask.Run
void DeleteSubtypeField(SchemaBuilder schemaBuilder, FeatureClassDefinition featureClassDefinition)
{
FeatureClassDescription featureClassDescription = new FeatureClassDescription(featureClassDefinition);
// Set subtype field to null to remove the subtype field designation
featureClassDescription.SubtypeFieldDescription = null;
schemaBuilder.Modify(featureClassDescription);
schemaBuilder.Build();
}
}
{
// Must be called within QueuedTask.Run
void ModifySubtypes(SchemaBuilder schemaBuilder, TableDefinition tableDefinition)
{
TableDescription tableDescription = new TableDescription(tableDefinition);
// Remove the first subtype from the table
IReadOnlyList<Subtype> subtypes = tableDefinition.GetSubtypes();
tableDescription.SubtypeFieldDescription.Subtypes.Remove(subtypes.First().GetCode());
// Adding a new subtype, 'Utility', in the existing table
tableDescription.SubtypeFieldDescription.Subtypes.Add(4, "Utility");
// Assigning 'Utility' subtype as the default subtype
tableDescription.SubtypeFieldDescription.DefaultSubtypeCode = 4;
schemaBuilder.Modify(tableDescription);
schemaBuilder.Build();
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)