Class ScreenOrientation
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The ScreenOrientation interface of the Screen Orientation API provides information about the current orientation of the document.
[Value("ScreenOrientation")]
public class ScreenOrientation : EventTarget
- Inheritance
-
ScreenOrientation
- Inherited Members
Remarks
A ScreenOrientation instance object can be retrieved using the Orientation property.
Constructors
ScreenOrientation()
public ScreenOrientation()
Properties
Angle
The angle read-only property of the
ScreenOrientation interface returns the document's current orientation
angle.
[Value("angle")]
public ushort Angle { get; }
Property Value
- ushort
An unsigned short integer.
Remarks
Onchange
[Value("onchange")]
public EventHandlerNonNull Onchange { get; set; }
Property Value
Type
The type read-only property of the
ScreenOrientation interface returns the document's current orientation
type, one of portrait-primary, portrait-secondary, landscape-primary, orlandscape-secondary.
[Value("type")]
public OrientationType Type { get; }
Property Value
Remarks
Methods
Lock(OrientationLockType)
The lock() method of the ScreenOrientation interface locks the orientation of the containing document to the specified orientation.
[Value("lock")]
public Task<GlobalObject.Undefined> Lock(OrientationLockType orientation)
Parameters
orientationOrientationLockType
Returns
- Task<GlobalObject.Undefined>
A Promise that resolves after locking succeeds.
Remarks
Typically orientation locking is only enabled on mobile devices, and when the browser context is full screen.
If locking is supported, then it must work for all the parameter values listed below.
Unlock()
The unlock() method of the
ScreenOrientation interface unlocks the orientation of the containing
document from its default orientation.
[Value("unlock")]
public GlobalObject.Undefined Unlock()