ArcGIS Explorer Component Help |
CodedValueDomain..::.GetValue Method |
CodedValueDomain Class Example See Also |
Gets the value in the Domain for the specified name.
Namespace:
ESRI.ArcGISExplorer.DataAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public Object GetValue( string name ) |
Visual Basic (Declaration) |
---|
Public Function GetValue ( _ name As String _ ) As Object |
Parameters
- name
- Type: System..::.String
The name which is used to lookup the domain value.
Return Value
The value in the Domain which is paired with the name. If an invalid name is specified, -1 will be returned.Examples
The code below finds a domain in a file geodatabase and looks up the value associated with a specific name using the
GetValue method.
CopyC#
{ Geodatabase gdb = new Geodatabase(@"C:\Data\Montgomery.gdb"); //Find the "ZoningCodes" domain in the "Montgomery" file geodatabase CodedValueDomain domain = gdb.GetDomains().FindDomainByName("ZoningCodes") as CodedValueDomain; //Look up the coded name for a "FH" value System.Diagnostics.Debug.Print(domain.GetCodedName("FH")); //Prints "Flood Hazard Area" //Look up the value for the "Residential" name System.Diagnostics.Debug.Print(domain.GetValue("Residential").ToString()); //Prints "R" }
CopyVB.NET
Dim gdb As Geodatabase = New Geodatabase("C:\Data\Montgomery.gdb") 'Find the "ZoningCodes" domain in the "Montgomery" file geodatabase Dim dom As CodedValueDomain = DirectCast(gdb.GetDomains().FindDomainByName("ZoningCodes"), CodedValueDomain) 'Look up the coded name for a "FH" value System.Diagnostics.Debug.Print(dom.GetCodedName("FH")) 'Prints "Flood Hazard Area" 'Look up the value for the "Residential" name System.Diagnostics.Debug.Print(dom.GetValue("Residential").ToString()) 'Prints "R"