Gets the Domain assigned to the Column for the specified subtype name.

Namespace:  ESRI.ArcGISExplorer.Data

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public Domain GetDomain(
	string subtypeName
)
Visual Basic (Declaration)
Public Function GetDomain ( _
	subtypeName As String _
) As Domain

Parameters

subtypeName
Type: System..::.String

The name of the subtype.

Return Value

A Domain object associated with the Column for the subtypeName. Returns nullNothingnullptra null reference (Nothing in Visual Basic) if the Column has not been assigned a domain.

Examples

The code below provides two examples of accessing the domain for a particular column subtype using the GetDomain methods.
CopyC#
//Open the "laterals" feature class which has been subtyped.
Table laterals = Table.OpenFileGeodatabaseTable(@"C:\Data\Montgomery.gdb", "laterals");

//Get the domain associated with the "Fire laterals" subtype for the "Material" column of the "laterals" feature class

//Example 1 - using the subtype name
Domain domain = laterals.Columns["MATERIAL"].GetDomain("Fire laterals");

if (domain.Type == DomainType.CodedValue)
{
  CodedValueDomain cvDom = domain as CodedValueDomain;

  SortedList<object,string> myList = cvDom.GetCodedValuePairs();




  ////Print out all the coded domain names
  //foreach (string item in cvDom.GetCodedValuePairs().Keys)
  //{
  //  System.Diagnostics.Debug.Print(item);
  //}
}

//Example 2 - using the subtype value
domain = laterals.Columns["MATERIAL"].GetDomain(2);

if (domain.Type == DomainType.CodedValue)
{
  CodedValueDomain cvDom = domain as CodedValueDomain;

  //Print out all the coded domain names
  foreach (string item in cvDom.GetCodedValuePairs().Keys)
  {
    System.Diagnostics.Debug.Print(item);
  }
}
CopyVB.NET
'Open the "laterals" feature class which has been subtyped.
Dim laterals As Table = Table.OpenFileGeodatabaseTable("C:\Data\Montgomery.gdb", "laterals")

'Get the domain associated with the "Fire laterals" subtype for the "Materials" column of the "laterals" feature class


'Example 1 - using the subtype name
Dim dom As Domain = laterals.Columns.Item("MATERIAL").GetDomain("Fire laterals")

If (dom.Type = DomainType.CodedValue) Then
  Dim cvDom As CodedValueDomain = DirectCast(dom, CodedValueDomain)

  'Print out all the coded domain names
  For Each item As String In cvDom.GetCodedValuePairs().Keys
    System.Diagnostics.Debug.Print(item)
  Next

End If


'Example 2 - using the subtype value
dom = laterals.Columns.Item("MATERIAL").GetDomain(2)

If (dom.Type = DomainType.CodedValue) Then
  Dim cvDom As CodedValueDomain = DirectCast(dom, CodedValueDomain)

  'Print out all the coded domain names
  For Each item As String In cvDom.GetCodedValuePairs().Keys
    System.Diagnostics.Debug.Print(item)
  Next
End If

See Also