GPPointFileInfo\GPEnvironmentManager.vb
Creating a non-trival custom GP tool - inputs, outputs, and responding to environment settings
GPPointFileInfo\GPEnvironmentManager.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.Geodatabase

Namespace GPPointFileInfo
  Public Class GPEnvironmentManager
        Implements GPPointFileInfo.IGPEnvironmentManager
    Private _gpEnvironmentManager As ESRI.ArcGIS.Geoprocessing.IGPEnvironmentManager

    Public Sub New(ByVal gpEnvironmentManager As ESRI.ArcGIS.Geoprocessing.IGPEnvironmentManager)
      _gpEnvironmentManager = gpEnvironmentManager
    End Sub

        Public Function GetGPValue(ByVal environmentName As String) As IGPValue Implements IGPEnvironmentManager.GetGPValue
            Dim gpValue As IGPValue

            Dim gpEnvironment As ESRI.ArcGIS.Geoprocessing.IGPEnvironment = _gpEnvironmentManager.FindEnvironment(environmentName)

            gpValue = gpEnvironment.Value

            Return gpValue
        End Function
  End Class
End Namespace