A class that inherits CoreBundle and is initialized with injection via ninject and wraps the exports of the wpf project.
Inheritance: BalloonsPop.Bundling.CoreBundle
Exemplo n.º 1
0
        /// <summary>
        /// This override sets up the balloons app.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var kernel = new StandardKernel();
            kernel.Bind<ILogger>().ToMethod(x => LogHelper.GetLogger());
            DependancyBinder.Instance
                .RegisterModules(
                                 new ModelsModule(kernel),
                                 new LogicModule(kernel),
                                 new ValidationModule(kernel),
                                 new WpfCommandModule(kernel),
                                 new HighscoreModule(kernel),
                                 new SaverModule(kernel),
                                 new WpfModule(kernel),
                                 new SoundsModule(kernel))
                .LoadAll();

            var bundle = new WpfBundle(kernel);
            var ctx = new Context(kernel);
            var engine = new EventEngine(ctx, bundle);

            this.engine = engine;

            bundle.Gui.Show();
        }
Exemplo n.º 2
0
        public EventEngineTests()
        {
            this.kernel = new StandardKernel();
            this.kernel.Bind<ILogger>().ToMethod(x => LogHelper.GetLogger());
            DependancyBinder.Instance
                .RegisterModules(
                                 new ModelsModule(this.kernel),
                                 new LogicModule(this.kernel),
                                 new ValidationModule(this.kernel),
                                 new WpfCommandModule(this.kernel),
                                 new HighscoreModule(this.kernel),
                                 new SaverModule(this.kernel),
                                 new WpfModule(this.kernel),
                                 new SoundsModule(this.kernel))
                .LoadAll();

            this.bundle = new WpfBundle(this.kernel);
            this.ctx = new Context(this.kernel);
            this.engine = new EventEngine(this.ctx, this.bundle);
            this.view = new BalloonsView();
            this.resources = new Resources();
            this.controller = new MainWindowController(this.view, this.resources);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventEngine" /> class.
 /// </summary>
 /// <param name="ctx"></param>
 /// <param name="depBundle"></param>
 public EventEngine(IContext ctx, WpfBundle depBundle)
     : base(ctx, depBundle.UserInputValidator, depBundle.CommandFactory, depBundle.Logger)
 {
     depBundle.Gui.RaiseCommand += this.HandleUserInput;
     depBundle.Gui.ChangedUserName += this.SetPlayerNameInContext;
 }