Created
February 21, 2010 10:00
-
-
Save sjhewitt/310237 to your computer and use it in GitHub Desktop.
This file contains 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
protected function routeSignalToCommand(signal:ISignal, valueObjects:Array, commandClass:Class, oneshot:Boolean):void | |
{ | |
var command:Object; | |
if(signal is IInjectedSignal) | |
{ | |
IInjectedSignal(signal).mapValues(injector, valueObjects); | |
command = injector.instantiate( commandClass ); | |
IInjectedSignal(signal).unmapValues(injector, valueObjects); | |
} | |
else | |
{ | |
var value:Object; | |
for each( value in valueObjects ) | |
{ | |
injector.mapValue( reflector.getClass(value), value ); | |
} | |
command = injector.instantiate( commandClass ); | |
for each( value in valueObjects ) | |
{ | |
injector.unmap( reflector.getClass(value) ); | |
} | |
} | |
command.execute( ); | |
if ( oneshot ) | |
{ | |
unmapSignal( signal, commandClass ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment