CustomFunction.NDVICustomFunctionArguments.ResolveRasterVal C# (CSharp) Method

ResolveRasterVal() private method

Resolve the 'Raster' variable if it contains field names with the corresponding values.
private ResolveRasterVal ( IRow pRow ) : void
pRow IRow The row corresponding to the function raster dataset.
return void
        private void ResolveRasterVal(IRow pRow)
        {
            try
            {
                // Get the Raster property.
                object myRasterObject = myProperties.GetProperty("Raster");
                // Check to see if it is a variable
                if (myRasterObject is IRasterFunctionVariable)
                {
                    IRasterFunctionVariable rasterVar = ((IRasterFunctionVariable)myRasterObject);
                    object rasterVal = FindPropertyInRow(rasterVar, pRow);
                    if (rasterVal != null && rasterVal is string)
                    {
                        string datasetPath = (string)rasterVal;
                        rasterVar.Value = OpenRasterDataset(datasetPath);
                    }
                }
            }
            catch (Exception exc)
            {
                System.Exception myExc = new System.Exception(
                    "Exception caught in ResolveRasterVal: " + exc.Message, exc);
                throw myExc;
            }
        }