forked from ElectronNET/Electron.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotificationOptions.cs
More file actions
151 lines (131 loc) · 4.58 KB
/
NotificationOptions.cs
File metadata and controls
151 lines (131 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
using Newtonsoft.Json;
using System;
namespace ElectronNET.API.Entities
{
/// <summary>
///
/// </summary>
public class NotificationOptions
{
/// <summary>
/// A title for the notification, which will be shown at the top of the notification
/// window when it is shown
/// </summary>
public string Title { get; set; }
/// <summary>
/// The body text of the notification, which will be displayed below the title or
/// subtitle
/// </summary>
public string Body { get; set; }
/// <summary>
/// A subtitle for the notification, which will be displayed below the title.
/// </summary>
public string Subtitle { get; set; }
/// <summary>
/// Whether or not to emit an OS notification noise when showing the notification
/// </summary>
public bool Silent { get; set; }
/// <summary>
/// An icon to use in the notification
/// </summary>
public string Icon { get; set; }
/// <summary>
/// Whether or not to add an inline reply option to the notification.
/// </summary>
public bool HasReply { get; set; }
/// <summary>
/// The placeholder to write in the inline reply input field.
/// </summary>
public string ReplyPlaceholder { get; set; }
/// <summary>
/// The name of the sound file to play when the notification is shown.
/// </summary>
public string Sound { get; set; }
/// <summary>
/// Actions to add to the notification. Please read the available actions and
/// limitations in the NotificationAction documentation
/// </summary>
public NotificationAction Actions { get; set; }
/// <summary>
/// Emitted when the notification is shown to the user,
/// note this could be fired multiple times as a notification
/// can be shown multiple times through the Show() method.
/// </summary>
[JsonIgnore]
public Action OnShow { get; set; }
/// <summary>
/// Gets or sets the show identifier.
/// </summary>
/// <value>
/// The show identifier.
/// </value>
[JsonProperty]
internal string ShowID { get; set; }
/// <summary>
/// Emitted when the notification is clicked by the user.
/// </summary>
[JsonIgnore]
public Action OnClick { get; set; }
/// <summary>
/// Gets or sets the click identifier.
/// </summary>
/// <value>
/// The click identifier.
/// </value>
[JsonProperty]
internal string ClickID { get; set; }
/// <summary>
/// Emitted when the notification is closed by manual intervention from the user.
///
/// This event is not guarunteed to be emitted in all cases where the notification is closed.
/// </summary>
[JsonIgnore]
public Action OnClose { get; set; }
/// <summary>
/// Gets or sets the close identifier.
/// </summary>
/// <value>
/// The close identifier.
/// </value>
[JsonProperty]
internal string CloseID { get; set; }
/// <summary>
/// macOS only: Emitted when the user clicks the “Reply” button on a notification with hasReply: true.
///
/// The string the user entered into the inline reply field
/// </summary>
[JsonIgnore]
public Action<string> OnReply { get; set; }
/// <summary>
/// Gets or sets the reply identifier.
/// </summary>
/// <value>
/// The reply identifier.
/// </value>
[JsonProperty]
internal string ReplyID { get; set; }
/// <summary>
/// macOS only - The index of the action that was activated
/// </summary>
[JsonIgnore]
public Action<string> OnAction { get; set; }
/// <summary>
/// Gets or sets the action identifier.
/// </summary>
/// <value>
/// The action identifier.
/// </value>
[JsonProperty]
internal string ActionID { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="NotificationOptions"/> class.
/// </summary>
/// <param name="title">The title.</param>
/// <param name="body">The body.</param>
public NotificationOptions(string title, string body)
{
Title = title;
Body = body;
}
}
}