Compare commits
2 Commits
master
...
seba76/mas
Author | SHA1 | Date | |
---|---|---|---|
|
2c18f91d68 | ||
|
c7e02655b0 |
346
ntfysh_client/MainForm.Designer.cs
generated
346
ntfysh_client/MainForm.Designer.cs
generated
@@ -29,209 +29,220 @@ namespace ntfysh_client
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
|
||||
this.subscribeNewTopic = new System.Windows.Forms.Button();
|
||||
this.removeSelectedTopics = new System.Windows.Forms.Button();
|
||||
this.notificationTopics = new System.Windows.Forms.ListBox();
|
||||
this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
|
||||
this.trayContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.showControlWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.ntfyshWebsiteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.trayContextMenu.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
subscribeNewTopic = new System.Windows.Forms.Button();
|
||||
removeSelectedTopics = new System.Windows.Forms.Button();
|
||||
notificationTopics = new System.Windows.Forms.ListBox();
|
||||
topicContextMenu = new System.Windows.Forms.ContextMenuStrip(components);
|
||||
sendNotificationMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
notifyIcon = new System.Windows.Forms.NotifyIcon(components);
|
||||
trayContextMenu = new System.Windows.Forms.ContextMenuStrip(components);
|
||||
showControlWindowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
exitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
ntfyshWebsiteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
toolTip = new System.Windows.Forms.ToolTip(components);
|
||||
topicContextMenu.SuspendLayout();
|
||||
trayContextMenu.SuspendLayout();
|
||||
menuStrip1.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// subscribeNewTopic
|
||||
//
|
||||
this.subscribeNewTopic.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.subscribeNewTopic.Location = new System.Drawing.Point(211, 251);
|
||||
this.subscribeNewTopic.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.subscribeNewTopic.Name = "subscribeNewTopic";
|
||||
this.subscribeNewTopic.Size = new System.Drawing.Size(188, 27);
|
||||
this.subscribeNewTopic.TabIndex = 2;
|
||||
this.subscribeNewTopic.Text = "Add";
|
||||
this.subscribeNewTopic.UseVisualStyleBackColor = true;
|
||||
this.subscribeNewTopic.Click += new System.EventHandler(this.subscribeNewTopic_Click);
|
||||
subscribeNewTopic.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
subscribeNewTopic.Location = new System.Drawing.Point(211, 251);
|
||||
subscribeNewTopic.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
subscribeNewTopic.Name = "subscribeNewTopic";
|
||||
subscribeNewTopic.Size = new System.Drawing.Size(188, 27);
|
||||
subscribeNewTopic.TabIndex = 2;
|
||||
subscribeNewTopic.Text = "Add";
|
||||
subscribeNewTopic.UseVisualStyleBackColor = true;
|
||||
subscribeNewTopic.Click += subscribeNewTopic_Click;
|
||||
//
|
||||
// removeSelectedTopics
|
||||
//
|
||||
this.removeSelectedTopics.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.removeSelectedTopics.Enabled = false;
|
||||
this.removeSelectedTopics.Location = new System.Drawing.Point(13, 251);
|
||||
this.removeSelectedTopics.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.removeSelectedTopics.Name = "removeSelectedTopics";
|
||||
this.removeSelectedTopics.Size = new System.Drawing.Size(188, 27);
|
||||
this.removeSelectedTopics.TabIndex = 0;
|
||||
this.removeSelectedTopics.Text = "Remove selected";
|
||||
this.removeSelectedTopics.UseVisualStyleBackColor = true;
|
||||
this.removeSelectedTopics.Click += new System.EventHandler(this.removeSelectedTopics_Click);
|
||||
removeSelectedTopics.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
removeSelectedTopics.Enabled = false;
|
||||
removeSelectedTopics.Location = new System.Drawing.Point(13, 251);
|
||||
removeSelectedTopics.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
removeSelectedTopics.Name = "removeSelectedTopics";
|
||||
removeSelectedTopics.Size = new System.Drawing.Size(188, 27);
|
||||
removeSelectedTopics.TabIndex = 0;
|
||||
removeSelectedTopics.Text = "Remove selected";
|
||||
removeSelectedTopics.UseVisualStyleBackColor = true;
|
||||
removeSelectedTopics.Click += removeSelectedTopics_Click;
|
||||
//
|
||||
// notificationTopics
|
||||
//
|
||||
this.notificationTopics.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.notificationTopics.FormattingEnabled = true;
|
||||
this.notificationTopics.ItemHeight = 15;
|
||||
this.notificationTopics.Location = new System.Drawing.Point(13, 46);
|
||||
this.notificationTopics.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.notificationTopics.Name = "notificationTopics";
|
||||
this.notificationTopics.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
|
||||
this.notificationTopics.Size = new System.Drawing.Size(386, 199);
|
||||
this.notificationTopics.TabIndex = 3;
|
||||
this.notificationTopics.Click += new System.EventHandler(this.notificationTopics_Click);
|
||||
this.notificationTopics.SelectedValueChanged += new System.EventHandler(this.notificationTopics_SelectedValueChanged);
|
||||
notificationTopics.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
notificationTopics.ContextMenuStrip = topicContextMenu;
|
||||
notificationTopics.FormattingEnabled = true;
|
||||
notificationTopics.ItemHeight = 15;
|
||||
notificationTopics.Location = new System.Drawing.Point(13, 46);
|
||||
notificationTopics.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
notificationTopics.Name = "notificationTopics";
|
||||
notificationTopics.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
|
||||
notificationTopics.Size = new System.Drawing.Size(386, 199);
|
||||
notificationTopics.TabIndex = 3;
|
||||
toolTip.SetToolTip(notificationTopics, "Double click topic to send message");
|
||||
notificationTopics.Click += notificationTopics_Click;
|
||||
notificationTopics.SelectedValueChanged += notificationTopics_SelectedValueChanged;
|
||||
notificationTopics.MouseDoubleClick += notificationTopics_MouseDoubleClick;
|
||||
//
|
||||
// topicContextMenu
|
||||
//
|
||||
topicContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { sendNotificationMenuItem });
|
||||
topicContextMenu.Name = "topicContextMenu";
|
||||
topicContextMenu.Size = new System.Drawing.Size(181, 48);
|
||||
//
|
||||
// sendNotificationMenuItem
|
||||
//
|
||||
sendNotificationMenuItem.Image = (System.Drawing.Image)resources.GetObject("sendNotificationMenuItem.Image");
|
||||
sendNotificationMenuItem.Name = "sendNotificationMenuItem";
|
||||
sendNotificationMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
sendNotificationMenuItem.Text = "Send Notification";
|
||||
sendNotificationMenuItem.Click += SendNotificationMenuItem_Click;
|
||||
//
|
||||
// notifyIcon
|
||||
//
|
||||
this.notifyIcon.ContextMenuStrip = this.trayContextMenu;
|
||||
this.notifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon.Icon")));
|
||||
this.notifyIcon.Text = "ntfy.sh";
|
||||
this.notifyIcon.Visible = true;
|
||||
this.notifyIcon.Click += new System.EventHandler(this.notifyIcon_Click);
|
||||
notifyIcon.ContextMenuStrip = trayContextMenu;
|
||||
notifyIcon.Icon = (System.Drawing.Icon)resources.GetObject("notifyIcon.Icon");
|
||||
notifyIcon.Text = "ntfy.sh";
|
||||
notifyIcon.Visible = true;
|
||||
notifyIcon.Click += notifyIcon_Click;
|
||||
//
|
||||
// trayContextMenu
|
||||
//
|
||||
this.trayContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.showControlWindowToolStripMenuItem,
|
||||
this.exitToolStripMenuItem});
|
||||
this.trayContextMenu.Name = "trayContextMenu";
|
||||
this.trayContextMenu.Size = new System.Drawing.Size(190, 48);
|
||||
trayContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { showControlWindowToolStripMenuItem, exitToolStripMenuItem });
|
||||
trayContextMenu.Name = "trayContextMenu";
|
||||
trayContextMenu.Size = new System.Drawing.Size(190, 48);
|
||||
//
|
||||
// showControlWindowToolStripMenuItem
|
||||
//
|
||||
this.showControlWindowToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("showControlWindowToolStripMenuItem.Image")));
|
||||
this.showControlWindowToolStripMenuItem.Name = "showControlWindowToolStripMenuItem";
|
||||
this.showControlWindowToolStripMenuItem.Size = new System.Drawing.Size(189, 22);
|
||||
this.showControlWindowToolStripMenuItem.Text = "Show control window";
|
||||
this.showControlWindowToolStripMenuItem.Click += new System.EventHandler(this.showControlWindowToolStripMenuItem_Click);
|
||||
showControlWindowToolStripMenuItem.Image = (System.Drawing.Image)resources.GetObject("showControlWindowToolStripMenuItem.Image");
|
||||
showControlWindowToolStripMenuItem.Name = "showControlWindowToolStripMenuItem";
|
||||
showControlWindowToolStripMenuItem.Size = new System.Drawing.Size(189, 22);
|
||||
showControlWindowToolStripMenuItem.Text = "Show control window";
|
||||
showControlWindowToolStripMenuItem.Click += showControlWindowToolStripMenuItem_Click;
|
||||
//
|
||||
// exitToolStripMenuItem
|
||||
//
|
||||
this.exitToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("exitToolStripMenuItem.Image")));
|
||||
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||
this.exitToolStripMenuItem.Size = new System.Drawing.Size(189, 22);
|
||||
this.exitToolStripMenuItem.Text = "Exit";
|
||||
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
|
||||
exitToolStripMenuItem.Image = (System.Drawing.Image)resources.GetObject("exitToolStripMenuItem.Image");
|
||||
exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||
exitToolStripMenuItem.Size = new System.Drawing.Size(189, 22);
|
||||
exitToolStripMenuItem.Text = "Exit";
|
||||
exitToolStripMenuItem.Click += exitToolStripMenuItem_Click;
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.BackColor = System.Drawing.Color.White;
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileToolStripMenuItem,
|
||||
this.helpToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Padding = new System.Windows.Forms.Padding(7, 2, 0, 2);
|
||||
this.menuStrip1.Size = new System.Drawing.Size(412, 24);
|
||||
this.menuStrip1.TabIndex = 4;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
menuStrip1.BackColor = System.Drawing.Color.White;
|
||||
menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { fileToolStripMenuItem, helpToolStripMenuItem });
|
||||
menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
menuStrip1.Name = "menuStrip1";
|
||||
menuStrip1.Padding = new System.Windows.Forms.Padding(7, 2, 0, 2);
|
||||
menuStrip1.Size = new System.Drawing.Size(412, 24);
|
||||
menuStrip1.TabIndex = 4;
|
||||
menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.exitToolStripMenuItem1,
|
||||
this.settingsToolStripMenuItem});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||
this.fileToolStripMenuItem.Text = "File";
|
||||
fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { exitToolStripMenuItem1, settingsToolStripMenuItem });
|
||||
fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||
fileToolStripMenuItem.Text = "File";
|
||||
//
|
||||
// exitToolStripMenuItem1
|
||||
//
|
||||
this.exitToolStripMenuItem1.Image = ((System.Drawing.Image)(resources.GetObject("exitToolStripMenuItem1.Image")));
|
||||
this.exitToolStripMenuItem1.Name = "exitToolStripMenuItem1";
|
||||
this.exitToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
|
||||
this.exitToolStripMenuItem1.Text = "Exit";
|
||||
this.exitToolStripMenuItem1.Click += new System.EventHandler(this.exitToolStripMenuItem1_Click);
|
||||
//
|
||||
// helpToolStripMenuItem
|
||||
//
|
||||
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.ntfyshWebsiteToolStripMenuItem,
|
||||
this.toolStripMenuItem1,
|
||||
this.aboutToolStripMenuItem});
|
||||
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
|
||||
this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
|
||||
this.helpToolStripMenuItem.Text = "Help";
|
||||
//
|
||||
// ntfyshWebsiteToolStripMenuItem
|
||||
//
|
||||
this.ntfyshWebsiteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("ntfyshWebsiteToolStripMenuItem.Image")));
|
||||
this.ntfyshWebsiteToolStripMenuItem.Name = "ntfyshWebsiteToolStripMenuItem";
|
||||
this.ntfyshWebsiteToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
|
||||
this.ntfyshWebsiteToolStripMenuItem.Text = "Open ntfy.sh website";
|
||||
this.ntfyshWebsiteToolStripMenuItem.Click += new System.EventHandler(this.ntfyshWebsiteToolStripMenuItem_Click);
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
this.toolStripMenuItem1.Size = new System.Drawing.Size(182, 6);
|
||||
//
|
||||
// aboutToolStripMenuItem
|
||||
//
|
||||
this.aboutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("aboutToolStripMenuItem.Image")));
|
||||
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
|
||||
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
|
||||
this.aboutToolStripMenuItem.Text = "About";
|
||||
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(13, 27);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(170, 15);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Subscribed Notification Topics:";
|
||||
exitToolStripMenuItem1.Image = (System.Drawing.Image)resources.GetObject("exitToolStripMenuItem1.Image");
|
||||
exitToolStripMenuItem1.Name = "exitToolStripMenuItem1";
|
||||
exitToolStripMenuItem1.Size = new System.Drawing.Size(180, 22);
|
||||
exitToolStripMenuItem1.Text = "Exit";
|
||||
exitToolStripMenuItem1.Click += exitToolStripMenuItem1_Click;
|
||||
//
|
||||
// settingsToolStripMenuItem
|
||||
//
|
||||
this.settingsToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("settingsToolStripMenuItem.Image")));
|
||||
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
|
||||
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.settingsToolStripMenuItem.Text = "Settings";
|
||||
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
|
||||
settingsToolStripMenuItem.Image = (System.Drawing.Image)resources.GetObject("settingsToolStripMenuItem.Image");
|
||||
settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
|
||||
settingsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
settingsToolStripMenuItem.Text = "Settings";
|
||||
settingsToolStripMenuItem.Click += settingsToolStripMenuItem_Click;
|
||||
//
|
||||
// helpToolStripMenuItem
|
||||
//
|
||||
helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { ntfyshWebsiteToolStripMenuItem, toolStripMenuItem1, aboutToolStripMenuItem });
|
||||
helpToolStripMenuItem.Name = "helpToolStripMenuItem";
|
||||
helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
|
||||
helpToolStripMenuItem.Text = "Help";
|
||||
//
|
||||
// ntfyshWebsiteToolStripMenuItem
|
||||
//
|
||||
ntfyshWebsiteToolStripMenuItem.Image = (System.Drawing.Image)resources.GetObject("ntfyshWebsiteToolStripMenuItem.Image");
|
||||
ntfyshWebsiteToolStripMenuItem.Name = "ntfyshWebsiteToolStripMenuItem";
|
||||
ntfyshWebsiteToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
|
||||
ntfyshWebsiteToolStripMenuItem.Text = "Open ntfy.sh website";
|
||||
ntfyshWebsiteToolStripMenuItem.Click += ntfyshWebsiteToolStripMenuItem_Click;
|
||||
//
|
||||
// toolStripMenuItem1
|
||||
//
|
||||
toolStripMenuItem1.Name = "toolStripMenuItem1";
|
||||
toolStripMenuItem1.Size = new System.Drawing.Size(182, 6);
|
||||
//
|
||||
// aboutToolStripMenuItem
|
||||
//
|
||||
aboutToolStripMenuItem.Image = (System.Drawing.Image)resources.GetObject("aboutToolStripMenuItem.Image");
|
||||
aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
|
||||
aboutToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
|
||||
aboutToolStripMenuItem.Text = "About";
|
||||
aboutToolStripMenuItem.Click += aboutToolStripMenuItem_Click;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new System.Drawing.Point(13, 27);
|
||||
label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(171, 15);
|
||||
label1.TabIndex = 1;
|
||||
label1.Text = "Subscribed Notification Topics:";
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.ClientSize = new System.Drawing.Size(412, 288);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.Controls.Add(this.notificationTopics);
|
||||
this.Controls.Add(this.removeSelectedTopics);
|
||||
this.Controls.Add(this.subscribeNewTopic);
|
||||
this.Controls.Add(this.label1);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.KeyPreview = true;
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "MainForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "ntfy.sh";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
|
||||
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
|
||||
this.Load += new System.EventHandler(this.MainForm_Load);
|
||||
this.trayContextMenu.ResumeLayout(false);
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
BackColor = System.Drawing.Color.White;
|
||||
ClientSize = new System.Drawing.Size(412, 288);
|
||||
Controls.Add(menuStrip1);
|
||||
Controls.Add(notificationTopics);
|
||||
Controls.Add(removeSelectedTopics);
|
||||
Controls.Add(subscribeNewTopic);
|
||||
Controls.Add(label1);
|
||||
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
|
||||
KeyPreview = true;
|
||||
MainMenuStrip = menuStrip1;
|
||||
Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
MaximizeBox = false;
|
||||
MinimizeBox = false;
|
||||
Name = "MainForm";
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
Text = "ntfy.sh";
|
||||
FormClosing += MainForm_FormClosing;
|
||||
FormClosed += MainForm_FormClosed;
|
||||
Load += MainForm_Load;
|
||||
topicContextMenu.ResumeLayout(false);
|
||||
trayContextMenu.ResumeLayout(false);
|
||||
menuStrip1.ResumeLayout(false);
|
||||
menuStrip1.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -251,6 +262,9 @@ namespace ntfysh_client
|
||||
private System.Windows.Forms.ToolStripMenuItem ntfyshWebsiteToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
|
||||
private System.Windows.Forms.ContextMenuStrip topicContextMenu;
|
||||
private System.Windows.Forms.ToolStripMenuItem sendNotificationMenuItem;
|
||||
private System.Windows.Forms.ToolTip toolTip;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -4,7 +4,9 @@ using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Newtonsoft.Json;
|
||||
using ntfysh_client.Notifications;
|
||||
@@ -16,7 +18,6 @@ namespace ntfysh_client
|
||||
private readonly NotificationListener _notificationListener;
|
||||
private bool _startInTray;
|
||||
private bool _trueExit;
|
||||
private NotificationDialog _notificationDialog;
|
||||
|
||||
public MainForm(NotificationListener notificationListener, bool startInTray = false)
|
||||
{
|
||||
@@ -25,16 +26,14 @@ namespace ntfysh_client
|
||||
_notificationListener.OnNotificationReceive += OnNotificationReceive;
|
||||
_notificationListener.OnConnectionMultiAttemptFailure += OnConnectionMultiAttemptFailure;
|
||||
_notificationListener.OnConnectionCredentialsFailure += OnConnectionCredentialsFailure;
|
||||
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
private void MainForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
LoadSettings();
|
||||
LoadTopics();
|
||||
|
||||
_notificationDialog = new NotificationDialog();
|
||||
}
|
||||
|
||||
protected override void SetVisibleCore(bool value)
|
||||
@@ -42,7 +41,7 @@ namespace ntfysh_client
|
||||
if (_startInTray)
|
||||
{
|
||||
_startInTray = false;
|
||||
|
||||
|
||||
/*
|
||||
* TODO This little workaround prevents the window from appearing with a flash, but the taskbar icon appears for a moment.
|
||||
*
|
||||
@@ -52,10 +51,10 @@ namespace ntfysh_client
|
||||
base.SetVisibleCore(true);
|
||||
base.SetVisibleCore(false);
|
||||
Opacity = 1;
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
base.SetVisibleCore(value);
|
||||
}
|
||||
|
||||
@@ -73,34 +72,18 @@ namespace ntfysh_client
|
||||
|
||||
string finalTitle = string.IsNullOrWhiteSpace(e.Title) ? $"{e.Sender.TopicId}@{e.Sender.ServerUrl}" : e.Title;
|
||||
|
||||
if (Program.Settings.NotificationsMethod == SettingsModel.NotificationsType.NativeWindows)
|
||||
{
|
||||
notifyIcon.ShowBalloonTip((int)TimeSpan.FromSeconds((double)Program.Settings.Timeout).TotalMilliseconds, finalTitle, e.Message, priorityIcon);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
_notificationDialog.ShowNotification(
|
||||
title: finalTitle,
|
||||
message: e.Message,
|
||||
timeoutSeconds: (int)Program.Settings.Timeout,
|
||||
icon: priorityIcon,
|
||||
showTimeOutBar: Program.Settings.CustomTrayNotificationsShowTimeoutBar,
|
||||
showInDarkMode: Program.Settings.CustomTrayNotificationsShowInDarkMode,
|
||||
playNotificationSound: Program.Settings.CustomTrayNotificationsPlayDefaultWindowsSound
|
||||
);
|
||||
}
|
||||
notifyIcon.ShowBalloonTip((int)TimeSpan.FromSeconds((double)Program.Settings.Timeout).TotalMilliseconds, finalTitle, e.Message, priorityIcon);
|
||||
}
|
||||
|
||||
private void OnConnectionMultiAttemptFailure(NotificationListener sender, SubscribedTopic topic)
|
||||
{
|
||||
MessageBox.Show($"Connecting to topic ID '{topic.TopicId}' on server '{topic.ServerUrl}' failed after multiple attempts.\n\nThis topic ID will be ignored and you will not receive notifications for it until you restart the application.", "Connection Failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
|
||||
|
||||
private void OnConnectionCredentialsFailure(NotificationListener sender, SubscribedTopic topic)
|
||||
{
|
||||
string reason = string.IsNullOrWhiteSpace(topic.Username) ? "credentials are required but were not provided" : "the entered credentials are incorrect";
|
||||
|
||||
|
||||
MessageBox.Show($"Connecting to topic ID '{topic.TopicId}' on server '{topic.ServerUrl}' failed because {reason}.\n\nThis topic ID will be ignored and you will not receive notifications for it until you correct the credentials.", "Connection Authentication Failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
|
||||
@@ -111,11 +94,11 @@ namespace ntfysh_client
|
||||
|
||||
//Do not subscribe on cancelled dialog
|
||||
if (result != DialogResult.OK) return;
|
||||
|
||||
|
||||
//Convert the reconnection values to ints
|
||||
int reconnectAttempts = Convert.ToInt32(Math.Ceiling(Program.Settings.ReconnectAttempts));
|
||||
int reconnectAttemptDelay = Convert.ToInt32(Math.Ceiling(Program.Settings.ReconnectAttemptDelay));
|
||||
|
||||
|
||||
//Subscribe
|
||||
if (dialog.UseWebsockets)
|
||||
{
|
||||
@@ -128,7 +111,7 @@ namespace ntfysh_client
|
||||
|
||||
//Add to the user visible list
|
||||
notificationTopics.Items.Add(dialog.Unique);
|
||||
|
||||
|
||||
//Save the topics persistently
|
||||
SaveTopicsToFile();
|
||||
}
|
||||
@@ -138,27 +121,22 @@ namespace ntfysh_client
|
||||
while (notificationTopics.SelectedIndex > -1)
|
||||
{
|
||||
string topicUniqueString = (string)notificationTopics.Items[notificationTopics.SelectedIndex];
|
||||
|
||||
|
||||
await _notificationListener.UnsubscribeFromTopicAsync(topicUniqueString);
|
||||
notificationTopics.Items.Remove(topicUniqueString);
|
||||
}
|
||||
|
||||
SaveTopicsToFile();
|
||||
}
|
||||
|
||||
|
||||
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using SettingsDialog dialog = new();
|
||||
|
||||
//Load current settings into dialog
|
||||
dialog.Timeout = Program.Settings.Timeout;
|
||||
dialog.ReconnectAttempts = Program.Settings.ReconnectAttempts;
|
||||
dialog.ReconnectAttemptDelay = Program.Settings.ReconnectAttemptDelay;
|
||||
dialog.UseNativeWindowsNotifications = Program.Settings.NotificationsMethod == SettingsModel.NotificationsType.NativeWindows;
|
||||
dialog.UseCustomTrayNotifications = Program.Settings.NotificationsMethod == SettingsModel.NotificationsType.CustomTray;
|
||||
dialog.CustomTrayNotificationsShowTimeoutBar = Program.Settings.CustomTrayNotificationsShowTimeoutBar;
|
||||
dialog.CustomTrayNotificationsShowInDarkMode = Program.Settings.CustomTrayNotificationsShowInDarkMode;
|
||||
dialog.CustomTrayNotificationsPlayDefaultWindowsSound = Program.Settings.CustomTrayNotificationsPlayDefaultWindowsSound;
|
||||
dialog.Timeout = Program.Settings.Timeout; // set timeout last so bounds are setup before setting value
|
||||
|
||||
//Show dialog
|
||||
DialogResult result = dialog.ShowDialog();
|
||||
@@ -170,10 +148,6 @@ namespace ntfysh_client
|
||||
Program.Settings.Timeout = dialog.Timeout;
|
||||
Program.Settings.ReconnectAttempts = dialog.ReconnectAttempts;
|
||||
Program.Settings.ReconnectAttemptDelay = dialog.ReconnectAttemptDelay;
|
||||
Program.Settings.NotificationsMethod = (dialog.UseNativeWindowsNotifications)? SettingsModel.NotificationsType.NativeWindows : SettingsModel.NotificationsType.CustomTray;
|
||||
Program.Settings.CustomTrayNotificationsShowTimeoutBar = dialog.CustomTrayNotificationsShowTimeoutBar;
|
||||
Program.Settings.CustomTrayNotificationsShowInDarkMode = dialog.CustomTrayNotificationsShowInDarkMode;
|
||||
Program.Settings.CustomTrayNotificationsPlayDefaultWindowsSound = dialog.CustomTrayNotificationsPlayDefaultWindowsSound;
|
||||
|
||||
//Save new settings persistently
|
||||
SaveSettingsToFile();
|
||||
@@ -195,9 +169,9 @@ namespace ntfysh_client
|
||||
private void notifyIcon_Click(object sender, EventArgs e)
|
||||
{
|
||||
MouseEventArgs mouseEv = (MouseEventArgs)e;
|
||||
|
||||
|
||||
if (mouseEv.Button != MouseButtons.Left) return;
|
||||
|
||||
|
||||
Visible = !Visible;
|
||||
BringToFront();
|
||||
}
|
||||
@@ -213,7 +187,7 @@ namespace ntfysh_client
|
||||
string binaryDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? throw new InvalidOperationException("Unable to determine path for application");
|
||||
return Path.Combine(binaryDirectory ?? throw new InvalidOperationException("Unable to determine path for topics file"), "topics.json");
|
||||
}
|
||||
|
||||
|
||||
private string GetLegacyTopicsFilePath()
|
||||
{
|
||||
string binaryDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? throw new InvalidOperationException("Unable to determine path for application");
|
||||
@@ -223,20 +197,20 @@ namespace ntfysh_client
|
||||
private void SaveTopicsToFile()
|
||||
{
|
||||
string topicsSerialised = JsonConvert.SerializeObject(_notificationListener.SubscribedTopicsByUnique.Select(st => st.Value).ToList(), Formatting.Indented);
|
||||
|
||||
|
||||
File.WriteAllText(GetTopicsFilePath(), topicsSerialised);
|
||||
}
|
||||
|
||||
|
||||
private string GetSettingsFilePath()
|
||||
{
|
||||
string binaryDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? throw new InvalidOperationException("Unable to determine path for application");
|
||||
return Path.Combine(binaryDirectory ?? throw new InvalidOperationException("Unable to determine path for settings file"), "settings.json");
|
||||
}
|
||||
|
||||
|
||||
private void SaveSettingsToFile()
|
||||
{
|
||||
string settingsSerialised = JsonConvert.SerializeObject(Program.Settings, Formatting.Indented);
|
||||
|
||||
|
||||
File.WriteAllText(GetSettingsFilePath(), settingsSerialised);
|
||||
}
|
||||
|
||||
@@ -250,7 +224,7 @@ namespace ntfysh_client
|
||||
{
|
||||
//Read old format
|
||||
List<string> legacyTopics = new List<string>();
|
||||
|
||||
|
||||
using (StreamReader reader = new StreamReader(legacyTopicsPath))
|
||||
{
|
||||
while (!reader.EndOfStream)
|
||||
@@ -264,17 +238,17 @@ namespace ntfysh_client
|
||||
List<SubscribedTopic> newTopics = legacyTopics.Select(lt => new SubscribedTopic(lt, "https://ntfy.sh", null, null)).ToList();
|
||||
|
||||
string newFormatSerialised = JsonConvert.SerializeObject(newTopics, Formatting.Indented);
|
||||
|
||||
|
||||
//Write new format
|
||||
File.WriteAllText(topicsFilePath, newFormatSerialised);
|
||||
|
||||
|
||||
//Delete old format
|
||||
File.Delete(legacyTopicsPath);
|
||||
}
|
||||
|
||||
|
||||
//Check if we have any topics file on disk to load
|
||||
if (!File.Exists(topicsFilePath)) return;
|
||||
|
||||
|
||||
//We have a topics file. Load it!
|
||||
string topicsSerialised = File.ReadAllText(topicsFilePath);
|
||||
|
||||
@@ -294,48 +268,44 @@ namespace ntfysh_client
|
||||
//TODO Deserialise error!
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//Convert the reconnection values to ints
|
||||
int reconnectAttempts = Convert.ToInt32(Math.Ceiling(Program.Settings.ReconnectAttempts));
|
||||
int reconnectAttemptDelay = Convert.ToInt32(Math.Ceiling(Program.Settings.ReconnectAttemptDelay));
|
||||
|
||||
|
||||
//Load them in
|
||||
foreach (SubscribedTopic topic in topics)
|
||||
{
|
||||
string[] parts = topic.ServerUrl.Split("://", 2);
|
||||
|
||||
|
||||
switch (parts[0].ToLower())
|
||||
{
|
||||
case "ws":
|
||||
case "wss":
|
||||
_notificationListener.SubscribeToTopicUsingWebsocket($"{topic.TopicId}@{topic.ServerUrl}", topic.TopicId, topic.ServerUrl, topic.Username, topic.Password, reconnectAttempts, reconnectAttemptDelay);
|
||||
break;
|
||||
|
||||
|
||||
case "http":
|
||||
case "https":
|
||||
_notificationListener.SubscribeToTopicUsingLongHttpJson($"{topic.TopicId}@{topic.ServerUrl}", topic.TopicId, topic.ServerUrl, topic.Username, topic.Password, reconnectAttempts, reconnectAttemptDelay);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
notificationTopics.Items.Add($"{topic.TopicId}@{topic.ServerUrl}");
|
||||
}
|
||||
}
|
||||
|
||||
private SettingsModel GetDefaultSettings() => new()
|
||||
{
|
||||
Revision = 2,
|
||||
Revision = 1,
|
||||
Timeout = 5,
|
||||
ReconnectAttempts = 10,
|
||||
ReconnectAttemptDelay = 3,
|
||||
NotificationsMethod = SettingsModel.NotificationsType.NativeWindows,
|
||||
CustomTrayNotificationsShowTimeoutBar = true,
|
||||
CustomTrayNotificationsShowInDarkMode = false,
|
||||
CustomTrayNotificationsPlayDefaultWindowsSound = true,
|
||||
ReconnectAttemptDelay = 3
|
||||
};
|
||||
|
||||
|
||||
private void MergeSettingsRevisions(SettingsModel older, SettingsModel newer)
|
||||
{
|
||||
//Apply settings introduced in Revision 1
|
||||
@@ -345,15 +315,6 @@ namespace ntfysh_client
|
||||
older.ReconnectAttemptDelay = newer.ReconnectAttemptDelay;
|
||||
}
|
||||
|
||||
//Apply settings introduced in Revision 2 (Native vs custom notifications)
|
||||
if (older.Revision < 2)
|
||||
{
|
||||
older.NotificationsMethod = newer.NotificationsMethod;
|
||||
older.CustomTrayNotificationsShowTimeoutBar = newer.CustomTrayNotificationsShowTimeoutBar;
|
||||
older.CustomTrayNotificationsShowInDarkMode = newer.CustomTrayNotificationsShowInDarkMode;
|
||||
older.CustomTrayNotificationsPlayDefaultWindowsSound = newer.CustomTrayNotificationsPlayDefaultWindowsSound;
|
||||
}
|
||||
|
||||
//Update the revision
|
||||
older.Revision = newer.Revision;
|
||||
}
|
||||
@@ -362,12 +323,12 @@ namespace ntfysh_client
|
||||
{
|
||||
string settingsFilePath = GetSettingsFilePath();
|
||||
SettingsModel defaultSettings = GetDefaultSettings();
|
||||
|
||||
|
||||
//Check if we have any settings file on disk to load. If we don't, initialise defaults
|
||||
if (!File.Exists(settingsFilePath))
|
||||
{
|
||||
Program.Settings = defaultSettings;
|
||||
|
||||
|
||||
SaveSettingsToFile();
|
||||
|
||||
return;
|
||||
@@ -380,7 +341,7 @@ namespace ntfysh_client
|
||||
if (string.IsNullOrWhiteSpace(settingsSerialised))
|
||||
{
|
||||
Program.Settings = defaultSettings;
|
||||
|
||||
|
||||
SaveSettingsToFile();
|
||||
|
||||
return;
|
||||
@@ -393,16 +354,16 @@ namespace ntfysh_client
|
||||
if (settings is null)
|
||||
{
|
||||
Program.Settings = defaultSettings;
|
||||
|
||||
|
||||
SaveSettingsToFile();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Program.Settings = settings;
|
||||
|
||||
|
||||
//Check the settings revision. If it is older than the current latest revision, apply the settings defaults missing from previous revision
|
||||
if (Program.Settings.Revision < defaultSettings.Revision)
|
||||
if (Program.Settings.Revision < defaultSettings.ReconnectAttempts)
|
||||
{
|
||||
MergeSettingsRevisions(Program.Settings, defaultSettings);
|
||||
SaveSettingsToFile();
|
||||
@@ -413,14 +374,14 @@ namespace ntfysh_client
|
||||
{
|
||||
notifyIcon.Dispose();
|
||||
}
|
||||
|
||||
|
||||
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
// Let it close
|
||||
if (_trueExit) return;
|
||||
|
||||
if (e.CloseReason != CloseReason.UserClosing) return;
|
||||
|
||||
|
||||
Visible = false;
|
||||
e.Cancel = true;
|
||||
}
|
||||
@@ -450,5 +411,36 @@ namespace ntfysh_client
|
||||
_trueExit = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private async void SendNotificationMenuItem_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
await SendMessage();
|
||||
}
|
||||
|
||||
private async void notificationTopics_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
await SendMessage();
|
||||
}
|
||||
|
||||
private async Task SendMessage()
|
||||
{
|
||||
if (notificationTopics.SelectedItem != null && string.IsNullOrEmpty(notificationTopics.SelectedItem as string) == false)
|
||||
{
|
||||
try
|
||||
{
|
||||
SendMessageForm dlg = new SendMessageForm();
|
||||
DialogResult r = dlg.ShowDialog(this);
|
||||
if (r == DialogResult.OK)
|
||||
{
|
||||
string key = notificationTopics.SelectedItem.ToString();
|
||||
await _notificationListener.SendNotification(key, dlg.Title, dlg.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,64 @@
|
||||
<root>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
@@ -57,29 +117,54 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="topicContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>384, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="sendNotificationMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALtSURBVGhD7ZfPaxNBFMeTkqS9WDyotTHJvjdJ/VUpirQK
|
||||
elFKa1pSK2lNapOrP8BDPRQEL7X+qFjEg2JBEERrEc2hh0jT6EHUo3+DPSi2tV6E4sGmREaSsHlM1iaZ
|
||||
lVnJFz6X3TeZ98lLZhObrZZaaqnF0kHEcUR8rTjjtO+iIOIkImYtwiTtvxBEXBAsUJUF2n8hehEAmELE
|
||||
UZXI9VSeiKZpYU3TmhUjbKqIM/z47Pb9J4BeNwHzRByRF1dt8XTWfubV26a2ENL7kjFHxBF9eY1L5KmL
|
||||
zj6hNZKRL5KfRIHY3KfNnZcP0DrJyBWhk7DF0+t1kcQdx+DMaKVsCt48QvcRIE+kqb2XEQkpOAemR+he
|
||||
AuSJbDvY76dNyOCfi7j97V57fO4jaWTNHku+tw8n31WK69TDKN1LgDwRzpaOyE4qUzc0O+317nLTWsnI
|
||||
FeEIZaKJ+7Tub2w9FG6h1wyQL8IpkomlftQH7wZpjRHOgZkRWzz1raFr4ji9VwJzRDh/ZIaTb+qDt7vo
|
||||
PSOcp59d4sd27k1Yaei+cYzWCDBPpFL47zN+SBQ+mrH57xuYjHoinApkzBHhZz85hqsnllpxtx710b2s
|
||||
JxJPZ/lDl+5lPZFY+qfBfxtzRPgzoLFz7HCl5E6ujF7CFZoy2tcckWpwhe712+Lzq0USfQ8GaR1BPRFH
|
||||
JDFRxiTyqCfCcUQS1zc4iTxqinAau6900GsGqCtSJuWLIGIaEZ8a0CfYSE8vADwSrKsG3lPZIoYAwCoA
|
||||
nBQINDPGLiBihq6RTGkRxhgf3S/BolI8pxIAcA4R1wS1MskwxoZo/0VhjPUwxm6VAhE/6F6wSAQRL5JJ
|
||||
LNP1kuihfZcdxtiYSAQAzpNJLPv9/n10vTIRiVhOgoeKCL7YS4FAoJWuUy56EQD4gojrOomvALCbrlEy
|
||||
ZCJ6lnw+315ar2xKiCxaSoJHILKoadoeWqd8ELENERO5U+ozY6yF1lgqHo9nByJq9Hottfxn+Q2nlJ4k
|
||||
a2hbYwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>537, 17</value>
|
||||
</metadata>
|
||||
<metadata name="notifyIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="trayContextMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>123, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="showControlWindowToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA68AAAOvAGVvHJJAAAAiklE
|
||||
QVQ4T8WPQQqAIBBFvUOrXIhu3dcZOkqtu5R1ia4SdRDrxyyGGKmBIOGBDL6nmk9WCGE9yUpW0q9Ads7V
|
||||
GuCQ/kHAe79joAEO6dcLFmttpQEO6c+Bvpm2oZ0zwB4zVQBiF8cIsMdMDPCb+G2vA/wgP/z6C6WAhBgo
|
||||
fUFCDGi4BxIGShLpvy5jDoPes/0oNG3VAAAAAElFTkSuQmCC
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA68AAAOvAGVvHJJAAAAgElE
|
||||
QVQ4T2NgoAZQVFR8oKio+J9E/ADZgP9ycnKSpGCQHuoZoKCg8BiLE/FikB5kF+yXkpISJgWD9BBtQIbp
|
||||
ykeZZqv+gzCITbIBII0eWsVaIAxi4zQA2SZk24g2AFkhsmKivYDLAGwYqwG4vIANYzWAFIxuwAqQAIl4
|
||||
BdyAAQUAg96z/bGuwC8AAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="exitToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA68AAAOvAGVvHJJAAAAgUlE
|
||||
QVQ4T2OgGjjOLq4AZeIFWNWBBI9yib06zC3uABXCCkDyIHVYDTnMI2pzhEvs5VFucSeoEAo4wiNii08e
|
||||
DHAZQshwFICumCTNMADyK1gTl2gJiCYUNlgBSDPQ1v8gGipEPKDIBRSFAa6oIsoQQvGM1xCqpESsglgA
|
||||
seroBRgYAOoOWBJbfVcRAAAAAElFTkSuQmCC
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA68AAAOvAGVvHJJAAAAhklE
|
||||
QVQ4T2NgoBY4zi6ugC6GDWBVBxI8yiX26jC3uAO6HDIAyYPUYTXkMI+ozREusZdHucWd0OVA4AiPiC0+
|
||||
eTDAZQgucawAXTE6nygA8itYE5doCYgmFDZYAUjzUW7x/yAaXY4goMgF6H5G5+MFuKKKKENwaYYBvIZQ
|
||||
JSViFcQCiFVHPwAA6g5YEuFUY5cAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="notifyIcon.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
@@ -267,43 +352,43 @@
|
||||
<data name="exitToolStripMenuItem1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA68AAAOvAGVvHJJAAAAgUlE
|
||||
QVQ4T2OgGjjOLq4AZeIFWNWBBI9yib06zC3uABXCCkDyIHVYDTnMI2pzhEvs5VFucSeoEAo4wiNii08e
|
||||
DHAZQshwFICumCTNMADyK1gTl2gJiCYUNlgBSDPQ1v8gGipEPKDIBRSFAa6oIsoQQvGM1xCqpESsglgA
|
||||
seroBRgYAOoOWBJbfVcRAAAAAElFTkSuQmCC
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA68AAAOvAGVvHJJAAAAhklE
|
||||
QVQ4T2NgoBY4zi6ugC6GDWBVBxI8yiX26jC3uAO6HDIAyYPUYTXkMI+ozREusZdHucWd0OVA4AiPiC0+
|
||||
eTDAZQgucawAXTE6nygA8itYE5doCYgmFDZYAUjzUW7x/yAaXY4goMgF6H5G5+MFuKKKKENwaYYBvIZQ
|
||||
JSViFcQCiFVHPwAA6g5YEuFUY5cAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="settingsToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA7CAAAOwgEVKEqAAAABT0lE
|
||||
QVQ4T7WTzU3DUBCEXQICcSAYx5bdgKkDEuggF37aIJwJVBBfsCsAux+iII6hgvCNM5GV8HeBlUa73tnZ
|
||||
fe9lE/ybJUlyC5bG2OmfLY7jK1CGYbiLr/v9/kigQeNcqRqXbxrEJXgBBYJX/DviPE3TY8Xk5vgpmIHP
|
||||
TUhWKoii6AA/RPygWFBMbmCuAKVlnVG0AzHDnzH1iPheJ/HkiXLEp/rWdSxbGckxRTVYeNoEPFF4mGVZ
|
||||
CC9uYm4BamksbxssIUe6r46pKRKaDjx97uvkqpXGdNdA5G8NNOSrBmPQcDS9fHsFvms1sVjcnTn9Io00
|
||||
lq8Mcv2I5xK5yVxQrBwnOCF+o/G+ZZ1BaEkKHRM/0DTFgicPzWkXKss6I7lepClT20XyfXPFzmkHdMpr
|
||||
yzYN8gJUvV5vD/9M4fYqP34r3jZEetj1n+nG6b+2IPgAzHGHcFUSC1YAAAAASUVORK5CYII=
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA69AAAOvQFH+5CtAAABQUlE
|
||||
QVQ4T7WTTU4CQRCF5whG48KxnfoqMxfAcyjoDdz4cw1xLXoC2AgnULmPBuMST4B5pEigGeNGK+mkp1+/
|
||||
V1Wva4riv8Ld79x9Eauf460BXAPjlNIu8GpmF1ruPo2zse7kvGUAV8AbMHL3D+DLzDp1XR9r7+4zYAi8
|
||||
t4oAE12oquoA6JnZo/Za2gPdwEaqJOcXZrYjdTM7q+v6CHhQJZF5oDN3P9W32tkgyyT1DMwj2wB4Tikd
|
||||
Nk2T3F3YILC57m4YK6dllvpVmcoi4gqP7LNopxPGLrYEBP4moCRtAn09VTi/bEFlSyTIwu4D04tMt2Zj
|
||||
zcTzMFEis3UTq6o6AT6bptnfICtiSEbxVN2WZ+wFplmY5Pz1QRquBin67UTZOtMMqMqbnL8M4FLqZVnu
|
||||
AS8to/z0IzmPMHb1M93m+J/FN8xxh3CJx7rTAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="ntfyshWebsiteToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA68AAAOvAGVvHJJAAABDElE
|
||||
QVQ4T91RO3bCQAzUy3uhChdJnTVlCj5FcMsZsF1jmy4XycPrzl6fBLgEXMFp4srRiF0wcaBP5j0VI2m0
|
||||
4zH9EwSq8gPP7ELPNFxtpxrbn9vVPkSsykOkqvHi2QxsWwAevhQTzG8eCb1yD7Glv2I5MlM+sLX0GqEq
|
||||
6+jVPFl6QZz7lOgdJVnzuMq/sEepbsGln2YnR3AAm0IcIE71geJsTO9mcOWAOa3zicxxxGWApXMGabaH
|
||||
WDLwqhmLj8tR8SYzh2Qz5b3TUQSEF7jkLzysdB2o4tPybU8MxB9DdlFb9gNwAJv30HXQg8sAS/jmLiQD
|
||||
PWPxkdabvrMzEBBeQOpI35Vw7t8V/yEQfQPXsZpY9UsnYgAAAABJRU5ErkJggg==
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA68AAAOvAGVvHJJAAABCUlE
|
||||
QVQ4T91Ru3LCMBC8yUxcJT+SOhJlCh5FoOUbsKixRcePZJDc2ecvMfwE/ILTxBWZlbFHyBP6sDMqbu/2
|
||||
br0megzEolzEkg9KcqMkX7zXXPl5qOnhxKI4rUU5Xr5x5PdQq/d8gv6fS5QsjhCHvI/ViKdKchXyDkoU
|
||||
9fqDX0KekmxBqT1QaprnTfaDOdL2gtrx2rSO4AA2B2JtT5SYMe04unGw44i22cT1saTLAEN9BtocIXYZ
|
||||
yHKmJJ9Xo/zz5ki6n5I27VIEhAvdX3ja2DoW+fe1rgZiIPl6JW3rkG4BB7B5D76DAboMMIRv9uEysDPS
|
||||
5kzb/dBZDwSEC0gd6XfP1aa6L/5X+AXXsZpYG9LldQAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="aboutToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA68AAAOvAGVvHJJAAAAwUlE
|
||||
QVQ4T2OgClBUVHwAxP9JxA+g2sEG/JeTk5MkBYP0QLVTwQAFBYXHIAFSMEgPVDvYBfulpKSEScEgPVDt
|
||||
dDIA6OTNQHX/YXysBjAxMcUxMjKuBrGB9DIgPxqmARhwOUBD3sD4WA0QERGRBHLvCwoKygLpm6KiohIw
|
||||
DVBNz5HY2L0AtHkOEE8F4okgvoyMjDSSJsIGsLOzuwKFfnBycppJS0vLAJ39BUQTbQA6RnYBMkY3YAVI
|
||||
gES8Aqp9QAEDAwCq9oYvtggceQAAAABJRU5ErkJggg==
|
||||
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA68AAAOvAGVvHJJAAAAvklE
|
||||
QVQ4T8WOPQoCMRBGZ9KELRez4CYxzFzCG3gKwRN4GQs7a1mw9ACew8oFCxtLC7uVAZWwSDCw6MAjP/C9
|
||||
+QCGGGZumbnLpI0FXQihzkEywwmI6PyhYhLJxA0O1tpRDpL5rYCI9lI9KVBKLRBxJ3dE3Cql5q9ACGFJ
|
||||
RNekwBhTA8CpLMsJAByrqhrHLZj5khQ8N28QcY2IK3l7712WQGs9A4B7URRT55wnopucXwv6xA1i+oJG
|
||||
PjJp3oK/zgOq9oYvURh7ngAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
|
146
ntfysh_client/NotificationDialog.Designer.cs
generated
146
ntfysh_client/NotificationDialog.Designer.cs
generated
@@ -1,146 +0,0 @@
|
||||
namespace ntfysh_client
|
||||
{
|
||||
partial class NotificationDialog
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
TxBTitle = new System.Windows.Forms.TextBox();
|
||||
ButtonClose = new System.Windows.Forms.Button();
|
||||
TxBMessage = new System.Windows.Forms.RichTextBox();
|
||||
IconBox = new System.Windows.Forms.PictureBox();
|
||||
ProgressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
LblTimeout = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)IconBox).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// TxBTitle
|
||||
//
|
||||
TxBTitle.BackColor = System.Drawing.SystemColors.ControlDark;
|
||||
TxBTitle.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
TxBTitle.Font = new System.Drawing.Font("Segoe UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
TxBTitle.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
TxBTitle.Location = new System.Drawing.Point(54, 13);
|
||||
TxBTitle.Name = "TxBTitle";
|
||||
TxBTitle.ReadOnly = true;
|
||||
TxBTitle.Size = new System.Drawing.Size(683, 32);
|
||||
TxBTitle.TabIndex = 0;
|
||||
TxBTitle.MouseDown += window_MouseDown;
|
||||
//
|
||||
// ButtonClose
|
||||
//
|
||||
ButtonClose.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
|
||||
ButtonClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
ButtonClose.FlatAppearance.BorderSize = 0;
|
||||
ButtonClose.FlatAppearance.MouseOverBackColor = System.Drawing.Color.DimGray;
|
||||
ButtonClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
ButtonClose.ForeColor = System.Drawing.SystemColors.ButtonFace;
|
||||
ButtonClose.Location = new System.Drawing.Point(759, 7);
|
||||
ButtonClose.Name = "ButtonClose";
|
||||
ButtonClose.Size = new System.Drawing.Size(29, 38);
|
||||
ButtonClose.TabIndex = 1;
|
||||
ButtonClose.Text = "X";
|
||||
ButtonClose.UseVisualStyleBackColor = false;
|
||||
ButtonClose.Click += ButtonClose_ClickHandler;
|
||||
//
|
||||
// TxBMessage
|
||||
//
|
||||
TxBMessage.BackColor = System.Drawing.SystemColors.ControlDark;
|
||||
TxBMessage.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
TxBMessage.Font = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
TxBMessage.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
TxBMessage.Location = new System.Drawing.Point(12, 57);
|
||||
TxBMessage.Name = "TxBMessage";
|
||||
TxBMessage.ReadOnly = true;
|
||||
TxBMessage.Size = new System.Drawing.Size(776, 191);
|
||||
TxBMessage.TabIndex = 2;
|
||||
TxBMessage.Text = "";
|
||||
TxBMessage.MouseDown += window_MouseDown;
|
||||
//
|
||||
// IconBox
|
||||
//
|
||||
IconBox.Location = new System.Drawing.Point(12, 12);
|
||||
IconBox.Name = "IconBox";
|
||||
IconBox.Size = new System.Drawing.Size(36, 39);
|
||||
IconBox.TabIndex = 3;
|
||||
IconBox.TabStop = false;
|
||||
//
|
||||
// ProgressBar1
|
||||
//
|
||||
ProgressBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
ProgressBar1.Enabled = false;
|
||||
ProgressBar1.ForeColor = System.Drawing.SystemColors.WindowFrame;
|
||||
ProgressBar1.Location = new System.Drawing.Point(70, 254);
|
||||
ProgressBar1.MarqueeAnimationSpeed = 1;
|
||||
ProgressBar1.Name = "ProgressBar1";
|
||||
ProgressBar1.Size = new System.Drawing.Size(718, 23);
|
||||
ProgressBar1.Step = 1;
|
||||
ProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
ProgressBar1.TabIndex = 4;
|
||||
ProgressBar1.Value = 100;
|
||||
//
|
||||
// LblTimeout
|
||||
//
|
||||
LblTimeout.AutoSize = true;
|
||||
LblTimeout.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
LblTimeout.Location = new System.Drawing.Point(21, 254);
|
||||
LblTimeout.Name = "LblTimeout";
|
||||
LblTimeout.Size = new System.Drawing.Size(43, 17);
|
||||
LblTimeout.TabIndex = 5;
|
||||
LblTimeout.Text = "label1";
|
||||
LblTimeout.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// NotificationDialog
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
BackColor = System.Drawing.SystemColors.ControlDark;
|
||||
ClientSize = new System.Drawing.Size(800, 289);
|
||||
Controls.Add(LblTimeout);
|
||||
Controls.Add(ProgressBar1);
|
||||
Controls.Add(IconBox);
|
||||
Controls.Add(TxBMessage);
|
||||
Controls.Add(ButtonClose);
|
||||
Controls.Add(TxBTitle);
|
||||
FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
Name = "NotificationDialog";
|
||||
Text = "NotificationDialog";
|
||||
Click += window_MouseDown;
|
||||
((System.ComponentModel.ISupportInitialize)IconBox).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox TxBTitle;
|
||||
private System.Windows.Forms.Button ButtonClose;
|
||||
private System.Windows.Forms.RichTextBox TxBMessage;
|
||||
private System.Windows.Forms.PictureBox IconBox;
|
||||
private System.Windows.Forms.ProgressBar ProgressBar1;
|
||||
private System.Windows.Forms.Label LblTimeout;
|
||||
}
|
||||
}
|
@@ -1,295 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using System.Diagnostics;
|
||||
using ntfysh_client.Themes;
|
||||
using Microsoft.Win32;
|
||||
using System.Media;
|
||||
|
||||
|
||||
namespace ntfysh_client
|
||||
{
|
||||
public partial class NotificationDialog : Form
|
||||
{
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
||||
private static extern bool AnimateWindow(IntPtr hWnd, int time, int flags);
|
||||
|
||||
private const int ScreenMargin = 20;
|
||||
|
||||
private int _timeoutSeconds = 0;
|
||||
private System.Timers.Timer? _displayTimeoutTimer = null;
|
||||
private System.Windows.Forms.Timer? _updateTimer = null;
|
||||
private Stopwatch? _shownStopwatch = null;
|
||||
|
||||
private readonly BaseTheme _darkModeTheme = new DarkModeTheme();
|
||||
private readonly BaseTheme _defaultTheme = new DefaultTheme();
|
||||
private BaseTheme? _theme = null;
|
||||
|
||||
public NotificationDialog()
|
||||
{
|
||||
ShowInTaskbar = false;
|
||||
Visible = false;
|
||||
TopMost = true;
|
||||
InitializeComponent();
|
||||
InitializeWindowHidden();
|
||||
}
|
||||
|
||||
public void ShowNotification(string title, string message, int timeoutSeconds = 0, ToolTipIcon? icon = null, bool showTimeOutBar = true, bool showInDarkMode = true, bool playNotificationSound = false)
|
||||
{
|
||||
if (Visible)
|
||||
{
|
||||
// close the current notification
|
||||
HandleTimeout(null, null);
|
||||
}
|
||||
|
||||
_theme = showInDarkMode ? _darkModeTheme : _defaultTheme;
|
||||
|
||||
ApplyTheme();
|
||||
|
||||
// setup data
|
||||
IconBox.Image = (icon is null) ? null : ConvertToolTipIconToImage(icon.Value);
|
||||
|
||||
TxBTitle.Text = title;
|
||||
TxBMessage.Text = message;
|
||||
|
||||
// setup timers
|
||||
if (_displayTimeoutTimer != null)
|
||||
{
|
||||
_displayTimeoutTimer.Stop();
|
||||
_displayTimeoutTimer.Dispose();
|
||||
}
|
||||
|
||||
if (_updateTimer != null)
|
||||
{
|
||||
_updateTimer.Stop();
|
||||
_updateTimer.Dispose();
|
||||
}
|
||||
|
||||
if (timeoutSeconds > 0)
|
||||
{
|
||||
_displayTimeoutTimer = new System.Timers.Timer(timeoutSeconds * 1000);
|
||||
_displayTimeoutTimer.Elapsed += HandleTimeout;
|
||||
_displayTimeoutTimer.Start();
|
||||
|
||||
if (showTimeOutBar)
|
||||
{
|
||||
ProgressBar1.Value = 100;
|
||||
_updateTimer = new System.Windows.Forms.Timer();
|
||||
_updateTimer.Interval = 100;
|
||||
_updateTimer.Tick += UpdateProgress;
|
||||
_updateTimer.Start();
|
||||
|
||||
_shownStopwatch = new Stopwatch();
|
||||
_shownStopwatch.Start();
|
||||
|
||||
ProgressBar1.Visible = true;
|
||||
LblTimeout.Visible = true;
|
||||
_timeoutSeconds = timeoutSeconds;
|
||||
}
|
||||
else
|
||||
{
|
||||
ProgressBar1.Visible = false;
|
||||
LblTimeout.Visible = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ProgressBar1.Visible = false;
|
||||
LblTimeout.Visible = false;
|
||||
}
|
||||
|
||||
// ok, show the window
|
||||
Show();
|
||||
ButtonClose.Focus(); // make sure the window is focused, not the title box.
|
||||
SetWindowPosition();
|
||||
|
||||
if (playNotificationSound) PlayNotificationSound();
|
||||
}
|
||||
|
||||
private void ApplyTheme()
|
||||
{
|
||||
_theme ??= _defaultTheme;
|
||||
|
||||
// back colors
|
||||
BackColor = _theme.BackgroundColor;
|
||||
TxBTitle.BackColor = _theme.BackgroundColor;
|
||||
TxBMessage.BackColor = _theme.BackgroundColor;
|
||||
LblTimeout.BackColor = _theme.BackgroundColor;
|
||||
ProgressBar1.BackColor = _theme.BackgroundColor;
|
||||
|
||||
// this one is not "hiding"
|
||||
ButtonClose.BackColor = _theme.ControlBackGroundColor;
|
||||
ButtonClose.ForeColor = _theme.BackgroundColor;
|
||||
// handle mouse over
|
||||
ButtonClose.FlatAppearance.MouseOverBackColor = _theme.ControlMouseOverBackgroundColor;
|
||||
|
||||
// fore colors
|
||||
ForeColor = _theme.ForegroundColor;
|
||||
TxBTitle.ForeColor = _theme.ForegroundColor;
|
||||
TxBMessage.ForeColor = _theme.ForegroundColor;
|
||||
LblTimeout.ForeColor = _theme.ForegroundColor;
|
||||
ProgressBar1.ForeColor = _theme.ForegroundColor;
|
||||
}
|
||||
|
||||
private void UpdateProgress(object? sender, EventArgs e)
|
||||
{
|
||||
if (_shownStopwatch is null) return;
|
||||
|
||||
ProgressBar1.Value = (_timeoutSeconds - _shownStopwatch.Elapsed.Seconds) * 100 / _timeoutSeconds;
|
||||
LblTimeout.Text = $@"{_timeoutSeconds - _shownStopwatch.Elapsed.Seconds}";
|
||||
}
|
||||
|
||||
protected override void SetVisibleCore(bool value)
|
||||
{
|
||||
SetWindowPosition();
|
||||
|
||||
if (value)
|
||||
{
|
||||
BringToFront();
|
||||
|
||||
AnimateWindow(
|
||||
Handle,
|
||||
time: 250,
|
||||
flags: NFWinUserAnimateWindowConstants.AW_SLIDE | NFWinUserAnimateWindowConstants.AW_VER_NEGATIVE
|
||||
);
|
||||
}
|
||||
|
||||
base.SetVisibleCore(value);
|
||||
}
|
||||
|
||||
private void SetWindowPosition()
|
||||
{
|
||||
var workingTop = Screen.PrimaryScreen.WorkingArea.Height - Height;
|
||||
Top = workingTop - NotificationDialog.ScreenMargin;
|
||||
|
||||
var workingLeft = Screen.PrimaryScreen.WorkingArea.Width - Width;
|
||||
Left = workingLeft - NotificationDialog.ScreenMargin;
|
||||
}
|
||||
|
||||
private void UIThreadAnimatedHideWindow(object? sender, EventArgs? e)
|
||||
{
|
||||
|
||||
AnimateWindow(
|
||||
Handle,
|
||||
time: 250,
|
||||
flags: NFWinUserAnimateWindowConstants.AW_SLIDE | NFWinUserAnimateWindowConstants.AW_VER_POSITIVE | NFWinUserAnimateWindowConstants.AW_HIDE
|
||||
);
|
||||
|
||||
Visible = false;
|
||||
}
|
||||
|
||||
private void HandleTimeout(object? sender, EventArgs? e)
|
||||
{
|
||||
CancelTimer();
|
||||
|
||||
if (InvokeRequired)
|
||||
{
|
||||
// on a background thread, so invoke on the UI thread
|
||||
Invoke(new Action(() => UIThreadAnimatedHideWindow(sender, e)));
|
||||
}
|
||||
else
|
||||
{
|
||||
// in the UI thread, invoke directly
|
||||
UIThreadAnimatedHideWindow(sender, e);
|
||||
}
|
||||
}
|
||||
|
||||
private Image? ConvertToolTipIconToImage(ToolTipIcon icon) => icon switch
|
||||
{
|
||||
ToolTipIcon.Info => SystemIcons.Information.ToBitmap(),
|
||||
ToolTipIcon.Warning => SystemIcons.Warning.ToBitmap(),
|
||||
ToolTipIcon.Error => SystemIcons.Error.ToBitmap(),
|
||||
_ => null
|
||||
};
|
||||
|
||||
private void InitializeWindowHidden()
|
||||
{
|
||||
Opacity = 0;
|
||||
ShowNotification("Title", "Message");
|
||||
ButtonClose.Focus();
|
||||
Visible = false;
|
||||
Opacity = 1;
|
||||
}
|
||||
|
||||
private void ButtonClose_ClickHandler(object sender, EventArgs e)
|
||||
{
|
||||
// don't animate, immediately "close"
|
||||
Visible = false;
|
||||
}
|
||||
|
||||
private class NFWinUserAnimateWindowConstants
|
||||
{
|
||||
public const int AW_HOR_POSITIVE = 0x00000001;
|
||||
public const int AW_HOR_NEGATIVE = 0x00000002;
|
||||
public const int AW_VER_POSITIVE = 0x00000004;
|
||||
public const int AW_VER_NEGATIVE = 0x00000008;
|
||||
public const int AW_CENTER = 0x00000010;
|
||||
public const int AW_HIDE = 0x00010000;
|
||||
public const int AW_ACTIVATE = 0x00020000;
|
||||
public const int AW_SLIDE = 0x00040000;
|
||||
public const int AW_BLEND = 0x00080000;
|
||||
}
|
||||
|
||||
private void window_MouseDown(object sender, EventArgs e) => CancelTimer();
|
||||
|
||||
private void CancelTimer()
|
||||
{
|
||||
if (InvokeRequired)
|
||||
{
|
||||
// on a background thread, so invoke on the UI thread
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
LblTimeout.Visible = false;
|
||||
ProgressBar1.Visible = false;
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
// in the UI thread, invoke directly
|
||||
LblTimeout.Visible = false;
|
||||
ProgressBar1.Visible = false;
|
||||
}
|
||||
|
||||
if (_displayTimeoutTimer != null) // check if the timer has already been disposed
|
||||
{
|
||||
_displayTimeoutTimer.Stop();
|
||||
_displayTimeoutTimer.Dispose();
|
||||
_displayTimeoutTimer = null;
|
||||
}
|
||||
|
||||
if (_updateTimer != null)
|
||||
{
|
||||
_updateTimer.Stop();
|
||||
_updateTimer.Dispose();
|
||||
_updateTimer = null;
|
||||
}
|
||||
|
||||
if (_shownStopwatch != null)
|
||||
{
|
||||
_shownStopwatch.Stop();
|
||||
_shownStopwatch = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void PlayNotificationSound()
|
||||
{
|
||||
try
|
||||
{
|
||||
using RegistryKey? defaultSoundPathKey = Registry.CurrentUser.OpenSubKey(@"AppEvents\Schemes\Apps\.Default\Notification.Default\.Current");
|
||||
|
||||
if (defaultSoundPathKey is null) throw new Exception();
|
||||
|
||||
if (defaultSoundPathKey.GetValue(null) is not string defaultSoundPath) throw new Exception();
|
||||
|
||||
SoundPlayer loadedSound = new(defaultSoundPath);
|
||||
|
||||
loadedSound.Play();
|
||||
}
|
||||
catch
|
||||
{
|
||||
SystemSounds.Beep.Play(); // consolation prize
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -6,6 +6,7 @@ using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http.Json;
|
||||
using System.Net.WebSockets;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
@@ -350,5 +351,25 @@ namespace ntfysh_client.Notifications
|
||||
//Remove the old topic
|
||||
SubscribedTopicsByUnique.Remove(topicUniqueString);
|
||||
}
|
||||
|
||||
public async Task SendNotification(string key, string title, string message)
|
||||
{
|
||||
if (SubscribedTopicsByUnique.TryGetValue(key, out SubscribedTopic topic))
|
||||
{
|
||||
HttpClient httpClient = new HttpClient();
|
||||
PublishEvent notification = new PublishEvent();
|
||||
notification.Title = title;
|
||||
notification.Message = message;
|
||||
notification.Topic = topic.TopicId;
|
||||
if (!string.IsNullOrEmpty(topic.Username) || !string.IsNullOrEmpty(topic.Password))
|
||||
{
|
||||
string value = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{topic.Username}:{topic.Password}"));
|
||||
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", value);
|
||||
}
|
||||
|
||||
HttpResponseMessage response = await httpClient.PostAsJsonAsync<PublishEvent>(topic.ServerUrl.Replace("wss://", "https://"), notification);
|
||||
response.EnsureSuccessStatusCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
50
ntfysh_client/Notifications/PublishEvent.cs
Normal file
50
ntfysh_client/Notifications/PublishEvent.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace ntfysh_client.Notifications
|
||||
{
|
||||
internal class PublishEvent
|
||||
{
|
||||
[JsonProperty("topic")]
|
||||
public string Topic { get; set; } = null!;
|
||||
|
||||
[JsonProperty("message")]
|
||||
public string? Message { get; set; } = null;
|
||||
|
||||
[JsonProperty("title")]
|
||||
public string? Title { get; set; } = null;
|
||||
|
||||
[JsonProperty("tags")]
|
||||
public string[] Tags { get; set; } = null!;
|
||||
|
||||
[JsonProperty("priority")]
|
||||
public NotificationPriority? Priority { get; set; } = null;
|
||||
|
||||
[JsonProperty("actions")]
|
||||
public JsonArray? Actions { get; set; } = null;
|
||||
|
||||
[JsonProperty("click")]
|
||||
public string? Click { get; set; } = null;
|
||||
|
||||
[JsonProperty("attach")]
|
||||
public string? Attach { get; set; } = null;
|
||||
|
||||
[JsonProperty("markdown")]
|
||||
public bool? Markdown { get; set; } = null;
|
||||
|
||||
[JsonProperty("icon")]
|
||||
public string? Icon { get; set; } = null;
|
||||
|
||||
[JsonProperty("filename")]
|
||||
public string? Filename { get; set; } = null;
|
||||
|
||||
[JsonProperty("delay")]
|
||||
public string? Delay { get; set; } = null;
|
||||
|
||||
[JsonProperty("email")]
|
||||
public string? Email { get; set; } = null;
|
||||
|
||||
[JsonProperty("call")]
|
||||
public string? Call { get; set; } = null;
|
||||
}
|
||||
}
|
108
ntfysh_client/SendMessageForm.Designer.cs
generated
Normal file
108
ntfysh_client/SendMessageForm.Designer.cs
generated
Normal file
@@ -0,0 +1,108 @@
|
||||
namespace ntfysh_client
|
||||
{
|
||||
partial class SendMessageForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
richTextBox = new System.Windows.Forms.RichTextBox();
|
||||
button2 = new System.Windows.Forms.Button();
|
||||
textBox = new System.Windows.Forms.TextBox();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
label2 = new System.Windows.Forms.Label();
|
||||
SuspendLayout();
|
||||
//
|
||||
// richTextBox
|
||||
//
|
||||
richTextBox.Location = new System.Drawing.Point(12, 71);
|
||||
richTextBox.Name = "richTextBox";
|
||||
richTextBox.Size = new System.Drawing.Size(365, 165);
|
||||
richTextBox.TabIndex = 0;
|
||||
richTextBox.Text = "";
|
||||
//
|
||||
// button2
|
||||
//
|
||||
button2.Location = new System.Drawing.Point(302, 242);
|
||||
button2.Name = "button2";
|
||||
button2.Size = new System.Drawing.Size(75, 23);
|
||||
button2.TabIndex = 2;
|
||||
button2.Text = "Send";
|
||||
button2.UseVisualStyleBackColor = true;
|
||||
button2.Click += button2_Click;
|
||||
//
|
||||
// textBox
|
||||
//
|
||||
textBox.Location = new System.Drawing.Point(12, 27);
|
||||
textBox.Name = "textBox";
|
||||
textBox.Size = new System.Drawing.Size(365, 23);
|
||||
textBox.TabIndex = 3;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new System.Drawing.Point(12, 53);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(56, 15);
|
||||
label1.TabIndex = 4;
|
||||
label1.Text = "Message:";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new System.Drawing.Point(12, 9);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new System.Drawing.Size(33, 15);
|
||||
label2.TabIndex = 5;
|
||||
label2.Text = "Title:";
|
||||
//
|
||||
// SendMessageForm
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
ClientSize = new System.Drawing.Size(389, 277);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(label1);
|
||||
Controls.Add(textBox);
|
||||
Controls.Add(button2);
|
||||
Controls.Add(richTextBox);
|
||||
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
MaximizeBox = false;
|
||||
MinimizeBox = false;
|
||||
Name = "SendMessageForm";
|
||||
Text = "Send Message";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.RichTextBox richTextBox;
|
||||
private System.Windows.Forms.Button button2;
|
||||
private System.Windows.Forms.TextBox textBox;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
}
|
||||
}
|
21
ntfysh_client/SendMessageForm.cs
Normal file
21
ntfysh_client/SendMessageForm.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ntfysh_client
|
||||
{
|
||||
public partial class SendMessageForm : Form
|
||||
{
|
||||
public string Message => richTextBox.Text;
|
||||
public string Title => textBox.Text;
|
||||
|
||||
public SendMessageForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
120
ntfysh_client/SettingsDialog.Designer.cs
generated
120
ntfysh_client/SettingsDialog.Designer.cs
generated
@@ -38,20 +38,10 @@ namespace ntfysh_client
|
||||
reconnectAttemptsLabel = new System.Windows.Forms.Label();
|
||||
reconnectAttemptDelay = new System.Windows.Forms.NumericUpDown();
|
||||
reconnectAttemptDelayLabel = new System.Windows.Forms.Label();
|
||||
nativeVersusCustomNotificationsGroupBox = new System.Windows.Forms.GroupBox();
|
||||
useCustomTrayNotifications = new System.Windows.Forms.RadioButton();
|
||||
useNativeWindowsNotifications = new System.Windows.Forms.RadioButton();
|
||||
groupCustomNotificationSettings = new System.Windows.Forms.GroupBox();
|
||||
customNotificationsPlayWindowsNotificationAudio = new System.Windows.Forms.CheckBox();
|
||||
customNotificationsShowInDarkMode = new System.Windows.Forms.CheckBox();
|
||||
customNotificationsShowTimeoutBar = new System.Windows.Forms.CheckBox();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
buttonPanel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)timeout).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)reconnectAttempts).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)reconnectAttemptDelay).BeginInit();
|
||||
nativeVersusCustomNotificationsGroupBox.SuspendLayout();
|
||||
groupCustomNotificationSettings.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// buttonPanel
|
||||
@@ -60,7 +50,7 @@ namespace ntfysh_client
|
||||
buttonPanel.Controls.Add(cancelButton);
|
||||
buttonPanel.Controls.Add(saveButton);
|
||||
buttonPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
buttonPanel.Location = new System.Drawing.Point(0, 336);
|
||||
buttonPanel.Location = new System.Drawing.Point(0, 150);
|
||||
buttonPanel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
buttonPanel.Name = "buttonPanel";
|
||||
buttonPanel.Size = new System.Drawing.Size(531, 51);
|
||||
@@ -92,9 +82,9 @@ namespace ntfysh_client
|
||||
timeoutLabel.Location = new System.Drawing.Point(13, 9);
|
||||
timeoutLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
timeoutLabel.Name = "timeoutLabel";
|
||||
timeoutLabel.Size = new System.Drawing.Size(401, 15);
|
||||
timeoutLabel.Size = new System.Drawing.Size(488, 15);
|
||||
timeoutLabel.TabIndex = 3;
|
||||
timeoutLabel.Text = "Notification Toast Timeout (seconds, use -1 to require closing notification):";
|
||||
timeoutLabel.Text = "Notification Toast Timeout (seconds, may be ignored by OS based on accessibility settings):";
|
||||
//
|
||||
// timeout
|
||||
//
|
||||
@@ -118,7 +108,7 @@ namespace ntfysh_client
|
||||
reconnectAttemptsLabel.Location = new System.Drawing.Point(12, 54);
|
||||
reconnectAttemptsLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
reconnectAttemptsLabel.Name = "reconnectAttemptsLabel";
|
||||
reconnectAttemptsLabel.Size = new System.Drawing.Size(287, 15);
|
||||
reconnectAttemptsLabel.Size = new System.Drawing.Size(198, 15);
|
||||
reconnectAttemptsLabel.TabIndex = 5;
|
||||
reconnectAttemptsLabel.Text = "Maximum reconnect retry attempts (requires restart):";
|
||||
//
|
||||
@@ -136,102 +126,16 @@ namespace ntfysh_client
|
||||
reconnectAttemptDelayLabel.Location = new System.Drawing.Point(12, 99);
|
||||
reconnectAttemptDelayLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
reconnectAttemptDelayLabel.Name = "reconnectAttemptDelayLabel";
|
||||
reconnectAttemptDelayLabel.Size = new System.Drawing.Size(275, 15);
|
||||
reconnectAttemptDelayLabel.Size = new System.Drawing.Size(191, 15);
|
||||
reconnectAttemptDelayLabel.TabIndex = 7;
|
||||
reconnectAttemptDelayLabel.Text = "Delay between attempts (seconds, requires restart):";
|
||||
//
|
||||
// nativeVersusCustomNotificationsGroupBox
|
||||
//
|
||||
nativeVersusCustomNotificationsGroupBox.Controls.Add(useCustomTrayNotifications);
|
||||
nativeVersusCustomNotificationsGroupBox.Controls.Add(useNativeWindowsNotifications);
|
||||
nativeVersusCustomNotificationsGroupBox.Location = new System.Drawing.Point(12, 147);
|
||||
nativeVersusCustomNotificationsGroupBox.Name = "nativeVersusCustomNotificationsGroupBox";
|
||||
nativeVersusCustomNotificationsGroupBox.Size = new System.Drawing.Size(506, 67);
|
||||
nativeVersusCustomNotificationsGroupBox.TabIndex = 9;
|
||||
nativeVersusCustomNotificationsGroupBox.TabStop = false;
|
||||
//
|
||||
// useCustomTrayNotifications
|
||||
//
|
||||
useCustomTrayNotifications.AutoSize = true;
|
||||
useCustomTrayNotifications.Location = new System.Drawing.Point(6, 40);
|
||||
useCustomTrayNotifications.Name = "useCustomTrayNotifications";
|
||||
useCustomTrayNotifications.Size = new System.Drawing.Size(267, 19);
|
||||
useCustomTrayNotifications.TabIndex = 1;
|
||||
useCustomTrayNotifications.TabStop = true;
|
||||
useCustomTrayNotifications.Text = "Use ntfysh-windows custom tray notifications";
|
||||
useCustomTrayNotifications.UseVisualStyleBackColor = true;
|
||||
useCustomTrayNotifications.CheckedChanged += UseCustomTrayNotifications_CheckedChanged;
|
||||
//
|
||||
// useNativeWindowsNotifications
|
||||
//
|
||||
useNativeWindowsNotifications.AutoSize = true;
|
||||
useNativeWindowsNotifications.Location = new System.Drawing.Point(6, 15);
|
||||
useNativeWindowsNotifications.Name = "useNativeWindowsNotifications";
|
||||
useNativeWindowsNotifications.Size = new System.Drawing.Size(203, 19);
|
||||
useNativeWindowsNotifications.TabIndex = 0;
|
||||
useNativeWindowsNotifications.TabStop = true;
|
||||
useNativeWindowsNotifications.Text = "Use Windows' native notifications";
|
||||
useNativeWindowsNotifications.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// groupCustomNotificationSettings
|
||||
//
|
||||
groupCustomNotificationSettings.Controls.Add(customNotificationsPlayWindowsNotificationAudio);
|
||||
groupCustomNotificationSettings.Controls.Add(customNotificationsShowInDarkMode);
|
||||
groupCustomNotificationSettings.Controls.Add(customNotificationsShowTimeoutBar);
|
||||
groupCustomNotificationSettings.Location = new System.Drawing.Point(12, 243);
|
||||
groupCustomNotificationSettings.Name = "groupCustomNotificationSettings";
|
||||
groupCustomNotificationSettings.Size = new System.Drawing.Size(504, 87);
|
||||
groupCustomNotificationSettings.TabIndex = 10;
|
||||
groupCustomNotificationSettings.TabStop = false;
|
||||
//
|
||||
// customNotificationsPlayWindowsNotificationAudio
|
||||
//
|
||||
customNotificationsPlayWindowsNotificationAudio.AutoSize = true;
|
||||
customNotificationsPlayWindowsNotificationAudio.Location = new System.Drawing.Point(4, 59);
|
||||
customNotificationsPlayWindowsNotificationAudio.Name = "customNotificationsPlayWindowsNotificationAudio";
|
||||
customNotificationsPlayWindowsNotificationAudio.Size = new System.Drawing.Size(200, 19);
|
||||
customNotificationsPlayWindowsNotificationAudio.TabIndex = 2;
|
||||
customNotificationsPlayWindowsNotificationAudio.Text = "Play Windows notification sound";
|
||||
customNotificationsPlayWindowsNotificationAudio.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// customNotificationsShowInDarkMode
|
||||
//
|
||||
customNotificationsShowInDarkMode.AutoSize = true;
|
||||
customNotificationsShowInDarkMode.Location = new System.Drawing.Point(6, 37);
|
||||
customNotificationsShowInDarkMode.Name = "customNotificationsShowInDarkMode";
|
||||
customNotificationsShowInDarkMode.Size = new System.Drawing.Size(197, 19);
|
||||
customNotificationsShowInDarkMode.TabIndex = 1;
|
||||
customNotificationsShowInDarkMode.Text = "Show notifications in dark mode";
|
||||
customNotificationsShowInDarkMode.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// customNotificationsShowTimeoutBar
|
||||
//
|
||||
customNotificationsShowTimeoutBar.AutoSize = true;
|
||||
customNotificationsShowTimeoutBar.Location = new System.Drawing.Point(6, 14);
|
||||
customNotificationsShowTimeoutBar.Name = "customNotificationsShowTimeoutBar";
|
||||
customNotificationsShowTimeoutBar.Size = new System.Drawing.Size(211, 19);
|
||||
customNotificationsShowTimeoutBar.TabIndex = 0;
|
||||
customNotificationsShowTimeoutBar.Text = "Show time-out bar on notifications";
|
||||
customNotificationsShowTimeoutBar.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new System.Drawing.Point(12, 227);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(180, 15);
|
||||
label1.TabIndex = 11;
|
||||
label1.Text = "Custom tray notification settings";
|
||||
//
|
||||
// SettingsDialog
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
BackColor = System.Drawing.Color.White;
|
||||
ClientSize = new System.Drawing.Size(531, 387);
|
||||
Controls.Add(label1);
|
||||
Controls.Add(groupCustomNotificationSettings);
|
||||
Controls.Add(nativeVersusCustomNotificationsGroupBox);
|
||||
ClientSize = new System.Drawing.Size(531, 201);
|
||||
Controls.Add(reconnectAttemptDelay);
|
||||
Controls.Add(reconnectAttemptDelayLabel);
|
||||
Controls.Add(reconnectAttempts);
|
||||
@@ -252,10 +156,6 @@ namespace ntfysh_client
|
||||
((System.ComponentModel.ISupportInitialize)timeout).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)reconnectAttempts).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)reconnectAttemptDelay).EndInit();
|
||||
nativeVersusCustomNotificationsGroupBox.ResumeLayout(false);
|
||||
nativeVersusCustomNotificationsGroupBox.PerformLayout();
|
||||
groupCustomNotificationSettings.ResumeLayout(false);
|
||||
groupCustomNotificationSettings.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
@@ -271,13 +171,5 @@ namespace ntfysh_client
|
||||
private System.Windows.Forms.Label reconnectAttemptsLabel;
|
||||
private System.Windows.Forms.NumericUpDown reconnectAttemptDelay;
|
||||
private System.Windows.Forms.Label reconnectAttemptDelayLabel;
|
||||
private System.Windows.Forms.GroupBox nativeVersusCustomNotificationsGroupBox;
|
||||
private System.Windows.Forms.RadioButton useCustomTrayNotifications;
|
||||
private System.Windows.Forms.RadioButton useNativeWindowsNotifications;
|
||||
private System.Windows.Forms.GroupBox groupCustomNotificationSettings;
|
||||
private System.Windows.Forms.CheckBox customNotificationsShowTimeoutBar;
|
||||
private System.Windows.Forms.CheckBox customNotificationsShowInDarkMode;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.CheckBox customNotificationsPlayWindowsNotificationAudio;
|
||||
}
|
||||
}
|
@@ -1,13 +1,10 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using static ntfysh_client.SettingsModel;
|
||||
|
||||
namespace ntfysh_client
|
||||
{
|
||||
public partial class SettingsDialog : Form
|
||||
{
|
||||
public NotificationsType NotificationsMethod { get; set; }
|
||||
|
||||
public decimal Timeout
|
||||
{
|
||||
get => timeout.Value;
|
||||
@@ -26,53 +23,9 @@ namespace ntfysh_client
|
||||
set => reconnectAttemptDelay.Value = value;
|
||||
}
|
||||
|
||||
#region: Native vs custom notifications options. Because these are in a group box, these are mutualy exclusive.
|
||||
public bool UseNativeWindowsNotifications
|
||||
{
|
||||
get => useNativeWindowsNotifications.Checked;
|
||||
set
|
||||
{
|
||||
useNativeWindowsNotifications.Checked = value;
|
||||
groupCustomNotificationSettings.Enabled = !value;
|
||||
NotificationsMethod = (value) ? NotificationsType.NativeWindows : NotificationsType.CustomTray;
|
||||
}
|
||||
}
|
||||
|
||||
public bool UseCustomTrayNotifications
|
||||
{
|
||||
get => useCustomTrayNotifications.Checked;
|
||||
set {
|
||||
useCustomTrayNotifications.Checked = value;
|
||||
groupCustomNotificationSettings.Enabled = value;
|
||||
NotificationsMethod = (value) ? NotificationsType.NativeWindows : NotificationsType.CustomTray;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region: Custom tray notification options
|
||||
public bool CustomTrayNotificationsShowTimeoutBar
|
||||
{
|
||||
get => customNotificationsShowTimeoutBar.Checked;
|
||||
set => customNotificationsShowTimeoutBar.Checked = value;
|
||||
}
|
||||
|
||||
public bool CustomTrayNotificationsShowInDarkMode
|
||||
{
|
||||
get => customNotificationsShowInDarkMode.Checked;
|
||||
set => customNotificationsShowInDarkMode.Checked = value;
|
||||
}
|
||||
|
||||
public bool CustomTrayNotificationsPlayDefaultWindowsSound
|
||||
{
|
||||
get => customNotificationsPlayWindowsNotificationAudio.Checked;
|
||||
set => customNotificationsPlayWindowsNotificationAudio.Checked = value;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public SettingsDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
SetNotificationsUiElements();
|
||||
}
|
||||
|
||||
private void saveButton_Click(object sender, EventArgs e)
|
||||
@@ -84,19 +37,5 @@ namespace ntfysh_client
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
private void SetNotificationsUiElements()
|
||||
{
|
||||
groupCustomNotificationSettings.Enabled = useCustomTrayNotifications.Checked;
|
||||
timeoutLabel.Text = useCustomTrayNotifications.Checked ? _customNotificationsTimeout : _windowsNotificationsTimeout;
|
||||
}
|
||||
|
||||
private void UseCustomTrayNotifications_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetNotificationsUiElements();
|
||||
}
|
||||
|
||||
private const string _windowsNotificationsTimeout = "Notification Toast Timeout (seconds, may be ignored by OS based on accessibility settings):";
|
||||
private const string _customNotificationsTimeout = "Notification Toast Timeout (seconds, use 0 to require closing notification):";
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
|
@@ -2,19 +2,9 @@
|
||||
{
|
||||
public class SettingsModel
|
||||
{
|
||||
public enum NotificationsType
|
||||
{
|
||||
NativeWindows,
|
||||
CustomTray
|
||||
}
|
||||
|
||||
public uint Revision { get; set; }
|
||||
public decimal Timeout { get; set; }
|
||||
public decimal ReconnectAttempts { get; set; }
|
||||
public decimal ReconnectAttemptDelay { get; set; }
|
||||
public NotificationsType NotificationsMethod { get; set; }
|
||||
public bool CustomTrayNotificationsShowTimeoutBar { get; set; }
|
||||
public bool CustomTrayNotificationsShowInDarkMode { get; set; }
|
||||
public bool CustomTrayNotificationsPlayDefaultWindowsSound { get; set; }
|
||||
}
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace ntfysh_client.Themes
|
||||
{
|
||||
internal abstract class BaseTheme
|
||||
{
|
||||
public abstract Color BackgroundColor {get; }
|
||||
public abstract Color ControlBackGroundColor {get; }
|
||||
public abstract Color ControlMouseOverBackgroundColor { get; }
|
||||
public abstract Color ForegroundColor { get; }
|
||||
}
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace ntfysh_client.Themes
|
||||
{
|
||||
internal class DarkModeTheme: BaseTheme
|
||||
{
|
||||
public override Color BackgroundColor { get => SystemColors.ControlDark; }
|
||||
public override Color ControlBackGroundColor { get => Color.Black; }
|
||||
public override Color ControlMouseOverBackgroundColor { get => Color.Silver; }
|
||||
public override Color ForegroundColor { get => SystemColors.WindowText; }
|
||||
}
|
||||
}
|
@@ -1,12 +0,0 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace ntfysh_client.Themes
|
||||
{
|
||||
internal class DefaultTheme: BaseTheme
|
||||
{
|
||||
public override Color BackgroundColor { get => Color.White; }
|
||||
public override Color ControlBackGroundColor { get => SystemColors.ControlDark; }
|
||||
public override Color ControlMouseOverBackgroundColor { get => Color.CadetBlue; }
|
||||
public override Color ForegroundColor { get => SystemColors.WindowText; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user