Esempio n. 1
0
        public static Closure Root(IElementNavigator root)
        {
            var newContext = new Closure();

            var input = new[] { root };

            newContext.SetThis(input);
            newContext.SetThat(input);
            newContext.SetOriginalContext(input);

            return(newContext);
        }
Esempio n. 2
0
        public static Closure Root(IElementNavigator root, IElementNavigator resource)
        {
            var newContext = new Closure();

            var input = new[] { root };

            newContext.SetThis(input);
            newContext.SetThat(input);
            newContext.SetOriginalContext(input);
            if (resource != null)
            {
                newContext.SetResource(new[] { resource });
            }

            return(newContext);
        }
Esempio n. 3
0
        public static Closure Root(ITypedElement root, EvaluationContext ctx = null)
        {
            var newContext = new Closure()
            {
                EvaluationContext = ctx ?? EvaluationContext.CreateDefault()
            };

            var input = new[] { root };

            newContext.SetThis(input);
            newContext.SetThat(input);
            newContext.SetOriginalContext(input);
            if (ctx.Container != null)
            {
                newContext.SetResource(new[] { ctx.Container });
            }

            return(newContext);
        }