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


C# XamlReader.Skip方法代码示例

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

示例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");
		}
开发者ID:Core2D,项目名称:Portable.Xaml,代码行数:26,代码来源:XamlReaderTestBase.cs

示例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");
		}
开发者ID:Core2D,项目名称:Portable.Xaml,代码行数:9,代码来源:XamlReaderTestBase.cs


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