GPPointFileInfo\ParameterValueArray.vb
Creating a non-trival custom GP tool - inputs, outputs, and responding to environment settings
GPPointFileInfo\ParameterValueArray.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
Imports ESRI.ArcGIS.Geoprocessing

Namespace GPPointFileInfo
  Public Class ParameterValueArray
        Implements GPPointFileInfo.IParameterValueArray
        Private _gpUtilities As ESRI.ArcGIS.Geoprocessing.IGPUtilities
    Private _parameterValueArray As ESRI.ArcGIS.esriSystem.IArray

        Public Sub New(ByVal gpUtilities As ESRI.ArcGIS.Geoprocessing.IGPUtilities, ByVal parameterValueArray As ESRI.ArcGIS.esriSystem.IArray)
            _gpUtilities = gpUtilities
            _parameterValueArray = parameterValueArray
        End Sub

        Public Function GetGPValue(ByVal parameterIndex As Integer) As IGPValue Implements IParameterValueArray.GetGPValue
            Dim gpValue As IGPValue

            Dim gpParameter As IGPParameter = TryCast(_parameterValueArray.Element(parameterIndex), IGPParameter)

            gpValue = _gpUtilities.UnpackGPValue(gPParameter)

            Return gpValue
        End Function
  End Class
End Namespace