public async Task ObtainingGeodatabaseFromProjectItem()
{
IEnumerable<GDBProjectItem> gdbProjectItems = Project.Current.GetItems<GDBProjectItem>();
await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
foreach (GDBProjectItem gdbProjectItem in gdbProjectItems)
{
using (Datastore datastore = gdbProjectItem.GetDatastore())
{
//Unsupported datastores (non File GDB and non Enterprise GDB) will be of type UnknownDatastore
if (datastore is UnknownDatastore)
continue;
Geodatabase geodatabase = datastore as Geodatabase;
// Use the geodatabase.
}
}
});
}