GPPointFileInfo\ESConfigKeyword.vb
Creating a non-trival custom GP tool - inputs, outputs, and responding to environment settings
GPPointFileInfo\ESConfigKeyword.vb
' Copyright 2008 ESRI
' 
' All rights reserved under the copyright laws of the United States
' and applicable international laws, treaties, and conventions.
' 
' You may freely redistribute and use this sample code, with or
' without modification, provided you include the original copyright
' notice and use restrictions.
' 
' See use restrictions at <your ArcGIS install location>/developerkit/userestrictions.txt.
' 

Imports Microsoft.VisualBasic
Imports System
Imports ESRI.ArcGIS.Geoprocessing
Imports ESRI.ArcGIS.Geodatabase

Namespace GPPointFileInfo
  Public Class ESConfigKeyword
        Implements GPPointFileInfo.IESConfigKeyword
    Private Const _EnvironmentName As String = "configKeyword"
    Private _value As String

    Public Sub New(ByVal gpEnvironmentManager As IGPEnvironmentManager)
      Dim gpValue As IGPValue = gpEnvironmentManager.GetGPValue(_EnvironmentName)

      _value = GetValue(gpValue)
    End Sub

        Public ReadOnly Property Value() As String Implements IESConfigKeyword.Value
            Get
                Return _value
            End Get
        End Property

    Private Function GetValue(ByVal gpValue As IGPValue) As String
      Dim gpString As IGPString = TryCast(gpValue, IGPString)

      Return gpString.Value
    End Function
  End Class
End Namespace