2017-10-14 17:58:16 +02:00
|
|
|
|
namespace ElectronNET.API
|
|
|
|
|
|
{
|
2017-10-24 21:43:27 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The Electron.NET API
|
|
|
|
|
|
/// </summary>
|
2017-10-14 17:58:16 +02:00
|
|
|
|
public static class Electron
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Communicate asynchronously from the main process to renderer processes.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static IpcMain IpcMain
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return IpcMain.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-10-14 17:58:16 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Control your application's event lifecycle.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static App App
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return App.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-10-15 06:03:48 +02:00
|
|
|
|
|
2019-05-20 01:08:26 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Enable apps to automatically update themselves. Based on electron-updater.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static AutoUpdater AutoUpdater
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return AutoUpdater.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2019-05-20 01:08:26 +02:00
|
|
|
|
|
2017-10-15 06:03:48 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Control your windows.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static WindowManager WindowManager
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return WindowManager.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-10-15 06:03:48 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Create native application menus and context menus.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static Menu Menu
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return Menu.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-10-15 17:03:07 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Display native system dialogs for opening and saving files, alerting, etc.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static Dialog Dialog
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return Dialog.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-10-15 17:03:07 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Create OS desktop notifications
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static Notification Notification
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return Notification.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-10-15 17:03:07 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Add icons and context menus to the system’s notification area.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static Tray Tray
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return Tray.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-10-21 04:37:01 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Detect keyboard events when the application does not have keyboard focus.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static GlobalShortcut GlobalShortcut
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return GlobalShortcut.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-10-21 04:37:01 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Manage files and URLs using their default applications.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static Shell Shell
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return Shell.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-10-23 19:08:10 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Retrieve information about screen size, displays, cursor position, etc.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static Screen Screen
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return Screen.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-10-23 19:08:10 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Perform copy and paste operations on the system clipboard.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static Clipboard Clipboard
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return Clipboard.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2019-01-05 02:17:31 +01:00
|
|
|
|
|
2019-05-15 23:56:53 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Allows you to execute native JavaScript/TypeScript code from the host process.
|
|
|
|
|
|
///
|
2025-11-15 08:05:31 +01:00
|
|
|
|
/// It is only possible if the Electron.NET CLI has previously added an
|
2019-05-15 23:56:53 +02:00
|
|
|
|
/// ElectronHostHook directory:
|
|
|
|
|
|
/// <c>electronize add HostHook</c>
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static HostHook HostHook
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return HostHook.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-05-11 12:59:21 -05:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-11-15 08:05:31 +01:00
|
|
|
|
/// Allows you to execute native Lock and Unlock process.
|
2020-05-11 12:59:21 -05:00
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static PowerMonitor PowerMonitor
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return PowerMonitor.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-05-13 14:16:36 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Read and respond to changes in Chromium's native color theme.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static NativeTheme NativeTheme
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return NativeTheme.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-06-01 01:59:40 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Control your app in the macOS dock.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static Dock Dock
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return Dock.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-01-02 16:46:14 -05:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Electeon extensions to the Nodejs process object.
|
|
|
|
|
|
/// </summary>
|
2025-11-09 03:50:24 +01:00
|
|
|
|
public static Process Process
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return Process.Instance;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-10-14 17:58:16 +02:00
|
|
|
|
}
|
2020-06-01 01:59:40 +02:00
|
|
|
|
}
|