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
| public class WarnIfCurrentEditDataIsChangedCommand extends Command | |
| { | |
| [Inject] | |
| public var getEditedVOSignalResponsePair:GetEditedVOSignalResponsePair; | |
| [Inject] | |
| public var editingModel:IEditingModel; | |
| [Inject] | |
| public var dataChangeEvent:AdminDataEvent; |
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
| public interface ICompoundInterface extends IDrawable, IEdible | |
| { | |
| } | |
| public class SomethingConcrete implements IDrawable, IEdible | |
| { | |
| } | |
| // throws type conversion error | |
| var concreteThing:ICompoundInterface = ICompoundInterface(new SomethingConcrete()); |
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
| private function isACommand(commandClazz:Class):Boolean | |
| { | |
| if(describeType(commandClazz).factory.method.(@name == "execute").length() > 0) | |
| { | |
| return true; | |
| } | |
| return false; | |
| } |
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
| [Inject] | |
| public function set requestScreenDataSyncSignalPair(signal:RequestScreenDataSyncSignalPair):void | |
| { | |
| _requestScreenDataSyncSignalPair = signal; | |
| } | |
| override public function onRegister():void | |
| { | |
| eventMap.mapListener(eventDispatcher, UserDataSetEvent.DATA_SET_UPDATED, dataSetUpdatedHandler); |
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
| // params: command, isOneShot, requireInOrder | |
| compoundCommandMap.mapToEvents(SomeAwesomeCommand, true, true) | |
| .addRequiredEvent(SomeEvent.SOMETHING_HAPPENED, SomeEvent); | |
| .addRequiredEvent(SomeOtherEvent.SOMETHING_ELSE_HAPPENED, SomeOtherEvent, 'somethingElseHappened'); | |
| .addRequiredEvent(SomeOtherEvent.STUFF_HAPPENED, SomeOtherEvent, 'stuffHappened'); | |
| // in the command itself | |
| [Inject] | |
| public var someEvent:SomeEvent; |
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 com.client.project.xendtoendtests { | |
| import asunit.framework.TestCase; | |
| import AcademyShell; | |
| import shell.AcademyShellSkin; | |
| import com.newloop.roboteyes.inViewOf; | |
| import com.newloop.roboteyes.core.RobotEyes; |
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
| // Good mediator behaviour: | |
| function handleDataEvent(e:DataEvent):void | |
| { | |
| var userVO:UserVO = e.userVO; | |
| view.showUsername(userVO.firstname, userVO.surname); | |
| view.showAge(userVO.age); | |
| view.setStatus(userVO.isSaved); | |
| } |
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
| ////////// code in a robotlegs mediator | |
| private function someHandler(e:Event):void | |
| { | |
| // whatever | |
| } | |
| // this mediator adds the handler to the relaxedEventMap | |
| override public function onRegister():void |
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
| // code required in your context startup - this uses Config::Variables to set the logger at compile time, | |
| // but you could just swap it in/out as required and do away with the if/else etc | |
| commandMap.mapEvent(LoggingEvent.LOG_EVENT, UpdateLogCommand, LoggingEvent); | |
| if(CONFIG::HiddenLogging) | |
| { | |
| injector.mapSingletonOf(ILoggingService, TraceLoggingService); | |
| } | |
| else if(CONFIG::EmailLogging) |
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 strategy.xendtoendtests { | |
| // imports removed for brevity | |
| public class PyramidGameEndToEndTest extends TestCase { | |
| private var robotEyes:RobotEyes; | |
| private var config:IGameConfig; | |
| private var endToEndTests:Vector.<Class>; | |
| private var runningEndToEndTests:Boolean; | |
| private var dummyDispatcher:EventDispatcher = new EventDispatcher(); |