Exemplo n.º 1
0
            /// <summary>
            /// 获取重定向地址
            /// </summary>
            /// <param name="call">HTTP 调用</param>
            /// <param name="is302">是否临时重定向</param>
            public void Location(CallBase call, bool is302 = true)
            {
                string version = call.DomainServer.StaticFileVersion;

                if (!object.ReferenceEquals(version, this.version))
                {
                    Monitor.Enter(versionLock);
                    try
                    {
                        if (!object.ReferenceEquals(version, this.version))
                        {
                            locationData = System.Text.Encoding.ASCII.GetBytes(location + "?" + AutoCSer.Net.Http.Header.VersionNameChar.ToString() + "=" + version);
                            this.version = version;
                        }
                    }
                    finally { Monitor.Exit(versionLock); }
                }
                call.location(locationData, is302);
            }
Exemplo n.º 2
0
 /// <summary>
 /// 设置 AJAX 调用加载
 /// </summary>
 /// <param name="loader"></param>
 /// <param name="methodInfo"></param>
 internal void SetLoader(CallBase loader, AjaxMethodInfo methodInfo)
 {
     this.loader = loader;
     MethodInfo  = methodInfo;
 }