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

using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geoprocessing;

namespace GPPointFileInfo
{
    public class ParameterValueArray : GPPointFileInfo.IParameterValueArray
    {
        private ESRI.ArcGIS.Geoprocessing.IGPUtilities _gpUtilities;
        private ESRI.ArcGIS.esriSystem.IArray _parameterValueArray;

        public ParameterValueArray(ESRI.ArcGIS.Geoprocessing.IGPUtilities gpUtilities, ESRI.ArcGIS.esriSystem.IArray parameterValueArray)
        {
            _gpUtilities = gpUtilities;
            _parameterValueArray = parameterValueArray;
        }

        public IGPValue GetGPValue(int parameterIndex)
        {
            IGPValue gpValue;

            IGPParameter gpParameter = _parameterValueArray.get_Element(parameterIndex) as IGPParameter;

            gpValue = _gpUtilities.UnpackGPValue(gpParameter);

            return gpValue;
        }
    }
}