GetName Method (Definition)
Gets the name of the definition.
This method must be called on the MCT. Use QueuedTask.Run.
Public Function GetName() As String
Return Value
The name of the definition.
Obtaining List of Definitions from Geodatabase
public async Task ObtainingDefinitionsFromGeodatabase()
{
await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde"))))
{
IReadOnlyList<FeatureClassDefinition> enterpriseDefinitions = geodatabase.GetDefinitions<FeatureClassDefinition>();
IEnumerable<Definition> featureClassesHavingGlobalID = enterpriseDefinitions.Where(definition => definition.HasGlobalID());
IReadOnlyList<FeatureDatasetDefinition> featureDatasetDefinitions = geodatabase.GetDefinitions<FeatureDatasetDefinition>();
bool electionRelatedFeatureDatasets = featureDatasetDefinitions.Any(definition => definition.GetName().Contains("Election"));
IReadOnlyList<AttributedRelationshipClassDefinition> attributedRelationshipClassDefinitions = geodatabase.GetDefinitions<AttributedRelationshipClassDefinition>();
IReadOnlyList<RelationshipClassDefinition> relationshipClassDefinitions = geodatabase.GetDefinitions<RelationshipClassDefinition>();
}
});
}
Access the bands in a raster dataset
var count = rasterDataset.GetBandCount();
RasterBand rasterBandByName = rasterDataset.GetBandByName(sBandName);
var index = rasterDataset.GetBandIndex(sBandName);
// Get a RasterBand from the raster dataset
RasterBand rasterBand = rasterDataset.GetBand(0);
// Get the RasterBandDefinition from the raster band.
RasterBandDefinition rasterBandDefinition = rasterBand.GetDefinition();
// Get the name of the raster band from the raster band.
string bandName = rasterBandDefinition.GetName();
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.