本文整理汇总了C#中XPathResultType类的典型用法代码示例。如果您正苦于以下问题:C# XPathResultType类的具体用法?C# XPathResultType怎么用?C# XPathResultType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XPathResultType类属于命名空间,在下文中一共展示了XPathResultType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XPathResult
internal XPathResult(XPathNodeIterator nodeSetResult)
: this()
{
this.nodeSetResult = nodeSetResult;
this.internalIterator = nodeSetResult as SafeNodeSequenceIterator;
this.resultType = XPathResultType.NodeSet;
}
示例2: ResolveFunction
public override IXsltContextFunction ResolveFunction(string prefix, string name, XPathResultType[] argTypes)
{
if (string.IsNullOrEmpty(prefix))
return base.ResolveFunction(prefix, name, argTypes);
return mvpContext.ResolveFunction(prefix, name, argTypes);
}
示例3: SetXsltContext
public override void SetXsltContext(XsltContext context)
{
if (context == null)
{
throw XPathException.Create(SR.Xp_NoContext);
}
if (this.xsltContext != context)
{
xsltContext = context;
foreach (Query argument in _args)
{
argument.SetXsltContext(context);
}
XPathResultType[] argTypes = new XPathResultType[_args.Count];
for (int i = 0; i < _args.Count; i++)
{
argTypes[i] = _args[i].StaticType;
}
_function = xsltContext.ResolveFunction(prefix, name, argTypes);
// KB article allows to return null, see http://support.microsoft.com/?kbid=324462#6
if (_function == null)
{
throw XPathException.Create(SR.Xp_UndefFunc, QName);
}
}
}
示例4: CheckNodeSet
private void CheckNodeSet(XPathResultType t)
{
if ((t != XPathResultType.NodeSet) && (t != XPathResultType.Any))
{
throw XPathException.Create("Xp_NodeSetExpected", this.scanner.SourceText);
}
}
示例5: TriflesXPathExtensionFunction
/// <summary>
/// Creates a new extension function definition.
/// </summary>
/// <param name="name"></param>
/// <param name="minArgs"></param>
/// <param name="maxArgs"></param>
/// <param name="argTypes"></param>
/// <param name="returnType"></param>
/// <param name="fn"></param>
public TriflesXPathExtensionFunction(XName name, int minArgs, int maxArgs, XPathResultType[] argTypes, XPathResultType returnType, TriflesXPathInvokable fn)
{
FunctionName = Checker.NotNull(name, "name");
Minargs = minArgs;
Maxargs = maxArgs;
if (Minargs < 0)
{
throw new ArgumentOutOfRangeException("minArgs");
}
else if (Maxargs < Minargs)
{
throw new ArgumentOutOfRangeException("maxArgs", "maxArgs cannot be less than minArgs");
}
if (argTypes == null)
{
argTypes = new XPathResultType[0];
}
this.argTypes = argTypes.ToImmutableArray();
ReturnType = Checker.NotNull(returnType, "returnType");
invokable = Checker.NotNull(fn, "fn");
}
示例6: ResolveFunction
public override IXsltContextFunction ResolveFunction(string prefix, string name, XPathResultType[] argTypes)
{
XsltFunction function;
if (functions.TryGetValue(name, out function))
return function;
return baseContext.ResolveFunction(prefix, name, argTypes);
}
示例7: XPathMessageFunction
protected XPathMessageFunction(XPathResultType[] argTypes, int max, int min, XPathResultType retType)
{
this.argTypes = argTypes;
this.maxArgs = max;
this.minArgs = min;
this.retType = retType;
}
示例8: Init
protected void Init (int minArgs, int maxArgs, XPathResultType returnType, XPathResultType[] argTypes)
{
this.minargs = minArgs;
this.maxargs = maxArgs;
this.returnType = returnType;
this.argTypes = argTypes;
}
示例9: ExsltContextFunction
public ExsltContextFunction(MethodInfo mi, XPathResultType[] argTypes,
object owner)
{
_method = mi;
_argTypes = argTypes;
_ownerObj = owner;
}
示例10: CustomXsltFunction
public CustomXsltFunction(string name, XPathResultType[] argTypes, XPathResultType returnType, InvokedFunction function = null)
{
Prefix = String.Empty;
Name = name;
ArgTypes = argTypes;
ReturnType = returnType;
Function = function;
}
示例11: ResolveFunction
public override IXsltContextFunction ResolveFunction(string prefix, string name, XPathResultType[] argTypes)
{
IXsltContextFunction function = null;
if (string.IsNullOrEmpty(prefix))
functions.TryGetValue(name, out function);
return function ?? base.ResolveFunction(prefix, name, argTypes);
}
示例12: ResolveFunction
public override IXsltContextFunction ResolveFunction(string prefix, string name, XPathResultType[] ArgTypes)
{
if (name == "upper-case")
{
return new UpperCase();
}
return null;
}
示例13: ResolveFunction
public override IXsltContextFunction ResolveFunction(string prefix, string name, XPathResultType[] ArgTypes)
{
var func = _functions.SingleOrDefault(f => f.Name == name && f.Prefix == prefix);
if(func != null)
return func;
else
throw new InvalidOperationException("Unknown function in XPath: " + name);
}
示例14: ResolveFunction
public override IXsltContextFunction ResolveFunction(string prefix, string name, XPathResultType[] argTypes)
{
if (name == "document")
{
return new XsltContextFunction("document");
}
return null;
}
示例15: TriflesXPathExtensionVariable
/// <summary>
/// Creates the variable object.
/// </summary>
/// <param name="name"></param>
/// <param name="value"></param>
/// <param name="isLocal"></param>
/// <param name="isParam"></param>
/// <param name="resultType"></param>
public TriflesXPathExtensionVariable(XName name, object value, bool isLocal = false, bool isParam = false, XPathResultType? resultType = null)
{
this.VariableName = name;
this.Value = value;
this.IsLocal = isLocal;
this.IsParam = isParam;
this.VariableType = resultType.HasValue ? resultType.Value : TriflesXPathData.GuessXPathResultType(value);
}