210 {
211 if ((orientation & (DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight | DisplayOrientation.Portrait)) != 0)
212 {
213 return orientation;
214 }
215 if (width > height)
216 {
217 if (allowLandscapeLeftAndRight)
218 {
219 return DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
220 }
221 return DisplayOrientation.LandscapeLeft;
222 }
223 return DisplayOrientation.Portrait;
224 }