Notifications Center


Create Notifications Center :

var notificationsCenter = nodefony.notificationsCenter.create();

Listen an event of Notification Center :

wrapper of addListener

//listen an event of notification center   : (context, eventName, callback) 
notificationsCenter.listen(myContext, "onReady", function(myArg){
	// where this is argument myContext 
	console.log(this);
});

Fire an event of Notification Center :

Wrapper of emitter.emit

//Fire an event of notification center   : (eventName, argument ...) 
notificationsCenter.fire("onReady", myArg);

Automatically add events in Notification Center :

Is useful to Automatically add events when you you have somme settings (configurations ).
settingsToListen find all Events Name who begin by "on" on the setting object and

//Add events with settings in notification center   : (localSettings, context) 
notificationsCenter.settingsToListen({
	display:true,
	onBoot:function {
		// here context is mycontext
		console.log(this)
	},
	onInitialize: function{
		// here context is mycontext
		console.log(this)
	},
	exclude: /^test$/
}, mycontext);

Unlisten an event of Notification Center :

var callback = function(myArg1, myArg2){
	...
};

notificationsCenter.listen(this, "onReady", callback);

//Unlisten an event of notification center   : (eventName, listener) 
notificationsCenter.Unlisten("onReady", callback);

remove All Listeners of an event of Notification Center :

//Unlisten all listeners   of an event Name  notification center   : ([eventName]) 
notificationsCenter.removeAllListeners("onReady");