Created
August 8, 2013 13:44
-
-
Save dpeek/6184694 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
class Main | |
{ | |
static function main() | |
{ | |
var context = new MyContext(new View()); | |
} | |
} | |
class MyContext extends mmvc.impl.Context | |
{ | |
public function new(context:mmvc.api.IViewContainer) | |
{ | |
super(context); | |
} | |
override function startup() | |
{ | |
super.startup(); | |
commandMap.mapSignalClass(MySignal, MyCommand1); | |
commandMap.mapSignalClass(MySignal, MyCommand2); | |
var signal = injector.getInstance(MySignal); | |
signal.dispatch(); | |
} | |
} | |
class View implements mmvc.api.IViewContainer | |
{ | |
public function new() {} | |
public var viewAdded:Dynamic -> Void; | |
public var viewRemoved:Dynamic -> Void; | |
public function isAdded(view:Dynamic):Bool return true; | |
} | |
class MySignal extends msignal.Signal.Signal0 | |
{ | |
public function new() super(); | |
} | |
class MyCommand1 extends mmvc.impl.Command | |
{ | |
override function execute() trace("command 1"); | |
} | |
class MyCommand2 extends mmvc.impl.Command | |
{ | |
override function execute() trace("command 2"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment