Created
February 11, 2010 01:45
-
-
Save bclinkinbeard/301114 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 org.robotlegs.examples.imagegallery | |
| { | |
| // imports removed for brevity | |
| public class ImageGalleryContext extends SignalContext | |
| { | |
| private const VIEW_PACKAGE:String = "org.robotlegs.examples.imagegallery.view.components"; | |
| private const LOAD_GALLERY:String = "loadGallery"; | |
| private var appStarted:ApplicationStartedSignal; | |
| override public function startup():void | |
| { | |
| //map the views | |
| viewMap.mapPackage(VIEW_PACKAGE); | |
| //map the presentation models | |
| injector.mapSingletonOf( IGalleryViewPresentationModel, GalleryViewPresentationModel ); | |
| injector.mapSingletonOf( IGalleryThumbnailsPresentationModel, GalleryThumbnailsPresentationModel ); | |
| //map the services and their factories | |
| injector.mapSingletonOf( IGalleryImageService, XMLImageService ); | |
| injector.mapSingletonOf( IGalleryFactory, XMLGalleryFactory ); | |
| //map the signals | |
| injector.mapSingleton(GalleryUpdatedSignal); | |
| injector.mapSingleton(GalleryImageSelectedSignal); | |
| ApplicationStartedSignal(signalCommandMap.mapSignalClass( | |
| ApplicationStartedSignal, LoadGalleryCommand, true)).dispatch(); | |
| } | |
| } | |
| } |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <swiz:Swiz xmlns:fx="http://ns.adobe.com/mxml/2009" | |
| xmlns:removed for brevity> | |
| <swiz:config> | |
| <swiz:SwizConfig viewPackages="org.robotlegs.examples.imagegallery.view.components" /> | |
| </swiz:config> | |
| <swiz:beanProviders> | |
| <swiz:BeanProvider> | |
| <models:GalleryViewPresentationModel /> | |
| <models:GalleryThumbnailsPresentationModel /> | |
| <service:XMLImageService /> | |
| <factories:XMLGalleryFactory /> | |
| <signals:GalleryUpdatedSignal /> | |
| <signals:GalleryImageSelectedSignal /> | |
| <controller:LoadGalleryCommand /> | |
| </swiz:BeanProvider> | |
| </swiz:beanProviders> | |
| </swiz:Swiz> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment