System.Xml.Schema.XmlSchemaValidator.PrintNamesWithNS C# (CSharp) Méthode

PrintNamesWithNS() private static méthode

private static PrintNamesWithNS ( ArrayList expected, StringBuilder builder ) : void
expected System.Collections.ArrayList
builder StringBuilder
Résultat void
        private static void PrintNamesWithNS(ArrayList expected, StringBuilder builder)
        {
            XmlQualifiedName name = null;
            name = expected[0] as XmlQualifiedName;
            if (expected.Count == 1)
            { //In case of one element in a namespace or any
                if (name.Name == "*")
                { //Any
                    EnumerateAny(builder, name.Namespace);
                }
                else
                {
                    if (name.Namespace.Length != 0)
                    {
                        builder.Append(SR.Format(SR.Sch_ElementNameAndNamespace, name.Name, name.Namespace));
                    }
                    else
                    {
                        builder.Append(SR.Format(SR.Sch_ElementName, name.Name));
                    }
                }
            }
            else
            {
                bool foundAny = false;
                bool first = true;
                StringBuilder subBuilder = new StringBuilder();
                for (int i = 0; i < expected.Count; i++)
                {
                    name = expected[i] as XmlQualifiedName;
                    if (name.Name == "*")
                    { //rare case where ns of element and that of Any match
                        foundAny = true;
                        continue;
                    }
                    if (first)
                    {
                        first = false;
                    }
                    else
                    {
                        subBuilder.Append(", ");
                    }
                    subBuilder.Append(name.Name);
                }
                if (foundAny)
                {
                    subBuilder.Append(", ");
                    subBuilder.Append(SR.Sch_AnyElement);
                }
                else
                {
                    if (name.Namespace.Length != 0)
                    {
                        builder.Append(SR.Format(SR.Sch_ElementNameAndNamespace, subBuilder.ToString(), name.Namespace));
                    }
                    else
                    {
                        builder.Append(SR.Format(SR.Sch_ElementName, subBuilder.ToString()));
                    }
                }
            }
        }