public XPathContext(XPathContext parent) : base((NameTable)parent.NameTable) { this.parent = parent; Arguments = new XsltArgumentList(); functions = new Dictionary <string, Func <IXsltContextFunction> >(); }
public XPathContext(XPathContext parent) : base((NameTable)parent.NameTable) { this.parent = parent; Arguments = new XsltArgumentList(); functions = new Dictionary<string, Func<IXsltContextFunction>>(); }
public XPathResult(PropertyDescriptor property, object result, XPathContext context, object matchingBehavior, Func <XPathNavigator> create) { Result = result; Property = property; Type = (property != null) ? Property.PropertyType : null; Context = context; this.create = create; this.matchingBehavior = matchingBehavior; CanWrite = (create != null || result is XPathNavigator); }
protected XPathAdapter(XPathNavigator source, XPathAdapter parent) { Parent = parent; Context = parent.Context.CreateChild(null); root = source.Clone(); }
protected XPathAdapter(Func<XPathNavigator> createSource, XPathAdapter parent) { Parent = parent; Context = parent.Context.CreateChild(null); createRoot = createSource; }
public XPathContext(XPathContext parent) : this((NameTable)parent.NameTable) { this.parent = parent; }
public XPathAdapter(IXPathNavigable source) { Source = source; Context = new XPathContext(); root = source.CreateNavigator(); }
public XPathResult(PropertyDescriptor property, object result, XPathContext context, object matchingBehavior) : this(property, result, context, matchingBehavior, null) { }
public XPathResult(Type type, object result, XPathContext context, object matchingBehavior) : this(null, result, context, matchingBehavior, null) { Type = type; }
protected XPathAdapter(XPathNavigator source, XPathAdapter parent) { this.parent = parent; context = parent.context.CreateChild(); root = source.Clone(); }
public XPathContext(XPathContext parent) : base((NameTable)parent.NameTable) { this.parent = parent; Arguments = new XsltArgumentList(); }
protected XPathAdapter(Func <XPathNavigator> createSource, XPathAdapter parent) { Parent = parent; Context = parent.Context.CreateChild(null); createRoot = createSource; }
void IDictionaryInitializer.Initialize(IDictionaryAdapter dictionaryAdapter, object[] behaviors) { var meta = dictionaryAdapter.Meta; if (meta.MetaInitializers.OfType<XPathBehavior>().FirstOrDefault() == null) { throw new InvalidOperationException(string.Format( "Interface {0} requested xpath support, but was not configured properly. " + "Did you forget to add an XPathBehavior?", meta.Type.FullName)); } var xmlMeta = dictionaryAdapter.GetXmlMeta(); if (dictionaryAdapter.This.CreateStrategy == null) { dictionaryAdapter.This.CreateStrategy = this; dictionaryAdapter.This.AddCopyStrategy(this); } if (rootXmlMeta == null) { rootXmlMeta = xmlMeta; Context.ApplyBehaviors(rootXmlMeta, behaviors); if (Parent == null) { foreach (var behavior in behaviors) { if (behavior is XPathAttribute) { var attrib = (XPathAttribute)behavior; var compiledExpression = attrib.CompiledExpression; if (MoveOffRoot(root, XPathNodeType.Element) == false || Context.Matches(compiledExpression, root)) { break; } var navigator = Context.SelectSingleNode(compiledExpression, root); if (navigator != null) { root = navigator; break; } } } MoveOffRoot(root, XPathNodeType.Element); } } else { if (overlays == null) overlays = new Dictionary<Type, XPathContext>(); XPathContext overlay; if (overlays.TryGetValue(meta.Type, out overlay) == false) { overlay = new XPathContext().ApplyBehaviors(xmlMeta, behaviors); overlays.Add(meta.Type, overlay); } } }
protected XPathAdapter(XPathNavigator source, XPathAdapter parent) { Parent = parent; Context = parent.Context.CreateChild(null); root = source.Clone(); }
public XPathAdapter(IXPathNavigable source) { Source = source; Context = new XPathContext(); root = source.CreateNavigator(); }
public XPathContext(XPathContext parent) : base((NameTable)parent.NameTable) { this.parent = parent; Arguments = new XsltArgumentList(); }
public XPathSemantics(XPathContext xpathContext) { this.xpathContext = xpathContext; }
protected XPathAdapter(Func<XPathNavigator> createSource, XPathAdapter parent) { this.parent = parent; context = parent.context.CreateChild(); createRoot = createSource; }
public XPathSemantics(XPathContext xpathContext) { this.xpathContext = xpathContext; }
void IDictionaryInitializer.Initialize(IDictionaryAdapter dictionaryAdapter, object[] behaviors) { var meta = dictionaryAdapter.Meta; if (meta.MetaInitializers.OfType <XPathBehavior>().FirstOrDefault() == null) { throw new InvalidOperationException(string.Format( "Interface {0} requested xpath support, but was not configured properly. " + "Did you forget to add an XPathBehavior?", meta.Type.FullName)); } var xmlMeta = dictionaryAdapter.GetXmlMeta(); if (dictionaryAdapter.This.CreateStrategy == null) { dictionaryAdapter.This.CreateStrategy = this; dictionaryAdapter.This.AddCopyStrategy(this); } if (rootXmlMeta == null) { rootXmlMeta = xmlMeta; Context.ApplyBehaviors(rootXmlMeta, behaviors); if (Parent == null) { foreach (var behavior in behaviors) { if (behavior is XPathAttribute) { var attrib = (XPathAttribute)behavior; var compiledExpression = attrib.CompiledExpression; if (MoveOffRoot(root, XPathNodeType.Element) == false || Context.Matches(compiledExpression, root)) { break; } var navigator = Context.SelectSingleNode(compiledExpression, root); if (navigator != null) { root = navigator; break; } } } MoveOffRoot(root, XPathNodeType.Element); } } else { if (overlays == null) { overlays = new Dictionary <Type, XPathContext>(); } XPathContext overlay; if (overlays.TryGetValue(meta.Type, out overlay) == false) { overlay = new XPathContext().ApplyBehaviors(xmlMeta, behaviors); overlays.Add(meta.Type, overlay); } } }