System.Xml.XmlDictionaryReader.IsStartArray C# (CSharp) Méthode

IsStartArray() public méthode

public IsStartArray ( System &type ) : bool
type System
Résultat bool
        public virtual bool IsStartArray(out System.Type type) { throw null; }
        public virtual bool IsStartElement(System.Xml.XmlDictionaryString localName, System.Xml.XmlDictionaryString namespaceUri) { throw null; }

Same methods

XmlDictionaryReader::IsStartArray ( Type &type ) : bool

Usage Example

Exemple #1
0
        public virtual void WriteNode(XmlDictionaryReader reader, bool defattr)
        {
            ArgumentNullException.ThrowIfNull(reader);

            int d = (reader.NodeType == XmlNodeType.None ? -1 : reader.Depth);

            do
            {
                XmlNodeType nodeType = reader.NodeType;
                Type?       type;
                if (nodeType == XmlNodeType.Text || nodeType == XmlNodeType.Whitespace || nodeType == XmlNodeType.SignificantWhitespace)
                {
                    // This will advance if necessary, so we don't need to call Read() explicitly
                    WriteTextNode(reader, false);
                }
                else if (reader.Depth > d && reader.IsStartArray(out type))
                {
                    WriteArrayNode(reader, type);
                }
                else
                {
                    // These will not advance, so we must call Read() explicitly
                    switch (nodeType)
                    {
                    case XmlNodeType.Element:
                        WriteElementNode(reader, defattr);
                        break;

                    case XmlNodeType.CDATA:
                        WriteCData(reader.Value);
                        break;

                    case XmlNodeType.EntityReference:
                        WriteEntityRef(reader.Name);
                        break;

                    case XmlNodeType.XmlDeclaration:
                    case XmlNodeType.ProcessingInstruction:
                        WriteProcessingInstruction(reader.Name, reader.Value);
                        break;

                    case XmlNodeType.DocumentType:
                        WriteDocType(reader.Name, reader.GetAttribute("PUBLIC"), reader.GetAttribute("SYSTEM"), reader.Value);
                        break;

                    case XmlNodeType.Comment:
                        WriteComment(reader.Value);
                        break;

                    case XmlNodeType.EndElement:
                        WriteFullEndElement();
                        break;
                    }
                    if (!reader.Read())
                    {
                        break;
                    }
                }
            }while (d < reader.Depth || (d == reader.Depth && reader.NodeType == XmlNodeType.EndElement));
        }
All Usage Examples Of System.Xml.XmlDictionaryReader::IsStartArray