示例#1
0
 /// <summary>
 /// This is method is invoked with GameManagers container property is first invoked to setup the bare essential uFrame necessities.
 /// </summary>
 /// <param name="manager">The game manager instance.</param>
 /// <param name="container"></param>
 public static void Configure(GameManager manager, IGameContainer container)
 {
     // The view resolver is the class that will find a view-prefab from a view-model
     container.RegisterInstance <IViewResolver>(new ViewResolver());
     // The game manager is the default command dispatcher
     container.RegisterInstance <ICommandDispatcher>(manager);
 }
    /// <summary>
    /// This is method is invoked with GameManagers container property is first invoked to setup the bare essential uFrame necessities.
    /// </summary>
    /// <param name="manager">The game manager instance.</param>
    /// <param name="container"></param>
    public static void Configure(GameManager manager, IGameContainer container)
    {
        // The view resolver is the class that will find a view-prefab from a view-model
        container.RegisterInstance<IViewResolver>(new ViewResolver());
        // The game manager is the default command dispatcher
        container.RegisterInstance<ICommandDispatcher>(manager);


    }
示例#3
0
 public static void RegisterController <TController>(this IGameContainer container, TController controller) where TController : Controller
 {
     container.RegisterInstance <Controller>(controller, controller.GetType().Name, false);
     container.RegisterInstance <TController>(controller, false);
 }
示例#4
0
 public static void RegisterViewModel <TViewModel>(this IGameContainer container, TViewModel viewModel, string identifier) where TViewModel : ViewModel
 {
     container.Register <TViewModel, TViewModel>();
     container.RegisterInstance <ViewModel>(viewModel, identifier);
     container.RegisterInstance(typeof(TViewModel), viewModel, identifier);
 }