本文整理汇总了C#中TextReader.EatWS方法的典型用法代码示例。如果您正苦于以下问题:C# TextReader.EatWS方法的具体用法?C# TextReader.EatWS怎么用?C# TextReader.EatWS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextReader
的用法示例。
在下文中一共展示了TextReader.EatWS方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
/// <summary>
/// Parse an SGFCollection object from a TextReader.
/// </summary>
/// <param name="sr">The source TextReader.</param>
public void Read(TextReader sr)
{
sr.EatWS();
while ((char)sr.Peek() == '(')
{
var gameTree = new SGFGameTree();
gameTree.Read(sr);
GameTrees.Add(gameTree);
sr.EatWS();
}
}
示例2: Read
internal void Read(TextReader sr)
{
sr.EatWS();
while ((char)sr.Peek() == ';')
{
SGFNode node = new SGFNode();
node.Read(sr);
Nodes.Add(node);
sr.EatWS();
}
}
示例3: Read
internal void Read(TextReader sr)
{
char c = (char)sr.Read();
if (c != ';')
throw new InvalidDataException("Node doesn't begin with a ';'.");
sr.EatWS();
while (char.IsUpper((char)sr.Peek()))
{
SGFProperty prop = new SGFProperty();
prop.Read(sr);
Properties.Add(prop);
sr.EatWS();
}
}
示例4: Read
internal void Read(TextReader sr)
{
char c;
Name = "";
sr.EatWS();
while (char.IsUpper((char)sr.Peek()))
{
c = (char)sr.Read();
Name += c;
}
sr.EatWS();
while (sr.Peek() == '[')
{
ReadValue(sr);
sr.EatWS();
}
}
示例5: Read
internal void Read(TextReader sr)
{
char c = (char)sr.Read();
if (c != '(')
throw new InvalidDataException("Game-tree doesn't begin with a '('.");
Sequence.Read(sr);
sr.EatWS();
while ((char)sr.Peek() == '(')
{
SGFGameTree gameTree = new SGFGameTree();
gameTree.Read(sr);
GameTrees.Add(gameTree);
sr.EatWS();
}
c = (char)sr.Read();
if (c != ')')
throw new InvalidDataException("Game-tree doesn't end with a ')'.");
}