public override void Execute(INotification notification)
        {
            ApplicationStateProxy stateProxy = Facade.RetrieveProxy(ApplicationStateProxy.NAME) as ApplicationStateProxy;
            Mediator mediator;

            switch (notification.Name)
            {
            case Notifications.SEND_UI_ACTION:
                ViewComponentConfig config = (notification.Body as ViewComponentConfig);
                switch (config.actions)
                {
                /*
                 * This space reserved for additional checks on actions. For example showing the user a modal first if confirmation is needed.
                 */
                case UIActions.TAKE_PHOTO:
                    mediator = Facade.RetrieveMediator(PhoneCamMediator.NAME) as PhoneCamMediator;
                    (mediator as PhoneCamMediator).TakePicture();
                    break;

                case UIActions.LOAD_PHOTO:
                    mediator = Facade.RetrieveMediator(PhoneCamMediator.NAME) as PhoneCamMediator;
                    (mediator as PhoneCamMediator).LoadPicture();
                    break;

                case UIActions.UPLOAD_PHOTO:
                    SendNotification(Notifications.REQUEST_RETRIEVE_DATA);
                    break;

                case UIActions.RESET_PHOTO:
                    stateProxy.SetState(ApplicationStates.USING_CAMERA);
                    Debug.Log("reset  photo action heard");
                    break;

                default:
                    break;
                }
                break;

            default:
                break;
            }
        }
예제 #2
0
        public override void Execute(INotification notification)
        {
            ApplicationStateProxy stateProxy = Facade.RetrieveProxy(ApplicationStateProxy.NAME) as ApplicationStateProxy;

            stateProxy.SetState(ApplicationStates.USING_CAMERA);
        }