Ejemplo n.º 1
0
        private ILavaService GetService(Type serviceType, object configuration)
        {
            var key = LavaUtilityHelper.GetContextKeyFromType(serviceType);

            var service = this.GetInternalField(key);

            return(service as ILavaService);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new template context.
        /// </summary>
        /// <returns></returns>
        protected void InitializeRenderContext(ILavaRenderContext context, IEnumerable <string> enabledCommands = null)
        {
            if (context == null)
            {
                return;
            }

            if (enabledCommands != null)
            {
                context.SetEnabledCommands(enabledCommands);
            }

            // Set a reference to the current Lava Engine.
            context.SetInternalField(LavaUtilityHelper.GetContextKeyFromType(typeof(ILavaEngine)), this);
        }