C# 클래스 Treefrog.Framework.XmlHelper

A collection of helper methods for parsing XML trees.
파일 보기 프로젝트 열기: jaquadro/Treefrog

공개 메소드들

메소드 설명
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