本文整理匯總了C#中System.Xml.XPath.XPathNavigator.Evaluate方法的典型用法代碼示例。如果您正苦於以下問題:C# XPathNavigator.Evaluate方法的具體用法?C# XPathNavigator.Evaluate怎麽用?C# XPathNavigator.Evaluate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Xml.XPath.XPathNavigator
的用法示例。
在下文中一共展示了XPathNavigator.Evaluate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: WriteSyntax
public override void WriteSyntax(XPathNavigator reflection, SyntaxWriter writer)
{
writer.WriteStartBlock(Language);
// Check the list of assemblies for which to generate XAML syntax
string assemblyName = (string)reflection.Evaluate(apiContainingAssemblyExpression);
string namespaceName = (string)reflection.Evaluate(apiContainingNamespaceNameExpression);
if (!xamlAssemblies.ContainsKey(assemblyName.ToLower()))
{
WriteXamlBoilerplate(XamlBoilerplateID.nonXamlAssemblyBoilerplate, writer);
}
else
{
string group = (string)reflection.Evaluate(apiGroupExpression);
switch (group)
{
case "namespace":
WriteNamespaceSyntax(reflection, writer);
break;
case "type":
WriteTypeSyntax(reflection, writer);
break;
case "member":
WriteMemberSyntax(reflection, writer);
break;
}
WriteXamlXmlnsUri(assemblyName, namespaceName, writer);
}
writer.WriteEndBlock();
}
示例2: WriteClassSyntax
// class: done
public override void WriteClassSyntax (XPathNavigator reflection, SyntaxWriter writer) {
string name = reflection.Evaluate(apiNameExpression).ToString();
bool isAbstract = (bool) reflection.Evaluate(apiIsAbstractTypeExpression);
bool isSealed = (bool) reflection.Evaluate(apiIsSealedTypeExpression);
bool isSerializable = (bool) reflection.Evaluate(apiIsSerializableTypeExpression);
if (isSerializable) WriteAttribute("T:System.SerializableAttribute", writer);
WriteAttributes(reflection, writer);
WriteVisibility(reflection, writer);
writer.WriteString(" ");
if (isAbstract) {
if (isSealed) {
writer.WriteKeyword("static");
} else {
writer.WriteKeyword("abstract");
}
writer.WriteString(" ");
} else {
if (isSealed) {
writer.WriteKeyword("sealed");
writer.WriteString(" ");
}
}
writer.WriteKeyword("class");
writer.WriteString(" ");
writer.WriteIdentifier(name);
WriteGenericTemplates(reflection, writer);
WriteBaseClassAndImplementedInterfaces(reflection, writer);
WriteGenericTemplateConstraints(reflection, writer);
}
示例3: WriteDelegateSyntax
public override void WriteDelegateSyntax(XPathNavigator reflection, SyntaxWriter writer)
{
string name = (string)reflection.Evaluate(apiNameExpression);
bool isSerializable = (bool)reflection.Evaluate(apiIsSerializableTypeExpression);
if (isSerializable) WriteAttribute("T:System.SerializableAttribute", writer);
WriteAttributes(reflection, writer);
writer.WriteKeyword("type");
writer.WriteString(" ");
writer.WriteIdentifier(name);
writer.WriteString(" = ");
writer.WriteLine();
writer.WriteString(" ");
writer.WriteKeyword("delegate");
writer.WriteString(" ");
writer.WriteKeyword("of");
writer.WriteString(" ");
WriteParameters(reflection, writer);
writer.WriteKeyword("->");
writer.WriteString(" ");
WriteReturnValue(reflection, writer);
}
示例4: WriteClassSyntax
public override void WriteClassSyntax (XPathNavigator reflection, SyntaxWriter writer) {
if (IsUnsupportedGeneric(reflection, writer)) return;
string name = reflection.Evaluate(apiNameExpression).ToString();
bool isAbstract = (bool) reflection.Evaluate(apiIsAbstractTypeExpression);
bool isSealed = (bool) reflection.Evaluate(apiIsSealedTypeExpression);
bool isSerializable = (bool) reflection.Evaluate(apiIsSerializableTypeExpression);
if (isSerializable) WriteAttribute("T:System.SerializableAttribute", writer);
WriteAttributes(reflection, writer);
WriteVisibility(reflection, writer);
writer.WriteString(" ");
if (isSealed) {
writer.WriteKeyword("final");
writer.WriteString(" ");
} else if (isAbstract) {
writer.WriteKeyword("abstract");
writer.WriteString(" ");
}
writer.WriteKeyword("class");
writer.WriteString(" ");
writer.WriteIdentifier(name);
XPathNavigator baseClass = reflection.SelectSingleNode(apiBaseClassExpression);
if ((baseClass != null) && !((bool) baseClass.Evaluate(typeIsObjectExpression))) {
writer.WriteString(" ");
writer.WriteKeyword("extends");
writer.WriteString(" ");
WriteTypeReference(baseClass, writer);
}
WriteImplementedInterfaces(reflection, writer);
}
示例5: WriteClassSyntax
/// <inheritdoc />
public override void WriteClassSyntax(XPathNavigator reflection, SyntaxWriter writer)
{
if(IsUnsupportedGeneric(reflection, writer))
return;
string name = (string)reflection.Evaluate(apiNameExpression);
bool isAbstract = (bool)reflection.Evaluate(apiIsAbstractTypeExpression);
bool isSealed = (bool)reflection.Evaluate(apiIsSealedTypeExpression);
WriteAccessModifier(reflection, writer);
if(isSealed)
{
writer.WriteKeyword("final");
writer.WriteString(" ");
}
else if(isAbstract)
{
writer.WriteKeyword("abstract");
writer.WriteString(" ");
}
writer.WriteKeyword("class");
writer.WriteString(" ");
writer.WriteString(name);
WriteBaseClass(reflection, writer);
WriteInterfaceList(reflection, writer);
}
示例6: WriteClassSyntax
// class: done
public override void WriteClassSyntax (XPathNavigator reflection, SyntaxWriter writer) {
string name = (string) reflection.Evaluate(apiNameExpression);
bool isAbstract = (bool) reflection.Evaluate(apiIsAbstractTypeExpression);
bool isSealed = (bool) reflection.Evaluate(apiIsSealedTypeExpression);
bool isSerializable = (bool) reflection.Evaluate(apiIsSerializableTypeExpression);
if (isSerializable) WriteAttribute("T:System.SerializableAttribute", writer);
WriteAttributes(reflection, writer);
WriteVisibility(reflection, writer);
writer.WriteString(" ");
if (isAbstract) {
if (isSealed) {
// static -- VB doesn't really handle this case
writer.WriteKeyword("NotInheritable");
writer.WriteString(" ");
} else {
writer.WriteKeyword("MustInherit");
writer.WriteString(" ");
}
} else if (isSealed) {
writer.WriteKeyword("NotInheritable");
writer.WriteString(" ");
}
writer.WriteKeyword("Class");
writer.WriteString(" ");
writer.WriteIdentifier(name);
WriteGenericTemplates(reflection, writer);
WriteBaseClass(reflection, writer);
WriteImplementedInterfaces(reflection, writer);
}
示例7: WriteSyntax
public override void WriteSyntax (XPathNavigator reflection, SyntaxWriter writer) {
string group = (string)reflection.Evaluate(groupExpression);
string subgroup = (string)reflection.Evaluate(subgroupExpression);
if (group == "type" && subgroup == "class") {
string prefix = WebControlPrefix(reflection);
if (!String.IsNullOrEmpty(prefix)) {
WriteClassSyntax(reflection, writer, prefix);
}
}
if (group == "member") {
string prefix = null;
XPathNavigator containingType = reflection.SelectSingleNode(containingTypeExpression);
if (containingType != null) prefix = WebControlPrefix(containingType);
if (!String.IsNullOrEmpty(prefix)) {
if (subgroup == "property") {
WritePropertySyntax(reflection, writer, prefix);
} else if (subgroup == "event") {
WriteEventSyntax(reflection, writer, prefix);
}
}
}
}
示例8: Category
public Category(XPathNavigator category, IXmlNamespaceResolver resolver)
{
this.Id = category.GetAttribute("id", String.Empty);
this._index = Convert.ToInt32(category.Evaluate("count(preceding-sibling::c:category)", resolver));
this._headerText = ((string)(category.GetAttribute("headerText", String.Empty)));
this._description = ((string)(category.Evaluate("string(c:description)", resolver))).Trim();
_tab = category.GetAttribute("tab", String.Empty);
_newColumn = (category.GetAttribute("newColumn", String.Empty) == "true");
_template = ((string)(category.Evaluate("string(c:template)", resolver)));
_floating = (category.GetAttribute("floating", String.Empty) == "true");
_collapsed = (category.GetAttribute("collapsed", String.Empty) == "true");
}
示例9: WriteEnumerationSyntax
public override void WriteEnumerationSyntax(XPathNavigator reflection, SyntaxWriter writer)
{
string name = (string)reflection.Evaluate(apiNameExpression);
bool isSerializable = (bool)reflection.Evaluate(apiIsSerializableTypeExpression);
if (isSerializable) WriteAttribute("T:System.SerializableAttribute", writer);
WriteAttributes(reflection, writer);
writer.WriteKeyword("type");
writer.WriteString(" ");
WriteVisibility(reflection, writer);
writer.WriteIdentifier(name);
}
示例10: Evaluate
/// <summary>
/// Evaluates the given expression and returns the typed result.
/// </summary>
public static object Evaluate(string expression, XPathNavigator source,
params XmlPrefix[] prefixes)
{
XPathExpression expr = GetCompiledExpression(expression, source);
expr.SetContext(PrepareContext(source, null, prefixes, null));
return source.Evaluate(expr);
}
示例11: WriteNamespaceSyntax
public override void WriteNamespaceSyntax (XPathNavigator reflection, SyntaxWriter writer) {
string name = (string)reflection.Evaluate(apiNameExpression);
writer.WriteKeyword("package");
writer.WriteString(" ");
writer.WriteIdentifier(name);
}
示例12: WriteStructureSyntax
// structure: done
public override void WriteStructureSyntax (XPathNavigator reflection, SyntaxWriter writer) {
string name = (string) reflection.Evaluate(apiNameExpression);
bool isSerializable = (bool) reflection.Evaluate(apiIsSerializableTypeExpression);
if (isSerializable) WriteAttribute("T:System.SerializableAttribute", writer);
WriteAttributes(reflection, writer);
WriteVisibility(reflection, writer);
writer.WriteString(" ");
writer.WriteKeyword("struct");
writer.WriteString(" ");
writer.WriteIdentifier(name);
WriteGenericTemplates(reflection, writer);
WriteImplementedInterfaces(reflection, writer);
WriteGenericTemplateConstraints(reflection, writer);
}
示例13: Invoke
public override object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext)
{
string str = XPathMessageFunction.ToString(args[0]);
string xpath = string.Format(CultureInfo.InvariantCulture, "/s11:Envelope/s11:Header/*[@s11:actor='{0}'] | /s12:Envelope/s12:Header/*[@s12:role='{1}']", new object[] { str, str });
XPathExpression expr = docContext.Compile(xpath);
expr.SetContext((XmlNamespaceManager) xsltContext);
return docContext.Evaluate(expr);
}
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:XPathMessageFunctionHeadersWithActor.cs
示例14: WebControlPrefix
private string WebControlPrefix (XPathNavigator reflection) {
if ((bool)reflection.Evaluate(typeIsWebControl)) {
string name = (string)reflection.Evaluate(nameExpression);
string space = (string)reflection.Evaluate(containingNamespaceExpression);
if ((space == "N:System.Web.UI") && ((name == "Page") || (name == "ScriptControl") || (name == "UserControl"))) {
return (null);
} else {
if (space == "N:System.Web.UI.MobileControls") {
return ("mobile");
} else {
return ("asp");
}
}
} else {
return (null);
}
}
示例15: WriteEnumerationSyntax
public override void WriteEnumerationSyntax (XPathNavigator reflection, SyntaxWriter writer) {
string name = (string)reflection.Evaluate(apiNameExpression);
WriteAttributeList(reflection, writer);
WriteAccessModifier(reflection, writer);
writer.WriteKeyword("enum");
writer.WriteString(" ");
writer.WriteString(name);
// no JScript support for underlying types
}