Пример #1
0
        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
        {
            base.DidRotate(fromInterfaceOrientation);

            // we don't want to fire the event here if there's a splitviewcontroller
            // because it would cause the event to be fired once for each active controller
            if (TouchFactory.Instance.SplitViewController == null)
            {
                switch (InterfaceOrientation)
                {
                case UIInterfaceOrientation.Portrait:
                    TouchFactory.NotifyOrientationChanged(iApp.Orientation.Portrait);
                    break;

                case UIInterfaceOrientation.PortraitUpsideDown:
                    TouchFactory.NotifyOrientationChanged(iApp.Orientation.PortraitUpsideDown);
                    break;

                case UIInterfaceOrientation.LandscapeLeft:
                    TouchFactory.NotifyOrientationChanged(iApp.Orientation.LandscapeLeft);
                    break;

                case UIInterfaceOrientation.LandscapeRight:
                    TouchFactory.NotifyOrientationChanged(iApp.Orientation.LandscapeRight);
                    break;
                }
            }
        }
Пример #2
0
        public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation)
        {
            UIViewController masterViewController = viewControllers[0];
            UIViewController detailViewController = viewControllers[1];

            masterViewController.DidRotate(fromInterfaceOrientation);
            detailViewController.DidRotate(fromInterfaceOrientation);

            switch (InterfaceOrientation)
            {
            case UIInterfaceOrientation.Portrait:
                TouchFactory.NotifyOrientationChanged(iApp.Orientation.Portrait);
                break;

            case UIInterfaceOrientation.PortraitUpsideDown:
                TouchFactory.NotifyOrientationChanged(iApp.Orientation.PortraitUpsideDown);
                break;

            case UIInterfaceOrientation.LandscapeLeft:
                TouchFactory.NotifyOrientationChanged(iApp.Orientation.LandscapeLeft);
                break;

            case UIInterfaceOrientation.LandscapeRight:
                TouchFactory.NotifyOrientationChanged(iApp.Orientation.LandscapeRight);
                break;
            }
        }