public SortedList<object,string> CodedValuePairs {get;}
Public ReadOnly Property CodedValuePairs As SortedList(Of Object,String)
public SortedList<object,string> CodedValuePairs {get;}
Public ReadOnly Property CodedValuePairs As SortedList(Of Object,String)
{
Task ModifyDomainAsync(Geodatabase geodatabase, string codedValueDomainName = "Pipe") => QueuedTask.Run(() =>
{
SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);
CodedValueDomain codedValueDomain = geodatabase.GetDomains().First(f => f.GetName().Equals(codedValueDomainName)) as CodedValueDomain;
CodedValueDomainDescription codedValueDomainDescription = new CodedValueDomainDescription(codedValueDomain);
// Update domain description
codedValueDomainDescription.Description = "Water Pipe Domain";
// Adding code/value pair
codedValueDomainDescription.CodedValuePairs.Add("C", "Copper");
schemaBuilder.Modify(codedValueDomainDescription);
// To modify the orders of coded value domain
// schemaBuilder.Modify(codedValueDomainDescription,SortBy.Name,SortOrder.Ascending);
schemaBuilder.Build();
});
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)