void layer_DataSourceNeeded(object sender, RasterDataSourceEventArgs e) { RasterLayer raster = (RasterLayer)(sender); e.Provider = new GDALRasterProvider(raster.DataProviderParameters["file_name"]); }
void layer_DataSourceReadyToRelease(object sender, RasterDataSourceEventArgs e) { ((IDisposable) e.Provider).Dispose(); }