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


C# XPathNodeIterator.Cast方法代码示例

本文整理汇总了C#中System.Xml.XPath.XPathNodeIterator.Cast方法的典型用法代码示例。如果您正苦于以下问题:C# XPathNodeIterator.Cast方法的具体用法?C# XPathNodeIterator.Cast怎么用?C# XPathNodeIterator.Cast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XPath.XPathNodeIterator的用法示例。


在下文中一共展示了XPathNodeIterator.Cast方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MonoImpInfo

			string MonoImpInfo(string assemblyname, string typename, string membername, XPathNodeIterator itr, bool strlong)
			{
				if (quiet)
					return string.Empty;
				
				var rgs = itr.Cast<XPathNavigator> ().Select (nav => nav.Value).ToList ();
			
				return MonoImpInfo (assemblyname, typename, membername, rgs, strlong);
			}
开发者ID:vernon016,项目名称:mono,代码行数:9,代码来源:Ecma2Html.cs

示例2: distinct_values

        protected XPathNavigator[] distinct_values(XPathNodeIterator iter)
        {
            // fn:distinct-values($arg as xs:anyAtomicType*) as xs:anyAtomicType*

             XPathNavigator[] nodes = iter.Cast<XPathNavigator>().ToArray();
             var distinct = new Dictionary<object, XPathNavigator>();

             foreach (object item in nodes.Select(n => n.TypedValue).Distinct()) {

            if (!distinct.ContainsKey(item)) {
               distinct.Add(item, nodes.First(n => n.TypedValue.Equals(item)));
            }
             }

             return distinct.Values.ToArray();
        }
开发者ID:skurdiukov,项目名称:myxsl,代码行数:16,代码来源:XPathFunctions.cs

示例3: subsequence

        public XPathNavigator[] subsequence(XPathNodeIterator sourceSeq, int startingLoc, int length)
        {
            // fn:subsequence($sourceSeq as item()*, $startingLoc as xs:double, $length as xs:double) as item()*

             return sourceSeq.Cast<XPathNavigator>().Skip(startingLoc).Take(length).ToArray();
        }
开发者ID:skurdiukov,项目名称:myxsl,代码行数:6,代码来源:XPathFunctions.cs

示例4: tail

        public XPathNavigator[] tail(XPathNodeIterator iter)
        {
            // fn:tail($arg as item()*) as item()*

             return iter.Cast<XPathNavigator>().Skip(1).ToArray();
        }
开发者ID:skurdiukov,项目名称:myxsl,代码行数:6,代码来源:XPathFunctions.cs

示例5: serialize

        public string serialize(XPathNodeIterator arg, XPathNodeIterator parameters)
        {
            // fn:serialize($arg	as item()*, $params as element(output:serialization-parameters)?) as xs:string

             var itemFactory = new SystemItemFactory();

             XPathSerializationOptions options = null;

             if (parameters != null
            && parameters.Count == 1) {

            options = new XPathSerializationOptions();
            ((IXmlSerializable)options).ReadXml(parameters.Cast<XPathNavigator>().First().ReadSubtree());
             }

             using (var writer = new StringWriter()) {

            IEnumerable<XPathItem> items = arg.Cast<XPathItem>();

            if (options == null) {
               itemFactory.Serialize(items, writer);
            } else {
               itemFactory.Serialize(items, writer, options);
            }

            return writer.ToString();
             }
        }
开发者ID:skurdiukov,项目名称:myxsl,代码行数:28,代码来源:XPathFunctions.cs


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