예제 #1
0
        /// <summary>
        /// Adds a instance of <see cref="JurassicJsEngineFactory"/> to
        /// the specified <see cref="JsEngineFactoryCollection" />
        /// </summary>
        /// <param name="source">Instance of <see cref="JsEngineFactoryCollection" /></param>
        /// <returns>Instance of <see cref="JsEngineFactoryCollection" /></returns>
        public static JsEngineFactoryCollection AddJurassic(this JsEngineFactoryCollection source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            return(source.AddJurassic(new JurassicSettings()));
        }
예제 #2
0
        /// <summary>
        /// Adds a instance of <see cref="JurassicJsEngineFactory"/> to
        /// the specified <see cref="JsEngineFactoryCollection" />
        /// </summary>
        /// <param name="source">Instance of <see cref="JsEngineFactoryCollection" /></param>
        /// <param name="configure">The delegate to configure the provided <see cref="JurassicSettings"/></param>
        /// <returns>Instance of <see cref="JsEngineFactoryCollection" /></returns>
        public static JsEngineFactoryCollection AddJurassic(this JsEngineFactoryCollection source,
                                                            Action <JurassicSettings> configure)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            if (configure == null)
            {
                throw new ArgumentNullException("configure");
            }

            var settings = new JurassicSettings();

            configure(settings);

            return(source.AddJurassic(settings));
        }