Created
July 3, 2011 16:05
-
-
Save bclinkinbeard/1062343 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package control | |
{ | |
public class AlertsController | |
{ | |
[Inject( "alertsDelegate" )] | |
public var delegate:CacheEnabledDelegate; | |
[Inject] | |
public var serviceHelper:IServiceHelper; | |
[Inject] | |
public var model:AlertsModel; | |
[Inject] | |
public var prefs:Prefs; | |
[Inject] | |
public var loadSuccess:AlertsLoadSuccess; | |
[Inject] | |
public var loadFailure:AlertsLoadFailure; | |
[SignalHandler( type="AlertsLoadRequest" )] | |
public function loadAlerts():void | |
{ | |
serviceHelper.executeServiceCall( delegate.load( model.alerts != null ), loadAlerts_result, loadAlerts_fault ); | |
} | |
protected function loadAlerts_result( data:Object ):void | |
{ | |
model.setAlerts( data.result as ArrayCollection ); | |
prefs.alertsLastUpdated = new Date(); | |
prefs.save(); | |
loadSuccess.dispatch(); | |
} | |
protected function loadAlerts_fault( info:Object ):void | |
{ | |
loadFailure.dispatch(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment