MsieJavaScriptEngine.JsRt.JavaScriptRuntime.Create C# (CSharp) Method

Create() public static method

Creates a new runtime.
public static Create ( JavaScriptRuntimeAttributes attributes, JavaScriptRuntimeVersion version, JavaScriptThreadServiceCallback threadServiceCallback ) : JavaScriptRuntime
attributes JavaScriptRuntimeAttributes The attributes of the runtime to be created.
version JavaScriptRuntimeVersion The version of the runtime to be created.
threadServiceCallback JavaScriptThreadServiceCallback The thread service for the runtime. Can be null.
return JavaScriptRuntime
        public static JavaScriptRuntime Create(JavaScriptRuntimeAttributes attributes, JavaScriptRuntimeVersion version, JavaScriptThreadServiceCallback threadServiceCallback)
        {
            JavaScriptRuntime handle;
            Native.ThrowIfError(Native.JsCreateRuntime(attributes, version, threadServiceCallback, out handle));
            return handle;
        }

Same methods

JavaScriptRuntime::Create ( ) : JavaScriptRuntime
JavaScriptRuntime::Create ( JavaScriptRuntimeAttributes attributes, JavaScriptRuntimeVersion version ) : JavaScriptRuntime

Usage Example

        /// <summary>
        /// Creates a instance of JavaScript runtime with special settings
        /// </summary>
        /// <returns>Instance of JavaScript runtime with special settings</returns>
        private static JavaScriptRuntime CreateJsRuntime()
        {
            var jsRuntime = JavaScriptRuntime.Create(JavaScriptRuntimeAttributes.AllowScriptInterrupt,
                                                     JavaScriptRuntimeVersion.VersionEdge, null);

            return(jsRuntime);
        }