Esempio n. 1
0
        private static IDisposable ConnectLeftUp(IInputSource source, IInputTarget target)
        {
#if USE_CUSTOM_OBSERVER
            var observer = new InputArgsObserver(target, OnNextLeftUp);
            return(source.LeftUp.Subscribe(observer));

            void OnNextLeftUp(IInputTarget target, InputArgs args)
#else
            return(source.LeftUp.Subscribe(OnNextLeftUp));

            void OnNextLeftUp(InputArgs args)
#endif
            {
                if (target.IsLeftUpAvailable())
                {
                    target.LeftUp(args);
                }
            }
        }
Esempio n. 2
0
        private static IDisposable ConnectRightDown(IInputSource source, IInputTarget target)
        {
#if USE_CUSTOM_OBSERVER
            var observer = new InputArgsObserver(target, OnNextRightDown);
            return(source.RightDown.Subscribe(observer));

            void OnNextRightDown(IInputTarget target, InputArgs args)
#else
            return(source.RightDown.Subscribe(OnNextRightDown));

            void OnNextRightDown(InputArgs args)
#endif
            {
                if (target.IsRightDownAvailable())
                {
                    target.RightDown(args);
                }
            }
        }
Esempio n. 3
0
        private static IDisposable ConnectLeftDown(IInputSource source, IInputTarget target)
        {
            var observer = new InputArgsObserver(target, OnNextLeftDown);

            return(source.LeftDown.Subscribe(observer));