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


C# XPathItem.Clone方法代码示例

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


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

示例1: Add

 public void Add(XPathItem item)
 {
     XQueryNavigator nav = item as XQueryNavigator;
     if (nav != null && nav.NodeType == XPathNodeType.Element)
     {
         if (current == null || current.document != nav.Document)
         {
             current = new ElementsSegment(nav.Document);
             segments.Add(current);
         }
         current.Add(nav.Position);
     }
     else
     {
         if (current == null || current.document != null)
         {
             current = new DataSegment();
             segments.Add(current);
         }
         current.Add(item.Clone());
     }
     count++;
 }
开发者ID:,项目名称:,代码行数:23,代码来源:

示例2: XQueryWrappedValue

 public XQueryWrappedValue(XPathItem inner, object[] annotation)
 {
     Inner = inner.Clone();
     Annotation = annotation;
 }
开发者ID:,项目名称:,代码行数:5,代码来源:

示例3: BeginMoveNext

 private Task<Object> BeginMoveNext(IContextProvider provider, object[] args, MemoryPool pool, XPathItem curr, Integer index)
 {
     object value;
     if (curr.IsNode)
         value = curr.Clone();
     else
         value = curr.TypedValue;
     if (m_varType != XQuerySequenceType.Item && m_convert)
     {
         if (m_varType.IsNode && !Core.InstanceOf(QueryContext.Engine, value, m_varType))
             throw new XQueryException(Properties.Resources.XPTY0004,
                new XQuerySequenceType(curr.XmlType.TypeCode), m_varType);
         value = XQueryConvert.TreatValueAs(value, m_varType);
         if (m_varType.Cardinality == XmlTypeCardinality.ZeroOrMore ||
             m_varType.Cardinality == XmlTypeCardinality.OneOrMore)
             value = XQueryNodeIterator.Create(value);
     }
     pool.SetData(m_value, value);
     if (m_pos != null)
         pool.SetData(m_posValue, index);
     if (m_conditionExpr == null ||
         Core.BooleanValue(QueryContext.Engine.Apply(null, null, ConditionExpr, args, m_conditionExpr, pool)))
     {
         MemoryPool taskPool = pool.Clone();
         return Task<Object>.Factory.StartNew(() =>
             {
                 object res = m_bodyExpr.Execute(provider, args, taskPool);
                 XQueryNodeIterator iter = res as XQueryNodeIterator;
                 if (iter != null)
                 {
                     BufferedNodeIterator resIter = new BufferedNodeIterator(iter, false);
                     resIter.Fill();
                     return resIter;
                 }
                 return res;
             }, QueryContext.Token);
     }
     return null;
 }
开发者ID:,项目名称:,代码行数:39,代码来源:


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