当前位置: 首页>>代码示例>>C#>>正文


C# XamlObjectReader.Skip方法代码示例

本文整理汇总了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");
		}
开发者ID:kumpera,项目名称:mono,代码行数:8,代码来源:XamlObjectReaderTest.cs

示例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");
		}
开发者ID:jdecuyper,项目名称:mono,代码行数:12,代码来源:XamlObjectReaderTest.cs

示例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");
		}
开发者ID:jdecuyper,项目名称:mono,代码行数:28,代码来源:XamlObjectReaderTest.cs

示例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");
		}
开发者ID:jdecuyper,项目名称:mono,代码行数:10,代码来源:XamlObjectReaderTest.cs


注:本文中的System.Xaml.XamlObjectReader.Skip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。