/// <summary> /// Activate the form. /// </summary> /// <returns>Handle to the form</returns> public int Activate() { if (templateMode) { // In template mode, set the form values using the RasterFunctionVariables myBandIndicesVar = null; myForm.InputRaster = myRasterVar; myForm.BandIndices = (string)myBandIndicesVar.Value; } else { // Otherwise use the arguments object to update the form values. myForm.InputRaster = myArgs.Raster; myForm.BandIndices = myArgs.BandIndices; } myForm.UpdateUI(); myForm.Activate(); return(myForm.Handle.ToInt32()); }