Microsoft.Xna.Framework.AndroidCompatibility.GetDeviceNaturalOrientation C# (CSharp) Method

GetDeviceNaturalOrientation() private static method

private static GetDeviceNaturalOrientation ( ) : Orientation
return Orientation
        private static Orientation GetDeviceNaturalOrientation()
        {
            var orientation = Game.Activity.Resources.Configuration.Orientation;
            SurfaceOrientation rotation = Game.Activity.WindowManager.DefaultDisplay.Rotation;

            if (((rotation == SurfaceOrientation.Rotation0 || rotation == SurfaceOrientation.Rotation180) &&
                orientation == Orientation.Landscape)
                || ((rotation == SurfaceOrientation.Rotation90 || rotation == SurfaceOrientation.Rotation270) &&
                orientation == Orientation.Portrait))
            {
                return Orientation.Landscape;
            }
            else
            {
                return Orientation.Portrait;
            }
        }