PureMVC.Patterns.Observer Class Reference

A base IObserver implementation. More...

Inheritance diagram for PureMVC.Patterns.Observer:

PureMVC.Interfaces.IObserver

List of all members.

Public Member Functions

 Observer (string notifyMethod, object notifyContext)
 Constructs a new observer with the specified notification method and context.
void NotifyObserver (INotification notification)
 Notify the interested object.
bool CompareNotifyContext (object obj)
 Compare an object to the notification context.

Protected Attributes

readonly object m_syncRoot = new object()
 Used for locking.

Properties

string NotifyMethod [get, set]
 The notification (callback) method of the interested object.
object NotifyContext [get, set]
 The notification context (this) of the interested object.


Detailed Description

A base IObserver implementation.

An Observer is an object that encapsulates information about an interested object with a method that should be called when a particular INotification is broadcast

In PureMVC, the Observer class assumes these responsibilities:

PureMVC.Core.View PureMVC.Patterns.Notification

Constructor & Destructor Documentation

PureMVC.Patterns.Observer.Observer ( string  notifyMethod,
object  notifyContext 
)

Constructs a new observer with the specified notification method and context.

Parameters:
notifyMethod The notification method of the interested object
notifyContext The notification context of the interested object

The notification method on the interested object should take on parameter of type INotification


Member Function Documentation

bool PureMVC.Patterns.Observer.CompareNotifyContext ( object  obj  ) 

Compare an object to the notification context.

This method is thread safe

Parameters:
obj The object to compare
Returns:
Indicating if the object and the notification context are the same

Implements PureMVC.Interfaces.IObserver.

void PureMVC.Patterns.Observer.NotifyObserver ( INotification  notification  ) 

Notify the interested object.

This method is thread safe

Parameters:
notification The INotification to pass to the interested object's notification method

Implements PureMVC.Interfaces.IObserver.


Member Data Documentation

readonly object PureMVC.Patterns.Observer.m_syncRoot = new object() [protected]

Used for locking.


Property Documentation

object PureMVC.Patterns.Observer.NotifyContext [get, set]

The notification context (this) of the interested object.

This accessor is thread safe

Implements PureMVC.Interfaces.IObserver.

string PureMVC.Patterns.Observer.NotifyMethod [get, set]

The notification (callback) method of the interested object.

The notification method should take one parameter of type INotification This accessor is thread safe

Implements PureMVC.Interfaces.IObserver.


The documentation for this class was generated from the following file:

Generated on Thu Jan 1 16:26:46 2009 for PureMVC by  doxygen 1.5.8