C# Class Rhino.Delegator

This is a helper class for implementing wrappers around Scriptable objects.
This is a helper class for implementing wrappers around Scriptable objects. It implements the Function interface and delegates all invocations to a delegee Scriptable object. The normal use of this class involves creating a sub-class and overriding one or more of the methods. A useful application is the implementation of interceptors, pre/post conditions, debugging.
Inheritance: System.Function
Afficher le fichier Open project: hazzik/Rhino.Net

Protected Properties

Свойство Type Description
obj Scriptable

Méthodes publiques

Méthode Description
Call ( Context cx, Scriptable scope, Scriptable thisObj, object args ) : object
Construct ( Context cx, Scriptable scope, object args ) : Scriptable

Note that if the delegee is null, this method creates a new instance of the Delegator itself rathert than forwarding the call to the delegee.

Note that if the delegee is null, this method creates a new instance of the Delegator itself rathert than forwarding the call to the delegee. This permits the use of Delegator prototypes.

Delegator ( ) : System

Create a Delegator prototype.

Create a Delegator prototype. This constructor should only be used for creating prototype objects of Delegator.

Delegator ( Scriptable obj ) : System

Create a new Delegator that forwards requests to a delegee Scriptable object.

Create a new Delegator that forwards requests to a delegee Scriptable object.

Delete ( int index ) : void
Delete ( string name ) : void
Get ( int index, Scriptable start ) : object
Get ( string name, Scriptable start ) : object
GetClassName ( ) : string
GetDefaultValue ( Type hint ) : object

Note that this method does not get forwarded to the delegee if the hint parameter is null, ScriptRuntime.ScriptableClass or ScriptRuntime.FunctionClass.

Note that this method does not get forwarded to the delegee if the hint parameter is null, ScriptRuntime.ScriptableClass or ScriptRuntime.FunctionClass. Instead the object itself is returned.

GetDelegee ( ) : Scriptable

Retrieve the delegee.

Retrieve the delegee.

GetIds ( ) : object[]
GetParentScope ( ) : Scriptable
GetPrototype ( ) : Scriptable
Has ( int index, Scriptable start ) : bool
Has ( string name, Scriptable start ) : bool
HasInstance ( Scriptable instance ) : bool
Put ( int index, Scriptable start, object value ) : void
Put ( string name, Scriptable start, object value ) : void
SetDelegee ( Scriptable obj ) : void

Set the delegee.

Set the delegee.

SetParentScope ( Scriptable parent ) : void
SetPrototype ( Scriptable prototype ) : void

Méthodes protégées

Méthode Description
NewInstance ( ) : Delegator

Crete new Delegator instance.

Crete new Delegator instance. The default implementation calls this.getClass().newInstance().

Method Details

Call() public méthode

public Call ( Context cx, Scriptable scope, Scriptable thisObj, object args ) : object
cx Context
scope Scriptable
thisObj Scriptable
args object
Résultat object

Construct() public méthode

Note that if the delegee is null, this method creates a new instance of the Delegator itself rathert than forwarding the call to the delegee.
Note that if the delegee is null, this method creates a new instance of the Delegator itself rathert than forwarding the call to the delegee. This permits the use of Delegator prototypes.
public Construct ( Context cx, Scriptable scope, object args ) : Scriptable
cx Context the current Context for this thread
scope Scriptable /// an enclosing scope of the caller except /// when the function is called from a closure. ///
args object the array of arguments
Résultat Scriptable

Delegator() public méthode

Create a Delegator prototype.
Create a Delegator prototype. This constructor should only be used for creating prototype objects of Delegator.
public Delegator ( ) : System
Résultat System

Delegator() public méthode

Create a new Delegator that forwards requests to a delegee Scriptable object.
Create a new Delegator that forwards requests to a delegee Scriptable object.
public Delegator ( Scriptable obj ) : System
obj Scriptable the delegee
Résultat System

Delete() public méthode

public Delete ( int index ) : void
index int
Résultat void

Delete() public méthode

public Delete ( string name ) : void
name string
Résultat void

Get() public méthode

public Get ( int index, Scriptable start ) : object
index int
start Scriptable
Résultat object

Get() public méthode

public Get ( string name, Scriptable start ) : object
name string
start Scriptable
Résultat object

GetClassName() public méthode

public GetClassName ( ) : string
Résultat string

GetDefaultValue() public méthode

Note that this method does not get forwarded to the delegee if the hint parameter is null, ScriptRuntime.ScriptableClass or ScriptRuntime.FunctionClass.
Note that this method does not get forwarded to the delegee if the hint parameter is null, ScriptRuntime.ScriptableClass or ScriptRuntime.FunctionClass. Instead the object itself is returned.
public GetDefaultValue ( Type hint ) : object
hint System.Type the type hint
Résultat object

GetDelegee() public méthode

Retrieve the delegee.
Retrieve the delegee.
public GetDelegee ( ) : Scriptable
Résultat Scriptable

GetIds() public méthode

public GetIds ( ) : object[]
Résultat object[]

GetParentScope() public méthode

public GetParentScope ( ) : Scriptable
Résultat Scriptable

GetPrototype() public méthode

public GetPrototype ( ) : Scriptable
Résultat Scriptable

Has() public méthode

public Has ( int index, Scriptable start ) : bool
index int
start Scriptable
Résultat bool

Has() public méthode

public Has ( string name, Scriptable start ) : bool
name string
start Scriptable
Résultat bool

HasInstance() public méthode

public HasInstance ( Scriptable instance ) : bool
instance Scriptable
Résultat bool

NewInstance() protected méthode

Crete new Delegator instance.
Crete new Delegator instance. The default implementation calls this.getClass().newInstance().
protected NewInstance ( ) : Delegator
Résultat Delegator

Put() public méthode

public Put ( int index, Scriptable start, object value ) : void
index int
start Scriptable
value object
Résultat void

Put() public méthode

public Put ( string name, Scriptable start, object value ) : void
name string
start Scriptable
value object
Résultat void

SetDelegee() public méthode

Set the delegee.
Set the delegee.
public SetDelegee ( Scriptable obj ) : void
obj Scriptable the delegee
Résultat void

SetParentScope() public méthode

public SetParentScope ( Scriptable parent ) : void
parent Scriptable
Résultat void

SetPrototype() public méthode

public SetPrototype ( Scriptable prototype ) : void
prototype Scriptable
Résultat void

Property Details

obj protected_oe property

protected Scriptable obj
Résultat Scriptable