mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-07-19 15:16:20 +00:00
implement all BrowserWindow API Events and the rest of missed functions
This commit is contained in:
39
ElectronNET.API/Extensions/ThumbarButtonExtensions.cs
Normal file
39
ElectronNET.API/Extensions/ThumbarButtonExtensions.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using ElectronNET.API.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ElectronNET.API.Extensions
|
||||
{
|
||||
internal static class ThumbarButtonExtensions
|
||||
{
|
||||
public static ThumbarButton[] AddThumbarButtonsId(this ThumbarButton[] thumbarButtons)
|
||||
{
|
||||
for (int index = 0; index < thumbarButtons.Length; index++)
|
||||
{
|
||||
var thumbarButton = thumbarButtons[index];
|
||||
|
||||
if (string.IsNullOrEmpty(thumbarButton.Id))
|
||||
{
|
||||
thumbarButton.Id = Guid.NewGuid().ToString();
|
||||
}
|
||||
}
|
||||
|
||||
return thumbarButtons;
|
||||
}
|
||||
|
||||
public static ThumbarButton GetThumbarButton(this List<ThumbarButton> thumbarButtons, string id)
|
||||
{
|
||||
ThumbarButton result = new ThumbarButton("");
|
||||
|
||||
foreach (var item in thumbarButtons)
|
||||
{
|
||||
if (item.Id == id)
|
||||
{
|
||||
result = item;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user