本文整理汇总了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++;
}
示例2: XQueryWrappedValue
public XQueryWrappedValue(XPathItem inner, object[] annotation)
{
Inner = inner.Clone();
Annotation = annotation;
}
示例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;
}