Example #1
0
        public void Trigger(MediationEvent evt, IView view)
        {
            Type viewType             = view.GetType();
            IMediationBinding binding = GetBinding(viewType) as IMediationBinding;

            if (binding != null)
            {
                switch (evt)
                {
                case MediationEvent.AWAKE:
                    InjectViewAndChildren(view);
                    MapView(view, binding);
                    break;

                case MediationEvent.DESTROYED:
                    UnmapView(view, binding);
                    break;

                default:
                    break;
                }
            }
            else if (evt == MediationEvent.AWAKE)
            {
                //Even if not mapped, Views (and their children) have potential to be injected
                InjectViewAndChildren(view);
            }
        }
Example #2
0
        public void Trigger(MediationEvent evt, IView view)
        {
            var viewType = view.GetType();

            if (GetBinding(viewType) is IMediationBinding binding)
            {
                switch (evt)
                {
                case MediationEvent.AWAKE:
                    InjectViewAndChildren(view);
                    MapView(view, binding);
                    break;

                case MediationEvent.DESTROYED:
                    UnmapView(view, binding);
                    break;

                case MediationEvent.ENABLED:
                    EnableView(view, binding);
                    break;

                case MediationEvent.DISABLED:
                    DisableView(view, binding);
                    break;
                }
            }
            else if (evt == MediationEvent.AWAKE)
            {
                //Even if not mapped, Views (and their children) have potential to be injected
                InjectViewAndChildren(view);
            }
        }
Example #3
0
        public void Trigger(MediationEvent evt, IView view)
        {
            Type viewType             = view.GetType();
            IMediationBinding binding = GetBinding(viewType) as IMediationBinding;

            if (binding != null)
            {
                switch (evt)
                {
                case MediationEvent.AWAKE:
                    MapView(view, binding);
                    break;

                case MediationEvent.DESTROYED:
                    UnmapView(view, binding);
                    break;

                case MediationEvent.ENABLED:
                    EnableView(view, binding);
                    break;

                case MediationEvent.DISABLED:
                    DisableView(view, binding);
                    break;

                default:
                    break;
                }
            }
            else
            {
                Debug.Log("Hello there, you are trying to bind " + view + " without a mediation. This is not allowed.");
            }
        }
        public void Trigger(MediationEvent evt, IView view)
        {
            var hollyView = view as IHollywoodView;
            var viewType  = hollyView.GetType();
            var binding   = GetBinding(viewType) as IMediationBinding;

            if (binding != null)
            {
                switch (evt)
                {
                case MediationEvent.AWAKE:
                    injectActorAndChildren(hollyView);
                    mapView(hollyView, binding);
                    break;

                case MediationEvent.DESTROYED:
                    unmapActor(hollyView, binding);
                    break;

                default:
                    break;
                }
            }
            else if (evt == MediationEvent.AWAKE)
            {
                //Even if not mapped, Views (and their children) have potential to be injected
                injectActorAndChildren(hollyView);
            }
        }
            public void Trigger(MediationEvent evt, IView view)
            {
                StubCameraMediator mediator = new StubCameraMediator();

                injectionBinder.Bind <MockCameraView>().ToValue(view);
                injectionBinder.injector.Inject(mediator);
                injectionBinder.Unbind <MockCameraView>();
                mediator.OnRegister();
            }
Example #6
0
        public void Trigger(MediationEvent evt, IView view)
        {
            MockMediator mediator = new MockMediator();

            mediator.PreRegister();
            injectionBinder.Bind <MockView>().ToValue(view);
            injectionBinder.injector.Inject(mediator);
            injectionBinder.Unbind <MockView>();
            mediator.OnRegister();
        }