Esempio n. 1
0
        public virtual ELContext CreateElContext(IVariableContext variableContext)
        {
            var elResolver = CachedElResolver;
            var elContext  = new ProcessEngineElContext(FunctionMappers, elResolver);

            elContext.PutContext(typeof(ExpressionFactory), expressionFactory);
            elContext.PutContext(typeof(IVariableContext), variableContext);
            return(elContext);
        }
Esempio n. 2
0
        protected internal virtual ProcessEngineElContext CreateElContext(IVariableScope variableScope)
        {
            var elResolver = CachedElResolver;
            var elContext  = new ProcessEngineElContext(FunctionMappers, elResolver);

            elContext.PutContext(typeof(ExpressionFactory), expressionFactory);
            elContext.PutContext(typeof(IVariableScope), variableScope);

            var registrations = ObjectContainer.Current.AllRegistrations();
            var regDic        = new Dictionary <string, Type>();

            foreach (var reg in registrations)
            {
                if (!reg.IsGenericType && !regDic.ContainsKey(reg.Name))
                {
                    regDic.Add(reg.Name, reg);
                }
            }

            elContext.PutContext(typeof(IScope), regDic);

            return(elContext);
        }