mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-11 05:34:34 +00:00
Add method to destroy all windows manually
This commit is contained in:
@@ -218,6 +218,19 @@ namespace ElectronNET.API
|
||||
return await taskCompletionSource.Task;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Destroy all windows.
|
||||
/// </summary>
|
||||
/// <returns>Number of windows destroyed</returns>
|
||||
public async Task<int> DestroyAllWindows()
|
||||
{
|
||||
var destroyed = await BridgeConnector.OnResult<int>("browserWindowDestroyAll", "browserWindowDestroyAll-completed");
|
||||
_browserViews.Clear();
|
||||
_browserWindows.Clear();
|
||||
return destroyed;
|
||||
}
|
||||
|
||||
private static JsonSerializer _jsonSerializer = new JsonSerializer()
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
|
||||
Reference in New Issue
Block a user