/// <summary> /// Returns the <see cref="EvaluationContext"/> from any parent 'model' element. /// </summary> /// <returns></returns> internal EvaluationContext GetAncestorModelEvaluationContext() { return(obj.Ancestors(Constants.XForms_1_0 + "model") .SelectMany(i => i.Interfaces <Model>()) .Select(i => i.DefaultEvaluationContext) .FirstOrDefault(i => i != null)); }
/// <summary> /// /// Obtains the ancestors of the given <see cref="XObject"/>, including the specified instance. /// </summary> /// <param name="self"></param> /// <returns></returns> public static IEnumerable <XObject> AncestorsAndSelf(this XObject self) { Contract.Requires <ArgumentNullException>(self != null); return(self.Ancestors().Prepend(self)); }