ServiceClientGenerator.GeneratorDriver.IsShapeReferred C# (CSharp) Method

IsShapeReferred() private static method

Checks if the shape is referred directly by another shape
private static IsShapeReferred ( string shapeName, ServiceModel serviceModel ) : bool
shapeName string Name of the shape to look for references of
serviceModel ServiceModel The ServiceModel containing information about the shapes of the service
return 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;
        }