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); }
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); }
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); }