__defineSetter__ and __defineGetter__

You can use scripting to add properties to the prototypes of some of these static objects. To do so, you must use new features added to NN6. Two new methods— __defineGetter__() and __defineSetter__()—enable you to assign functions to a custom property of an object.

The functions execute whenever the property is read (the function assigned via
the __defineGetter__() method) or modified (the function assigned via the
__defineSetter__() method). The common way to define these functions is in
the form of an anonymous function. The formats for the two statements
that assign these behaviors to an object prototype are as follows:

object.prototype.__defineGetter__("propName", function([param1[,...[,paramN]]])
{
// statements
return returnValue
})
object.prototype.__defineSetter__("propName", function([param1[,...[,paramN]]])
{
// statements
return returnValue
})

Comments

Popular posts from this blog

Unable to delete Shared Services Provider in SharePoint (MOSS)

The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

Cannot add a SimpleContent column to a table containing element columns or nested relations