IView implementation.
More...

Public Member Functions | |
| virtual void | RegisterObserver (string notificationName, IObserver observer) |
Register an IObserver to be notified of INotifications with a given name. | |
| virtual void | NotifyObservers (INotification notification) |
Notify the IObservers for a particular INotification. | |
| virtual void | RemoveObserver (string notificationName, object notifyContext) |
| Remove the observer for a given notifyContext from an observer list for a given Notification name. | |
| virtual void | RegisterMediator (IMediator mediator) |
Register an IMediator instance with the View. | |
| virtual IMediator | RetrieveMediator (string mediatorName) |
Retrieve an IMediator from the View. | |
| virtual IMediator | RemoveMediator (string mediatorName) |
Remove an IMediator from the View. | |
| virtual bool | HasMediator (string mediatorName) |
| Check if a Mediator is registered or not. | |
Protected Member Functions | |
| View () | |
| virtual void | InitializeView () |
| Initialize the Singleton View instance. | |
Protected Attributes | |
| IDictionary< string, IMediator > | m_mediatorMap |
| IDictionary< string, IList < IObserver > > | m_observerMap |
| Mapping of Notification names to Observer lists. | |
| readonly object | m_syncRoot = new object() |
| Used for locking. | |
Static Protected Attributes | |
| static volatile IView | m_instance |
| Singleton instance. | |
| static readonly object | m_staticSyncRoot = new object() |
| Used for locking the instance calls. | |
Properties | |
| static IView | Instance [get] |
| View Singleton Factory method. This method is thread safe. | |
IView implementation.
In PureMVC, the View class assumes these responsibilities:
IMediator instances IMediators INotification in the application IObservers to an INotification's observer list INotification IObservers of a given INotification when it broadcast | PureMVC.Core.View.View | ( | ) | [protected] |
Constructs and initializes a new view
This IView implementation is a Singleton, so you should not call the constructor directly, but instead call the static Singleton Factory method View.Instance
| virtual bool PureMVC.Core.View.HasMediator | ( | string | mediatorName | ) | [virtual] |
Check if a Mediator is registered or not.
| mediatorName |
mediatorName
Implements PureMVC.Interfaces.IView.
| virtual void PureMVC.Core.View.InitializeView | ( | ) | [protected, virtual] |
Initialize the Singleton View instance.
Called automatically by the constructor, this is your opportunity to initialize the Singleton instance in your subclass without overriding the constructor
| virtual void PureMVC.Core.View.NotifyObservers | ( | INotification | notification | ) | [virtual] |
Notify the IObservers for a particular INotification.
| notification | The INotification to notify IObservers of |
All previously attached IObservers for this INotification's list are notified and are passed a reference to the INotification in the order in which they were registered
This method is thread safe and needs to be thread safe in all implementations.
Implements PureMVC.Interfaces.IView.
| virtual void PureMVC.Core.View.RegisterMediator | ( | IMediator | mediator | ) | [virtual] |
Register an IMediator instance with the View.
| mediator | A reference to the IMediator instance |
Registers the IMediator so that it can be retrieved by name, and further interrogates the IMediator for its INotification interests
If the IMediator returns any INotification names to be notified about, an Observer is created encapsulating the IMediator instance's handleNotification method and registering it as an Observer for all INotifications the IMediator is interested in
This method is thread safe and needs to be thread safe in all implementations.
Implements PureMVC.Interfaces.IView.
| virtual void PureMVC.Core.View.RegisterObserver | ( | string | notificationName, | |
| IObserver | observer | |||
| ) | [virtual] |
Register an IObserver to be notified of INotifications with a given name.
| notificationName | The name of the INotifications to notify this IObserver of | |
| observer | The IObserver to register |
Implements PureMVC.Interfaces.IView.
| virtual IMediator PureMVC.Core.View.RemoveMediator | ( | string | mediatorName | ) | [virtual] |
Remove an IMediator from the View.
| mediatorName | The name of the IMediator instance to be removed |
Implements PureMVC.Interfaces.IView.
| virtual void PureMVC.Core.View.RemoveObserver | ( | string | notificationName, | |
| object | notifyContext | |||
| ) | [virtual] |
Remove the observer for a given notifyContext from an observer list for a given Notification name.
| notificationName | which observer list to remove from | |
| notifyContext | remove the observer with this object as its notifyContext |
Implements PureMVC.Interfaces.IView.
| virtual IMediator PureMVC.Core.View.RetrieveMediator | ( | string | mediatorName | ) | [virtual] |
Retrieve an IMediator from the View.
| mediatorName | The name of the IMediator instance to retrieve |
IMediator instance previously registered with the given mediatorNameImplements PureMVC.Interfaces.IView.
volatile IView PureMVC.Core.View.m_instance [static, protected] |
Singleton instance.
IDictionary<string, IMediator> PureMVC.Core.View.m_mediatorMap [protected] |
Mapping of Mediator names to Mediator instances
IDictionary<string, IList<IObserver> > PureMVC.Core.View.m_observerMap [protected] |
Mapping of Notification names to Observer lists.
readonly object PureMVC.Core.View.m_staticSyncRoot = new object() [static, protected] |
Used for locking the instance calls.
readonly object PureMVC.Core.View.m_syncRoot = new object() [protected] |
Used for locking.
IView PureMVC.Core.View.Instance [static, get] |
View Singleton Factory method. This method is thread safe.
1.5.8