PureMVC.Patterns.Mediator Class Reference

A base IMediator implementation. More...

Inheritance diagram for PureMVC.Patterns.Mediator:

PureMVC.Patterns.Notifier PureMVC.Interfaces.IMediator PureMVC.Interfaces.INotifier PureMVC.Interfaces.INotifier

List of all members.

Public Member Functions

 Mediator ()
 Mediator (string mediatorName)
 Constructs a new mediator with the specified name and no view component.
 Mediator (string mediatorName, object viewComponent)
 Constructs a new mediator with the specified name and view component.
virtual IList< string > ListNotificationInterests ()
 List the INotification names this Mediator is interested in being notified of.
virtual void HandleNotification (INotification notification)
 Handle INotifications.
virtual void OnRegister ()
 Called by the View when the Mediator is registered.
virtual void OnRemove ()
 Called by the View when the Mediator is removed.

Public Attributes

const string NAME = "Mediator"

Protected Attributes

string m_mediatorName
object m_viewComponent
 The view component being mediated.

Properties

virtual string MediatorName [get]
object ViewComponent [get, set]
 The
IMediator
's view component.


Detailed Description

A base IMediator implementation.

PureMVC.Core.View


Constructor & Destructor Documentation

PureMVC.Patterns.Mediator.Mediator (  ) 

Constructs a new mediator with the default name and no view component

PureMVC.Patterns.Mediator.Mediator ( string  mediatorName  ) 

Constructs a new mediator with the specified name and no view component.

Parameters:
mediatorName The name of the mediator

PureMVC.Patterns.Mediator.Mediator ( string  mediatorName,
object  viewComponent 
)

Constructs a new mediator with the specified name and view component.

Parameters:
mediatorName The name of the mediator
viewComponent The view component to be mediated


Member Function Documentation

virtual void PureMVC.Patterns.Mediator.HandleNotification ( INotification  notification  )  [virtual]

Handle INotifications.

Parameters:
notification The INotification instance to handle

Typically this will be handled in a switch statement, with one 'case' entry per INotification the Mediator is interested in.

Implements PureMVC.Interfaces.IMediator.

virtual IList<string> PureMVC.Patterns.Mediator.ListNotificationInterests (  )  [virtual]

List the INotification names this Mediator is interested in being notified of.

Returns:
The list of INotification names

Implements PureMVC.Interfaces.IMediator.

virtual void PureMVC.Patterns.Mediator.OnRegister (  )  [virtual]

Called by the View when the Mediator is registered.

Implements PureMVC.Interfaces.IMediator.

virtual void PureMVC.Patterns.Mediator.OnRemove (  )  [virtual]

Called by the View when the Mediator is removed.

Implements PureMVC.Interfaces.IMediator.


Member Data Documentation

The mediator name

The view component being mediated.

const string PureMVC.Patterns.Mediator.NAME = "Mediator"

The name of the Mediator

Typically, a Mediator will be written to serve one specific control or group controls and so, will not have a need to be dynamically named


Property Documentation

virtual string PureMVC.Patterns.Mediator.MediatorName [get]

The name of the Mediator

You should override this in your subclass

Implements PureMVC.Interfaces.IMediator.

object PureMVC.Patterns.Mediator.ViewComponent [get, set]

The

IMediator
's view component.

Additionally, an implicit getter will usually be defined in the subclass that casts the view object to a type, like this:

                                private System.Windows.Form.ComboBox comboBox {
                                    get { return viewComponent as ComboBox; }
                                }

Implements PureMVC.Interfaces.IMediator.


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