IsControllerDatasetSupported Method
In This Topic
Gets a value indicating whether this Table supports the concept of controller datasets. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
Public Function IsControllerDatasetSupported() As Boolean
public bool IsControllerDatasetSupported()
Return Value
true if this table supports
controller datasets; otherwise,
false. Supporting controller datasets does not necessarily mean that a controller dataset exists, just that the
GetControllerDatasets method can be called without fear that it will throw an exception.
Example
Get parcel fabric from table
{
var parcelFabricDataset = await QueuedTask.Run(() =>
{
ParcelFabric myParcelFabricDataset = null;
if (table.IsControllerDatasetSupported())
{
// Tables can belong to multiple controller datasets, but at most one of them will be a parcel fabric
IReadOnlyList<Dataset> controllerDatasets = table.GetControllerDatasets();
foreach (Dataset controllerDataset in controllerDatasets)
{
if (controllerDataset is ParcelFabric)
{
myParcelFabricDataset = controllerDataset as ParcelFabric;
}
else
{
controllerDataset.Dispose();
}
}
}
return myParcelFabricDataset;
});
}
Get a Utility Network from a Table
{
static UtilityNetwork GetUtilityNetworkFromTable()
{
UtilityNetwork utilityNetwork = null;
Table table = MapView.Active.Map.GetStandaloneTablesAsFlattenedList().First().GetTable();
// This routine obtains a utility network from a table
if (table.IsControllerDatasetSupported())
{
// Tables can belong to multiple controller datasets, but at most one of them will be a UtilityNetwork
IReadOnlyList<Dataset> controllerDatasets = table.GetControllerDatasets();
foreach (Dataset controllerDataset in controllerDatasets)
{
if (controllerDataset is UtilityNetwork)
{
utilityNetwork = controllerDataset as UtilityNetwork;
}
else
{
controllerDataset.Dispose();
}
}
}
return utilityNetwork;
}
}
Get a Utility Network from a Layer
{
static UtilityNetwork GetUtilityNetworkFromLayer(Layer unLayer)
{
UtilityNetwork utilityNetwork = null;
Layer layer = MapView.Active.Map.GetLayersAsFlattenedList().First();
// This routine obtains a utility network from a FeatureLayer, SubtypeGroupLayer, or UtilityNetworkLayer
if (layer is UtilityNetworkLayer)
{
UtilityNetworkLayer utilityNetworkLayer = layer as UtilityNetworkLayer;
utilityNetwork = utilityNetworkLayer.GetUtilityNetwork();
}
else if (layer is SubtypeGroupLayer)
{
CompositeLayer compositeLayer = layer as CompositeLayer;
utilityNetwork = GetUtilityNetworkFromLayer(compositeLayer.Layers.First());
}
else if (layer is FeatureLayer)
{
FeatureLayer featureLayer = layer as FeatureLayer;
using (FeatureClass featureClass = featureLayer.GetFeatureClass())
{
if (featureClass.IsControllerDatasetSupported())
{
IReadOnlyList<Dataset> controllerDatasets = new List<Dataset>();
controllerDatasets = featureClass.GetControllerDatasets();
foreach (Dataset controllerDataset in controllerDatasets)
{
if (controllerDataset is UtilityNetwork)
{
utilityNetwork = controllerDataset as UtilityNetwork;
}
else
{
controllerDataset.Dispose();
}
}
}
}
}
return utilityNetwork;
}
}
Requirements
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)
ArcGIS Pro version: 3.0 or higher.
See Also