internal bool Compile(Uri engineScriptLocation, string scriptBody, byte[] buffer) { if (site.Load(engineScriptLocation, scriptBody, typeof(WebProxyScriptHelper))) { GlobalLog.Print("AutoWebProxyScriptWrapper::Compile() Compilation succeeded for engineScriptLocation:" + engineScriptLocation.ToString()); scriptText = scriptBody; scriptBytes = buffer; return(true); } GlobalLog.Print("AutoWebProxyScriptWrapper::Compile() Compilation failed for engineScriptLocation:" + engineScriptLocation.ToString()); return(false); }
/// <summary> /// Get the proxy script instance /// </summary> /// <returns>The proxy instance</returns> public IWebProxyScript GetProxyInstance() { if (_proxyScript == null) { if ((webProxyScriptType != null) && (webProxyScriptHelperType != null)) { _proxyScript = (IWebProxyScript)Activator.CreateInstance(webProxyScriptType); _proxyScript.Load(_scriptUri ?? new Uri("http://www.contextis.co.uk", UriKind.Absolute), _script, webProxyScriptHelperType); } } return(_proxyScript); }
/// <summary> /// Get the proxy script instance /// </summary> /// <returns>The proxy instance</returns> public IWebProxyScript GetProxyInstance() { if (_proxyScript == null) { if ((webProxyScriptType != null) && (webProxyScriptHelperType != null)) { _proxyScript = (IWebProxyScript)Activator.CreateInstance(webProxyScriptType); _proxyScript.Load(_scriptUri ?? new Uri("http://www.contextis.co.uk", UriKind.Absolute), _script, webProxyScriptHelperType); } } return _proxyScript; }