mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-07-20 07:35:47 +00:00
implement lazy App.Ready event
This commit is contained in:
@@ -356,7 +356,24 @@ namespace ElectronNET.API
|
||||
/// <summary>
|
||||
/// Emitted when the application has finished basic startup.
|
||||
/// </summary>
|
||||
public event Action Ready;
|
||||
public event Action Ready
|
||||
{
|
||||
add
|
||||
{
|
||||
if(IsReady)
|
||||
{
|
||||
value();
|
||||
}
|
||||
|
||||
_ready += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
_ready -= value;
|
||||
}
|
||||
}
|
||||
|
||||
private event Action _ready;
|
||||
|
||||
/// <summary>
|
||||
/// Application host fully started.
|
||||
@@ -370,7 +387,7 @@ namespace ElectronNET.API
|
||||
|
||||
if(value)
|
||||
{
|
||||
Ready?.Invoke();
|
||||
_ready?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user