implement first dialog-, notification-, tray- and menu-api functions

This commit is contained in:
Gregor Biswanger
2017-10-15 17:03:07 +02:00
parent 8f9a84cb0f
commit 08b88e3adf
32 changed files with 511 additions and 45 deletions

View File

@@ -0,0 +1,39 @@
using ElectronNET.API.Entities;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
namespace ElectronNET.API
{
public sealed class Notification
{
private static Notification _notification;
internal Notification() { }
internal static Notification Instance
{
get
{
if (_notification == null)
{
_notification = new Notification();
}
return _notification;
}
}
public void Show(NotificationOptions notificationOptions)
{
BridgeConnector.Socket.Emit("createNotification", JObject.FromObject(notificationOptions, _jsonSerializer));
}
private JsonSerializer _jsonSerializer = new JsonSerializer()
{
ContractResolver = new CamelCasePropertyNamesContractResolver(),
NullValueHandling = NullValueHandling.Ignore,
DefaultValueHandling = DefaultValueHandling.Ignore
};
}
}