private static IsShapeReferred ( string shapeName, |
||
shapeName | string | Name of the shape to look for references of |
serviceModel | The ServiceModel containing information about the shapes of the service | |
Résultat | bool |
private static bool IsShapeReferred(string shapeName, ServiceModel serviceModel)
{
foreach (var shape in serviceModel.Shapes)
{
if (shape.IsStructure)
{
foreach (var member in shape.Members)
{
if (member.Shape.Name == shapeName)
{
return true;
}
}
}
else if (shape.IsList && shape.ListShape.Name == shapeName)
{
return true;
}
else if (shape.IsMap &&
(shape.ValueShape.Name == shapeName || shape.KeyShape.Name == shapeName))
{
return true;
}
}
return false;
}