Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        /// <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;
        }