本文整理汇总了C#中XamlReader.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# XamlReader.Skip方法的具体用法?C# XamlReader.Skip怎么用?C# XamlReader.Skip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XamlReader
的用法示例。
在下文中一共展示了XamlReader.Skip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Skip2
protected void Skip2 (XamlReader r)
{
r.Read (); // NamespaceDeclaration
r.Read (); // Type
if (r is XamlXmlReader)
ReadBase (r);
r.Read (); // Member (Initialization)
Assert.AreEqual (XamlNodeType.StartMember, r.NodeType, "#1");
r.Skip ();
Assert.AreEqual (XamlNodeType.EndObject, r.NodeType, "#2");
r.Skip ();
Assert.IsTrue (r.IsEof, "#3");
}
示例2: Read_XmlDocument
protected void Read_XmlDocument (XamlReader r)
{
for (int i = 0; i < 3; i++) {
r.Read ();
Assert.AreEqual (XamlNodeType.NamespaceDeclaration, r.NodeType, "#1-" + i);
}
r.Read ();
Assert.AreEqual (new XamlType (typeof (XmlDocument), r.SchemaContext), r.Type, "#2");
r.Read ();
var l = new List<XamlMember> ();
while (r.NodeType == XamlNodeType.StartMember) {
// It depends on XmlDocument's implenentation details. It fails on mono only because XmlDocument.SchemaInfo overrides both getter and setter.
//for (int i = 0; i < 5; i++) {
// Assert.AreEqual (XamlNodeType.StartMember, r.NodeType, "#3-" + i);
l.Add (r.Member);
r.Skip ();
}
Assert.IsNotNull (l.FirstOrDefault (m => m.Name == "Value"), "#4-1");
Assert.IsNotNull (l.FirstOrDefault (m => m.Name == "InnerXml"), "#4-2");
Assert.IsNotNull (l.FirstOrDefault (m => m.Name == "Prefix"), "#4-3");
Assert.IsNotNull (l.FirstOrDefault (m => m.Name == "PreserveWhitespace"), "#4-4");
Assert.IsNotNull (l.FirstOrDefault (m => m.Name == "Schemas"), "#4-5");
Assert.AreEqual (XamlNodeType.EndObject, r.NodeType, "#5");
Assert.IsFalse (r.Read (), "#6");
}
示例3: Skip
protected void Skip (XamlReader r)
{
r.Skip ();
Assert.AreEqual (XamlNodeType.NamespaceDeclaration, r.NodeType, "#1");
r.Skip ();
Assert.AreEqual (XamlNodeType.StartObject, r.NodeType, "#2");
r.Skip ();
Assert.IsTrue (r.IsEof, "#3");
}