SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 88 | Next

Robin Pars, Laurence Moroney, and John Grieb

"Foundations of ASP.NET AJAX"

_CurrentGear;
CHAPTER 3 ?–  THE MICROSOFT AJAX LIBRARY: MAKING CLIENT-SIDE JAVASCRIPT EASIER 46
},
set_CurrentGear: function(strCurrentGear)
{
this._CurrentGear = strCurrentGear;
},
dispose: function()
{
alert("Disposing instance of class SportsCar");
}
}
AJAXBook.SportsCar.registerClass("AJAXBook.SportsCar",
AJAXBook.Car,
AJAXBook.IStickShift);
In this case, the registerClass method call passes the fully qualified name of the
class, the class it inherits from, and the interface it implements. You can implement more
than one interface with your class simply by specifying each interface into the register-
Class method and separating the interface??™s name by a comma.
Conversely, an imitation sports car is just a fancy-looking normal car, so its class definition
would look like this:
AJAXBook.ImitationSportsCar = function(strMake, strModel, strYear)
{
AJAXBook.ImitationSportsCar.initializeBase(this, [strMake, strModel, strYear]);
}
AJAXBook.ImitationSportsCar.prototype =
{
Dispose: function()
{
Alert("Disposing instance of class ImitationSportsCar");
}
}
AJAXBook.


Pages:
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100