Settings of the Jurassic JS engine
Beispiel #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>
        /// <param name="settings">Settings of the Jurassic JS engine</param>
        /// <returns>Instance of <see cref="JsEngineFactoryCollection" /></returns>
        public static JsEngineFactoryCollection AddJurassic(this JsEngineFactoryCollection source,
                                                            JurassicSettings settings)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

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

            source.Add(new JurassicJsEngineFactory(settings));

            return(source);
        }
		/// <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="settings">Settings of the Jurassic JS engine</param>
		/// <returns>Instance of <see cref="JsEngineFactoryCollection" /></returns>
		public static JsEngineFactoryCollection AddJurassic(this JsEngineFactoryCollection source,
			JurassicSettings settings)
		{
			if (source == null)
			{
				throw new ArgumentNullException("source");
			}

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

			source.Add(new JurassicJsEngineFactory(settings));

			return source;
		}
		/// <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);
		}
Beispiel #4
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));
        }
        /// <summary>
        /// Constructs an instance of adapter for the Jurassic JS engine
        /// </summary>
        /// <param name="settings">Settings of the Jurassic JS engine</param>
        public JurassicJsEngine(JurassicSettings settings)
        {
            JurassicSettings jurassicSettings = settings ?? new JurassicSettings();

            try
            {
                _jsEngine = new OriginalEngine
                {
                    CompatibilityMode = OriginalCompatibilityMode.Latest,
                    DisableClrCollectionsExposingByValue = !jurassicSettings.EnableHostCollectionsEmbeddingByValue,
                    EnableExposedClrTypes = true,
                    EnableILAnalysis      = jurassicSettings.EnableIlAnalysis,
                    ForceStrictMode       = jurassicSettings.StrictMode
                };
            }
            catch (Exception e)
            {
                throw JsErrorHelpers.WrapEngineLoadException(e, EngineName, EngineVersion, true);
            }
        }
        /// <summary>
        /// Constructs a instance of adapter for the Jurassic JS engine
        /// </summary>
        /// <param name="settings">Settings of the Jurassic JS engine</param>
        public JurassicJsEngine(JurassicSettings settings)
        {
            JurassicSettings jurassicSettings = settings ?? new JurassicSettings();

            try
            {
                _jsEngine = new OriginalJsEngine
                {
                    EnableDebugging       = jurassicSettings.EnableDebugging,
                    CompatibilityMode     = OriginalCompatibilityMode.Latest,
                    EnableExposedClrTypes = true,
                    EnableILAnalysis      = jurassicSettings.EnableIlAnalysis,
                    ForceStrictMode       = jurassicSettings.StrictMode
                };
            }
            catch (Exception e)
            {
                throw new JsEngineLoadException(
                          string.Format(CoreStrings.Runtime_JsEngineNotLoaded,
                                        EngineName, e.Message), EngineName, EngineVersion, e);
            }
        }
        /// <summary>
        /// Constructs an instance of adapter for the Jurassic JS engine
        /// </summary>
        /// <param name="settings">Settings of the Jurassic JS engine</param>
        public JurassicJsEngine(JurassicSettings settings)
        {
            JurassicSettings jurassicSettings = settings ?? new JurassicSettings();

            try
            {
                _jsEngine = new OriginalEngine
                {
#if !NETSTANDARD2_0
                    EnableDebugging = jurassicSettings.EnableDebugging,
#endif
                    CompatibilityMode     = OriginalCompatibilityMode.Latest,
                    EnableExposedClrTypes = true,
                    EnableILAnalysis      = jurassicSettings.EnableIlAnalysis,
                    ForceStrictMode       = jurassicSettings.StrictMode
                };
            }
            catch (Exception e)
            {
                throw JsErrorHelpers.WrapEngineLoadException(e, EngineName, EngineVersion, true);
            }
        }
 /// <summary>
 /// Constructs an instance of the Jurassic JS engine factory
 /// </summary>
 /// <param name="settings">Settings of the Jurassic JS engine</param>
 public JurassicJsEngineFactory(JurassicSettings settings)
 {
     _settings = settings;
 }
		/// <summary>
		/// Constructs an instance of the Jurassic JS engine factory
		/// </summary>
		/// <param name="settings">Settings of the Jurassic JS engine</param>
		public JurassicJsEngineFactory(JurassicSettings settings)
		{
			_settings = settings;
		}