コード例 #1
0
 /// <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));
 }
コード例 #2
0
ファイル: XObjectExtensions.cs プロジェクト: tvoyle/nxkit
        /// <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));
        }