You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
2.4 KiB

1 year ago
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.DeferredOperation=function(e,d,c){var b=null,a=this;a._delay=e;a._context=d;a._callback=c;a._completeCallback=b;a._errorCallback=b;a._timer=b;a._callArgs=b;a._isComplete=false;a._completedSynchronously=false;a._asyncResult=b;a._exception=b;a._throwExceptions=true;a._oncomplete$delegate=Function.createDelegate(a,a._oncomplete);a.post=Function.createDelegate(a,a.post)};AjaxControlToolkit.DeferredOperation.prototype={get_isPending:function(){return this._timer!=null},get_isComplete:function(){return this._isComplete},get_completedSynchronously:function(){return this._completedSynchronously},get_exception:function(){return this._exception},get_throwExceptions:function(){return this._throwExceptions},set_throwExceptions:function(a){this._throwExceptions=a},get_delay:function(){return this._delay},set_delay:function(a){this._delay=a},post:function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];this.beginPost(b,null,null)},beginPost:function(d,b,c){var a=this;a.cancel();a._callArgs=Array.clone(d||[]);a._completeCallback=b;a._errorCallback=c;if(a._delay==-1)try{a._oncomplete()}finally{a._completedSynchronously=true}else a._timer=setTimeout(a._oncomplete$delegate,a._delay)},cancel:function(){var b=null,a=this;if(a._timer){clearTimeout(a._timer);a._timer=b}a._callArgs=b;a._isComplete=false;a._asyncResult=b;a._completeCallback=b;a._errorCallback=b;a._exception=b;a._completedSynchronously=false},call:function(){var a=this;for(var c=[],b=0;b<arguments.length;b++)c[b]=arguments[b];a.cancel();a._callArgs=c;a._completeCallback=null;a._errorCallback=null;try{a._oncomplete()}finally{a._completedSynchronously=true}if(a._exception)throw a._exception;return a._asyncResult},complete:function(){var a=this;if(a._timer){try{a._oncomplete()}finally{a._completedSynchronously=true}return a._asyncResult}else if(a._isComplete)return a._asyncResult},_oncomplete:function(){var a=this,d=a._callArgs,b=a._completeCallback,c=a._errorCallback;a.cancel();try{if(d)a._asyncResult=a._callback.apply(a._context,d);else a._asyncResult=a._callback.call(a._context);a._isComplete=true;a._completedSynchronously=false;b&&b(a)}catch(e){a._isComplete=true;a._completedSynchronously=false;a._exception=e;if(c)if(c(a))return;if(a._throwExceptions)throw e;}}};AjaxControlToolkit.DeferredOperation.registerClass("AjaxControlToolkit.DeferredOperation");
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();