void HookupApplicationEvents() { IInjectionBinder binder = ((MainContext)context).injectionBinder; IApplicationEvents appEvents = GameApplication.Instance.ApplicationEvents; appEvents.Paused += () => binder.GetInstance <GamePausedSignal>().Dispatch(); appEvents.Resumed += t => binder.GetInstance <GameResumedSignal>().Dispatch(t); appEvents.LostFocus += () => binder.GetInstance <FocusLostSignal>().Dispatch(); appEvents.GainedFocus += () => binder.GetInstance <FocusGainedSignal>().Dispatch(); ISceneManager sceneManager = _moduleContainer.ServiceResolver.Get <ISceneManager>(); sceneManager.TransitionOutStarted += s => binder.GetInstance <SceneTransitionOutStartedSignal>().Dispatch(s); sceneManager.TransitionOutEnded += s => binder.GetInstance <SceneTransitionOutEndedSignal>().Dispatch(s); sceneManager.TransitionInStarted += s => binder.GetInstance <SceneTransitionInStartedSignal>().Dispatch(s); sceneManager.TransitionInEnded += s => binder.GetInstance <SceneTransitionInEndedSignal>().Dispatch(s); sceneManager.SceneLoadStarted += s => binder.GetInstance <SceneLoadStartedSignal>().Dispatch(s); sceneManager.SceneLoaded += s => binder.GetInstance <SceneLoadedSignal>().Dispatch(s); }
public CargoInspectionService(IApplicationEvents applicationEvents, ICargoRepository cargoRepository, IHandlingEventRepository handlingEventRepository) { this.applicationEvents = applicationEvents; this.cargoRepository = cargoRepository; this.handlingEventRepository = handlingEventRepository; }
public HandlingEventService(IHandlingEventRepository handlingEventRepository, IApplicationEvents applicationEvents, HandlingEventFactory handlingEventFactory) { this.handlingEventRepository = handlingEventRepository; this.applicationEvents = applicationEvents; this.handlingEventFactory = handlingEventFactory; }
public UploadDirectoryScanner(uint scanPeriod, IApplicationEvents appEvents, DirectoryInfo uploadDirectory, DirectoryInfo parseFailureDirectory) { ScanPeriod = scanPeriod; AppEvents = appEvents; UploadDirectory = uploadDirectory; ParseFailureDirectory = parseFailureDirectory; TimerCanceled = false; }
private GameApplication() { //FIXME: unity doesn't like this line, can't figure out why... //all of a sudden, it started printing an error message when there's this early access to the //s_instance variable - very strange, possibly a Unity bug, may be related to some static //initialization //Debugger.Assert(s_instance == null, "cannot call GameApplication constructor twice!"); _assetManager = new UnityAssetManager(this); CreateServiceResolver(); _applicationEvents = new ApplicaitonEvents(this); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Forms.Init(); _window = new UIWindow(UIScreen.MainScreen.Bounds); var navigation = new Navigation.Navigation(); AppBase = CreateApp(); LoadApplication(AppBase); AppBase.InitializeContainer(builder => { builder.RegisterType<LocalServerDiscovery>().As<ILocalServerDiscovery>().SingleInstance(); builder.RegisterType<Contacts.Contacts>().As<IContacts>().SingleInstance(); builder.RegisterType<ImageHelper>().As<IImageHelper>().SingleInstance(); builder.RegisterType<KeyboardHelper>().As<IKeyboardHelper>().SingleInstance(); builder.RegisterType<SocialMediaConnections>().As<ISocialMediaConnections>().SingleInstance(); builder.RegisterType<InAppPurchase>().As<IInAppPurchase>().SingleInstance(); builder.RegisterType<Share>().As<IShare>().SingleInstance(); builder.RegisterInstance(new UriHelper(app)).As<IUriHelper>().SingleInstance(); builder.RegisterInstance(navigation).As<INavigation>().SingleInstance(); OnInitializeContainer(builder); }); _applicationEvents = AppBase.ComponentContext.Resolve<IApplicationEvents>(); _window.RootViewController = AppBase.GetMainPage().CreateViewController(); navigation.RootViewController = _window.RootViewController; _window.MakeKeyAndVisible(); return true; }
public HandlingReportService(IApplicationEvents applicationEvents) { this.applicationEvents = applicationEvents; }
public MainWindowViewModel(Application application, IEnumerable <ExecutableBackupPlan> executableBackupPlans, IApplicationEvents applicationEvents) { this.application = application; this.executableBackupPlans = executableBackupPlans; BackupPlans = new ObservableCollection <BackupPlanModel>(); applicationEvents.ConfigurationReloaded += (sender, e) => { UpdatePlanViewModels(); }; UpdatePlanViewModels(); }
public HandleLeaderElection(IApplicationEvents applicationEvents) { _applicationEvents = applicationEvents; }