本文整理汇总了C#中System.Xaml.XamlObjectReader.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# XamlObjectReader.Skip方法的具体用法?C# XamlObjectReader.Skip怎么用?C# XamlObjectReader.Skip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xaml.XamlObjectReader
的用法示例。
在下文中一共展示了XamlObjectReader.Skip方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Skip3
public void Skip3 ()
{
var r = new XamlObjectReader (new ReadOnlyPropertyContainer () { Foo = "x" });
while (r.NodeType != XamlNodeType.StartMember)
r.Read ();
r.Skip ();
Assert.AreEqual (XamlNodeType.EndObject, r.NodeType, "#1");
}
示例2: Skip2
public void Skip2 ()
{
var r = new XamlObjectReader ("Foo");
r.Read (); // NamespaceDeclaration
r.Read (); // Type
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");
}
示例3: Read2
public void Read2 ()
{
var doc = new XmlDocument ();
doc.LoadXml ("<root xmlns='urn:foo'><elem attr='val' /></root>");
var r = new XamlObjectReader (doc);
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> ();
for (int i = 0; i < 5; i++) {
Assert.AreEqual (XamlNodeType.StartMember, r.NodeType, "#3-" + i);
l.Add (r.Member);
r.Skip ();
}
l.First (m => m.Name == "Value");
l.First (m => m.Name == "InnerXml");
l.First (m => m.Name == "Prefix");
l.First (m => m.Name == "PreserveWhitespace");
l.First (m => m.Name == "Schemas");
Assert.AreEqual (XamlNodeType.EndObject, r.NodeType, "#4");
Assert.IsFalse (r.Read (), "#5");
}
示例4: Skip
public void Skip ()
{
var r = new XamlObjectReader ("Foo");
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");
}