private async Task<string> GetParcelTypeNameFromFeatureLayer(ParcelLayer myParcelFabricLayer, FeatureLayer featLayer, GeometryType geomType)
{
if (featLayer == null) //nothing to do, return empty string
return String.Empty;
IEnumerable<string> parcelTypeNames = await myParcelFabricLayer.GetParcelTypeNamesAsync();
foreach (string parcelTypeName in parcelTypeNames)
{
if (geomType == GeometryType.Polygon)
{
var polygonLyrParcelTypeEnum = await myParcelFabricLayer.GetParcelPolygonLayerByTypeNameAsync(parcelTypeName);
foreach (FeatureLayer lyr in polygonLyrParcelTypeEnum)
if (lyr == featLayer)
return parcelTypeName;
polygonLyrParcelTypeEnum = await myParcelFabricLayer.GetHistoricParcelPolygonLayerByTypeNameAsync(parcelTypeName);
foreach (FeatureLayer lyr in polygonLyrParcelTypeEnum)
if (lyr == featLayer)
return parcelTypeName;
}
if (geomType == GeometryType.Polyline)
{
var lineLyrParcelTypeEnum = await myParcelFabricLayer.GetParcelLineLayerByTypeNameAsync(parcelTypeName);
foreach (FeatureLayer lyr in lineLyrParcelTypeEnum)
if (lyr == featLayer)
return parcelTypeName;
lineLyrParcelTypeEnum = await myParcelFabricLayer.GetHistoricParcelLineLayerByTypeNameAsync(parcelTypeName);
foreach (FeatureLayer lyr in lineLyrParcelTypeEnum)
if (lyr == featLayer)
return parcelTypeName;
}
}
return String.Empty;
}