C# Класс Treefrog.Framework.XmlHelper

A collection of helper methods for parsing XML trees.
Показать файл Открыть проект

Открытые методы

Метод Описание
CheckAttributes ( XmlReader reader, List reqAttribs ) : string>.Dictionary

Returns a key/value set of all attributes in the element, and checks that an instance of each required key exists in the set.

SwitchAll ( XmlReader reader, string>.Action action ) : void

Read all top-level elements in a sub-tree, invoking an action on each element.

This helper method automatically advances to the next element after executing an element. If the action itself advances the reader, use SwitchAllAdvance instead.

SwitchAllAdvance ( XmlReader reader, Func func ) : void

Read all top-level elements in a sub-tree, invoking an action on each element and conditionally advancing to the next element.

If the action method returns true, this helper method will advance the reader to the next element. Otherwise, it will resume parsing from the reader without automatically advancing.

Описание методов

CheckAttributes() публичный статический Метод

Returns a key/value set of all attributes in the element, and checks that an instance of each required key exists in the set.
public static CheckAttributes ( XmlReader reader, List reqAttribs ) : string>.Dictionary
reader System.Xml.XmlReader An pointing to the element to fetch attributes from.
reqAttribs List A list of all attributes which are required to be present in the element.
Результат string>.Dictionary

SwitchAll() публичный статический Метод

Read all top-level elements in a sub-tree, invoking an action on each element.
This helper method automatically advances to the next element after executing an element. If the action itself advances the reader, use SwitchAllAdvance instead.
public static SwitchAll ( XmlReader reader, string>.Action action ) : void
reader System.Xml.XmlReader The to parse from.
action string>.Action A no-return function that takes an and element name as parameters.
Результат void

SwitchAllAdvance() публичный статический Метод

Read all top-level elements in a sub-tree, invoking an action on each element and conditionally advancing to the next element.
If the action method returns true, this helper method will advance the reader to the next element. Otherwise, it will resume parsing from the reader without automatically advancing.
public static SwitchAllAdvance ( XmlReader reader, Func func ) : void
reader System.Xml.XmlReader The to parse from.
func Func A function that takes an and element name as parameters, and returns a value indicating whether to advance to the next element.
Результат void