PC Review


Reply
Thread Tools Rate Thread

Ask for help translated into the new. NET Framework JAVASCRIT script syntax expansion

 
 
qq2005
Guest
Posts: n/a
 
      27th Feb 2008
Hello,
The following JS FILE(ProgressBar.js) is the original code for ASP.NET Atlas
about the progress ,
Now I would like to use it in ASP.NET AJAX1.0 ¡£
Because I do not know how new. NET Framework JAVASCRIT script syntax
expansion¡£
Ask for help translated into the new. NET Framework JAVASCRIT script syntax
expansion¡£
Thank you!!
Source code(At the same time that pieces(ProgressBar.js)):

Sys.UI.ProgressBar = function(associatedElement) {
Sys.UI.ProgressBar.initializeBase(this, [associatedElement]);

var _timer = new Sys.Timer();
var _progress = 0;
var _serviceURL;
var _serviceMethod;
var _responsePending;
var _tickHandler;
var _obj = this;

this.get_progress = function() {
return _progress;
}

this.set_progress = function(value) {
if (value > = 100) {
_timer.set_enabled(false);
}
_progress = value;
associatedElement.style.width = value + "%";
associatedElement.innerHTML = value == 100 ?
"Done!" : value + "%";
}

this.get_interval = function() {
return _timer.get_interval();
}

this.set_interval = function(value) {
_timer.set_interval(value);
}

this.get_serviceURL = function() {
return _serviceURL;
}

this.set_serviceURL = function(value) {
_serviceURL = value;
}

this.get_serviceMethod = function() {
return _serviceMethod;
}

this.set_serviceMethod = function(value) {
_serviceMethod = value;
}

this.getDescriptor = function() {
var td = Sys.UI.ProgressBar.callBaseMethod(this,
'getDescriptor');
td.addProperty('interval', Number);
td.addProperty('progress', Number);
td.addProperty('serviceURL', String);
td.addProperty('serviceMethod', String);
td.addMethod('start');
td.addMethod('stop');
return des;
}

this.initialize = function() {
Sys.UI.ProgressBar.callBaseMethod(this, 'initialize');
_tickHandler = Function.createDelegate(this,
this._onTimerTick);
_timer.tick.add(_tickHandler);
this.set_progress(0);
}

this.dispose = function() {
if (_timer) {
_timer.tick.remove(_tickHandler);
_tickHandler = null;
_timer.dispose();
}
_timer = null;
associatedElement = null;
_obj = null;

Sys.UI.ProgressBar.callBaseMethod(this, 'dispose');
}

this.start = function() {
_timer.set_enabled(true);
}

this.stop = function() {
_timer.set_enabled(false);
}

this._onTimerTick = function(sender, eventArgs) {
if (!_responsePending) {
_responsePending = true;

// Asynchronously call the service method.
Sys.Net.ServiceMethod.invoke(_serviceURL,
_serviceMethod, null, null, _onMethodComplete);
}
}

function _onMethodComplete(result) {
// Update the progress bar.
_obj.set_progress(result);
_responsePending = false;
}
}
Type.registerSealedClass('Sys.UI.ProgressBar', Sys.UI.Control);
Sys.TypeDescriptor.addType('script','progressBar', Sys.UI.ProgressBar);




 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Single byte read of Serial port translated to multiple byte read by framework, which results in I/O Timeout Del Fredricks Microsoft Dot NET Framework 0 19th Sep 2008 07:52 PM
Javascrit Reference in Two Diffrent HTML pages Netaji Microsoft ASP .NET 1 15th Jan 2008 09:21 AM
Re: cmd script involving delayed variable expansion in NT4? guard Microsoft Windows 2000 CMD Promt 0 16th Jul 2003 12:50 PM
Script Syntax Paul Banco Microsoft Windows 2000 Active Directory 4 11th Jul 2003 02:53 PM
Script Syntax news.microsoft.ocm Microsoft Windows 2000 Active Directory 0 11th Jul 2003 02:51 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:09 AM.