Show / Hide Table of Contents

Interface IShellComponent

Interface for interacting with operating system features.

Inherited Members
IPalComponent.Name
IPalComponent.Provides
IPalComponent.Logger
IPalComponent.Initialize(ToolkitOptions)
IPalComponent.Uninitialize()
Namespace: OpenTK.Platform
Assembly: OpenTK.Platform.dll
Syntax
public interface IShellComponent : IPalComponent

Methods

AllowScreenSaver(bool, string?)

Sets whether or not a screensaver is allowed to draw on top of the window. For games with long cutscenes it would be appropriate to set this to false, while tools that act like normal applications should set this to true. By default this setting is untouched.

Declaration
void AllowScreenSaver(bool allow, string? disableReason)
Parameters
Type Name Description
bool allow

Whether to allow screensavers to appear while the application is running.

string disableReason

A reason for why the screen saver is disabled. This string should both contain the reason why the screen saver is disabed as well as the name of the application so the user knows which application is preventing the screen saver from running. If null is sent the following default message will be sent:

$"{ApplicationName} is is preventing screen saver."
See Also
IsScreenSaverAllowed()

GetBatteryInfo(out BatteryInfo)

Gets the battery status of the computer.

Declaration
BatteryStatus GetBatteryInfo(out BatteryInfo batteryInfo)
Parameters
Type Name Description
BatteryInfo batteryInfo

The battery status of the computer, this is only filled with values when HasSystemBattery is returned.

Returns
Type Description
BatteryStatus

Whether the computer has a battery or not, or if this function failed.

GetPreferredTheme()

Gets the user preference for application theme.

Declaration
ThemeInfo GetPreferredTheme()
Returns
Type Description
ThemeInfo

The user set preferred theme.

See Also
ThemeChangeEventArgs

GetSystemMemoryInformation()

Gets information about the memory of the device and the current status.

Declaration
SystemMemoryInfo GetSystemMemoryInformation()
Returns
Type Description
SystemMemoryInfo

The memory info.

IsScreenSaverAllowed()

Gets if the screen saver is allowed to run or not.

Declaration
bool IsScreenSaverAllowed()
Returns
Type Description
bool

If the screen saver is allowed to run.

See Also
AllowScreenSaver(bool, string?)

See Also

Shell
In this article
Back to top Generated by DocFX