{infiniteZest}
// Articles. Tutorials. Utilities.
Home  |   Search  |   Login  
Categories Skip Navigation Links
New / All
AJAX
Apple
ASP.NET
.NET
Git
Google / Android
Python / IronPython
Miscellaneous
SQL Server
AJAX Source Viewer
View the source code of a Method from ASP.NET AJAX Library. Choose a method from the menu items above (Namespaces, Classes, or Methods).
Method 'prototype.registerClass(typeName, baseType, interfaceTypes)'
Method: prototype.registerClass(typeName, baseType, interfaceTypes)
Method Full Name:     Type$registerClass(typeName, baseType, interfaceTypes)
Class: Type
Namespace: Global (MicrosoftAjax.debug.js)
Source File: MicrosoftAjax.debug.js
1   Type.prototype.registerClass = function Type$registerClass(typeName, baseType, interfaceTypes) {
2     /// <summary locid="M:J#Type.registerClass" />
3     /// <param name="typeName" type="String"></param>
4     /// <param name="baseType" type="Type" optional="true" mayBeNull="true"></param>
5     /// <param name="interfaceTypes" parameterArray="true" type="Type"></param>
6     /// <returns type="Type"></returns>
7     var e = Function._validateParams(arguments, [
8     {name: "typeName", type: String},
9     {name: "baseType", type: Type, mayBeNull: true, optional: true},
10    {name: "interfaceTypes", type: Type, parameterArray: true}
11    ]);
12    if (e) throw e;
13    if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName);
14    var parsedName;
15    try {
16      parsedName = eval(typeName);
17    }
18    catch(e) {
19      throw Error.argument('typeName', Sys.Res.argumentTypeName);
20    }
21    if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName);
22    if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName));
23    if ((arguments.length > 1) && (typeof(baseType) === 'undefined')) throw Error.argumentUndefined('baseType');
24    if (baseType && !baseType.__class) throw Error.argument('baseType', Sys.Res.baseNotAClass);
25    this.prototype.constructor = this;
26    this.__typeName = typeName;
27    this.__class = true;
28    if (baseType) {
29      this.__baseType = baseType;
30      this.__basePrototypePending = true;
31    }
32    Sys.__upperCaseTypes[typeName.toUpperCase()] = this;
33    if (interfaceTypes) {
34      this.__interfaces = [];
35      this.resolveInheritance();
36      for (var i = 2, l = arguments.length; i < l; i++) {
37        var interfaceType = arguments[i];
38        if (!interfaceType.__interface) throw Error.argument('interfaceTypes[' + (i - 2) + ']', Sys.Res.notAnInterface);
39        for (var methodName in interfaceType.prototype) {
40          var method = interfaceType.prototype[methodName];
41          if (!this.prototype[methodName]) {
42            this.prototype[methodName] = method;
43          }
44        }
45        this.__interfaces.push(interfaceType);
46      }
47    }
48    Sys.__registeredTypes[typeName] = true;
49    return this;
50  }
This is the JavaScript source for method prototype.registerClass(typeName, baseType, interfaceTypes) from ASP.NET AJAX Library. Full name for this method is Type$registerClass(typeName, baseType, interfaceTypes). It belongs to the class Type, which is in Global (MicrosoftAjax.debug.js) namespace. This source is in MicrosoftAjax.debug.js file.
Bookmark and Share This
About  Contact  Privacy Policy  Site Map