Winify

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 20  →  ?path2? @ 21
/trunk/Notifications/Announcement.cs
@@ -66,9 +66,9 @@
 
private int _appId;
 
private int _lingerTime;
private int _lingerTime = 5000;
 
private string _speak;
private string _speak = string.Empty;
 
#endregion
 
/trunk/Servers/Server.cs
@@ -78,13 +78,13 @@
 
#region Private Delegates, Events, Enums, Properties, Indexers and Fields
 
private string _name;
private string _name = string.Empty;
 
private string _password;
private string _password = string.Empty;
 
private string _url;
private string _url = string.Empty;
 
private string _username;
private string _username = string.Empty;
 
#endregion
 
/trunk/Winify/App.config
@@ -3,10 +3,10 @@
<configuration>
<configSections>
<sectionGroup name="userSettings"
type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Winify.Properties.Settings"
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
@@ -14,13 +14,13 @@
</startup>
<userSettings>
<Winify.Properties.Settings>
<setting name="LaunchOnBoot" serializeAs="String">
<value>False</value>
</setting>
<setting name="UpdateRequired" serializeAs="String">
<value>True</value>
</setting>
</Winify.Properties.Settings>
<setting name="LaunchOnBoot" serializeAs="String">
<value>False</value>
</setting>
<setting name="UpdateRequired" serializeAs="String">
<value>True</value>
</setting>
</Winify.Properties.Settings>
</userSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
/trunk/Winify/Form1.cs
@@ -22,7 +22,7 @@
{
#region Private Delegates, Events, Enums, Properties, Indexers and Fields
 
private readonly Announcements.Announcements _notifications;
private readonly Announcements.Announcements _announcements;
 
private readonly global::Servers.Servers _servers;
 
@@ -74,8 +74,10 @@
 
_servers = new global::Servers.Servers();
_servers.Server.CollectionChanged += Server_CollectionChanged;
_notifications = new Announcements.Announcements();
_notifications.Announcement.CollectionChanged += Announcements_CollectionChanged;
_servers.Server.ListChanged += Server_ListChanged;
_announcements = new Announcements.Announcements();
_announcements.Announcement.CollectionChanged += Announcements_CollectionChanged;
_announcements.Announcement.ListChanged += Announcement_ListChanged;
 
_taskScheduler = TaskScheduler.FromCurrentSynchronizationContext();
 
@@ -100,7 +102,7 @@
 
foreach (var announcement in restoreAnnouncements.Announcement)
{
_notifications.Announcement.Add(announcement);
_announcements.Announcement.Add(announcement);
}
});
 
@@ -117,7 +119,7 @@
if (disposing && components != null)
{
_servers.Server.CollectionChanged -= Server_CollectionChanged;
_notifications.Announcement.CollectionChanged -= Announcements_CollectionChanged;
_announcements.Announcement.CollectionChanged -= Announcements_CollectionChanged;
 
Settings.Default.SettingsLoaded -= Default_SettingsLoaded;
Settings.Default.SettingsSaving -= Default_SettingsSaving;
@@ -140,45 +142,29 @@
 
#region Event Handlers
 
private async void Announcement_ListChanged(object sender, ListChangedEventArgs e)
{
await SaveAnnouncements();
}
 
private async void Server_ListChanged(object sender, ListChangedEventArgs e)
{
await SaveServers();
}
 
private async void Announcements_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
switch (await ServersSerialization.Serialize(_notifications, Constants.NotificationsFile, "Announcements",
"<!ATTLIST Announcements xmlns:xsi CDATA #IMPLIED xsi:noNamespaceSchemaLocation CDATA #IMPLIED>"))
{
case SerializationFailure serializationFailure:
Log.Warning(serializationFailure.Exception, "Unable to serialize announcements.");
break;
}
await SaveAnnouncements();
}
 
private void GotifyConnectionManager_GotifyNotification(object sender, GotifyNotificationEventArgs e)
{
_notificationManager.ShowNotification(e, _notifications);
_notificationManager.ShowNotification(e, _announcements);
}
 
private async void Server_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
// Encrypt password for all servers.
var deviceId = Miscellaneous.GetMachineGuid();
var @protected = new global::Servers.Servers
{
Server = new BindingListWithCollectionChanged<Server>()
};
foreach (var server in _servers.Server)
{
var encrypted = AES.Encrypt(Encoding.UTF8.GetBytes(server.Password), deviceId);
var armored = Convert.ToBase64String(encrypted);
 
@protected.Server.Add(new Server(server.Name, server.Url, server.Username, armored));
}
 
switch (await ServersSerialization.Serialize(@protected, Constants.ServersFile, "Servers",
"<!ATTLIST Servers xmlns:xsi CDATA #IMPLIED xsi:noNamespaceSchemaLocation CDATA #IMPLIED>"))
{
case SerializationFailure serializationFailure:
Log.Warning(serializationFailure.Exception, "Unable to serialize servers.");
break;
}
await SaveServers();
}
 
private static void Default_PropertyChanged(object sender, PropertyChangedEventArgs e)
@@ -201,7 +187,7 @@
return;
}
 
_settingsForm = new SettingsForm(_servers, _notifications);
_settingsForm = new SettingsForm(_servers, _announcements);
_settingsForm.Closing += SettingsForm_Closing;
_settingsForm.Show();
}
@@ -258,6 +244,42 @@
 
#region Private Methods
 
private async Task SaveAnnouncements()
{
switch (await ServersSerialization.Serialize(_announcements, Constants.NotificationsFile, "Announcements",
"<!ATTLIST Announcements xmlns:xsi CDATA #IMPLIED xsi:noNamespaceSchemaLocation CDATA #IMPLIED>"))
{
case SerializationFailure serializationFailure:
Log.Warning(serializationFailure.Exception, "Unable to serialize announcements.");
break;
}
}
 
private async Task SaveServers()
{
// Encrypt password for all servers.
var deviceId = Miscellaneous.GetMachineGuid();
var @protected = new global::Servers.Servers
{
Server = new BindingListWithCollectionChanged<Server>()
};
foreach (var server in _servers.Server)
{
var encrypted = AES.Encrypt(Encoding.UTF8.GetBytes(server.Password), deviceId);
var armored = Convert.ToBase64String(encrypted);
 
@protected.Server.Add(new Server(server.Name, server.Url, server.Username, armored));
}
 
switch (await ServersSerialization.Serialize(@protected, Constants.ServersFile, "Servers",
"<!ATTLIST Servers xmlns:xsi CDATA #IMPLIED xsi:noNamespaceSchemaLocation CDATA #IMPLIED>"))
{
case SerializationFailure serializationFailure:
Log.Warning(serializationFailure.Exception, "Unable to serialize servers.");
break;
}
}
 
private static async Task<Announcements.Announcements> LoadAnnouncements()
{
if (!Directory.Exists(Constants.UserApplicationDirectory))
@@ -273,6 +295,9 @@
{
case SerializationSuccess<Announcements.Announcements> serializationSuccess:
return serializationSuccess.Result;
case SerializationFailure serializationFailure:
Log.Warning(serializationFailure.Exception, "Unable to load announcements.");
return new Announcements.Announcements();
default:
return new Announcements.Announcements();
}
@@ -308,6 +333,10 @@
 
return @protected;
 
case SerializationFailure serializationFailure:
Log.Warning(serializationFailure.Exception, "Unable to load servers.");
return new global::Servers.Servers();
 
default:
return new global::Servers.Servers();
}
/trunk/Winify/Gotify/GotifyConnection.cs
@@ -108,83 +108,92 @@
{
try
{
_webSocketClient = new ClientWebSocket();
using (_webSocketClient = new ClientWebSocket())
{
var auth = Convert.ToBase64String(Encoding.Default.GetBytes($"{username}:{password}"));
 
var auth = Convert.ToBase64String(Encoding.Default.GetBytes($"{username}:{password}"));
_webSocketClient.Options.SetRequestHeader("Authorization", $"Basic {auth}");
 
_webSocketClient.Options.SetRequestHeader("Authorization", $"Basic {auth}");
await _webSocketClient.ConnectAsync(webSocketsUri, cancellationToken);
 
await _webSocketClient.ConnectAsync(webSocketsUri, cancellationToken);
 
do
{
var payload = new ArraySegment<byte>(new byte[1024]);
 
await _webSocketClient.ReceiveAsync(payload, cancellationToken);
 
if (payload.Array == null || payload.Count == 0)
do
{
continue;
}
var payload = new ArraySegment<byte>(new byte[1024]);
 
var message = Encoding.UTF8.GetString(payload.Array, 0, payload.Count);
var result = await _webSocketClient.ReceiveAsync(payload, cancellationToken);
 
var gotifyNotification = JsonConvert.DeserializeObject<GotifyNotification>(message);
if (gotifyNotification == null)
{
continue;
}
if (result.Count == 0)
{
continue;
}
 
if (!Uri.TryCreate($"{httpUri}/application", UriKind.Absolute, out var applicationUri))
{
continue;
}
if (payload.Array == null || payload.Count == 0)
{
continue;
}
 
var applications = await _httpClient.GetStringAsync(applicationUri);
var message = Encoding.UTF8.GetString(payload.Array, 0, payload.Count);
 
var gotifyApplications = JsonConvert.DeserializeObject<GotifyApplication[]>(applications);
if (gotifyApplications == null)
{
continue;
}
 
foreach (var application in gotifyApplications)
{
if (application.Id != gotifyNotification.AppId)
var gotifyNotification = JsonConvert.DeserializeObject<GotifyNotification>(message);
if (gotifyNotification == null)
{
continue;
}
 
if (!Uri.TryCreate($"{httpUri}/{application.Image}", UriKind.Absolute,
out var applicationImageUri))
if (!Uri.TryCreate($"{httpUri}/application", UriKind.Absolute, out var applicationUri))
{
continue;
}
 
var imageBytes = await _httpClient.GetByteArrayAsync(applicationImageUri);
var applications = await _httpClient.GetStringAsync(applicationUri);
 
if (imageBytes == null || imageBytes.Length == 0)
var gotifyApplications =
JsonConvert.DeserializeObject<GotifyApplication[]>(applications);
if (gotifyApplications == null)
{
continue;
}
 
using (var memoryStream = new MemoryStream(imageBytes))
foreach (var application in gotifyApplications)
{
var image = Image.FromStream(memoryStream);
if (application.Id != gotifyNotification.AppId)
{
continue;
}
 
GotifyNotification?.Invoke(this,
new GotifyNotificationEventArgs(gotifyNotification, image));
if (!Uri.TryCreate($"{httpUri}/{application.Image}", UriKind.Absolute,
out var applicationImageUri))
{
continue;
}
 
var imageBytes = await _httpClient.GetByteArrayAsync(applicationImageUri);
 
if (imageBytes == null || imageBytes.Length == 0)
{
continue;
}
 
using (var memoryStream = new MemoryStream(imageBytes))
{
var image = Image.FromStream(memoryStream);
 
GotifyNotification?.Invoke(this,
new GotifyNotificationEventArgs(gotifyNotification, image));
}
 
 
break;
}
 
Log.Debug($"Notification message received: {gotifyNotification.Message}");
} while (!cancellationToken.IsCancellationRequested);
 
break;
}
await _webSocketClient.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty,
CancellationToken.None);
}
 
Log.Debug($"Notification message received: {gotifyNotification.Message}");
} while (!cancellationToken.IsCancellationRequested);
 
await _webSocketClient.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty,
CancellationToken.None);
_webSocketClient = null;
}
catch (Exception ex) when (ex is WebSocketException || ex is HttpRequestException)
{
/trunk/Winify/Gotify/GotifyConnectionManager.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using Servers;
 
@@ -34,11 +35,13 @@
_servers = servers;
 
_servers.Server.CollectionChanged += Server_CollectionChanged;
_servers.Server.ListChanged += Server_ListChanged;
}
 
public void Dispose()
{
_servers.Server.CollectionChanged -= Server_CollectionChanged;
_servers.Server.ListChanged -= Server_ListChanged;
}
 
#endregion
@@ -45,6 +48,21 @@
 
#region Event Handlers
 
private void Server_ListChanged(object sender, ListChangedEventArgs e)
{
if (e.ListChangedType != ListChangedType.ItemChanged)
{
return;
}
 
var server = _servers.Server[e.NewIndex];
 
if (RemoveConnection(server))
{
CreateConnection(server);
}
}
 
private void Server_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.NewItems != null)
@@ -51,11 +69,7 @@
{
foreach (var server in e.NewItems.OfType<Server>())
{
var connection = new GotifyConnection();
connection.GotifyNotification += Connection_GotifyNotification;
 
connection.Start(server.Username, server.Password, server.Url);
_gotifyConnections.TryAdd(server.Name, connection);
CreateConnection(server);
}
}
 
@@ -63,15 +77,7 @@
{
foreach (var server in e.OldItems.OfType<Server>())
{
if (!_gotifyConnections.TryRemove(server.Name, out var gotifyConnection))
{
continue;
}
 
gotifyConnection.GotifyNotification -= Connection_GotifyNotification;
 
gotifyConnection.Stop();
gotifyConnection.Dispose();
RemoveConnection(server);
}
}
}
@@ -82,5 +88,34 @@
}
 
#endregion
 
#region Private Methods
 
private bool RemoveConnection(Server server)
{
if (!_gotifyConnections.TryRemove(server.Url, out var gotifyConnection))
{
return false;
}
 
gotifyConnection.GotifyNotification -= Connection_GotifyNotification;
 
gotifyConnection.Stop();
gotifyConnection.Dispose();
gotifyConnection = null;
 
return true;
}
 
private void CreateConnection(Server server)
{
var connection = new GotifyConnection();
connection.GotifyNotification += Connection_GotifyNotification;
 
connection.Start(server.Username, server.Password, server.Url);
_gotifyConnections.TryAdd(server.Url, connection);
}
 
#endregion
}
}
/trunk/Winify/SettingsForm.Designer.cs
@@ -37,11 +37,6 @@
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.listBox1 = new System.Windows.Forms.ListBox();
this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel();
this.button2 = new System.Windows.Forms.Button();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.serverNameTextBox = new System.Windows.Forms.TextBox();
@@ -52,15 +47,14 @@
this.serverUsernameTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.serverPasswordTextBox = new System.Windows.Forms.TextBox();
this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.listBox1 = new System.Windows.Forms.ListBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.tableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel();
this.listBox2 = new System.Windows.Forms.ListBox();
this.tableLayoutPanel8 = new System.Windows.Forms.TableLayoutPanel();
this.button3 = new System.Windows.Forms.Button();
this.tableLayoutPanel9 = new System.Windows.Forms.TableLayoutPanel();
this.button4 = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.tableLayoutPanel10 = new System.Windows.Forms.TableLayoutPanel();
this.speakTextBox = new System.Windows.Forms.TextBox();
@@ -69,7 +63,12 @@
this.label6 = new System.Windows.Forms.Label();
this.lingerTimeTextBox = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
this.button4 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.listBox2 = new System.Windows.Forms.ListBox();
this.tabControl1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout();
@@ -76,18 +75,17 @@
this.groupBox3.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel6.SuspendLayout();
this.tableLayoutPanel4.SuspendLayout();
this.groupBox1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.tableLayoutPanel5.SuspendLayout();
this.groupBox5.SuspendLayout();
this.tabPage3.SuspendLayout();
this.tableLayoutPanel7.SuspendLayout();
this.tableLayoutPanel8.SuspendLayout();
this.tableLayoutPanel9.SuspendLayout();
this.groupBox2.SuspendLayout();
this.tableLayoutPanel10.SuspendLayout();
this.tableLayoutPanel4.SuspendLayout();
this.tableLayoutPanel5.SuspendLayout();
this.groupBox4.SuspendLayout();
this.SuspendLayout();
//
@@ -100,7 +98,7 @@
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(554, 286);
this.tabControl1.Size = new System.Drawing.Size(584, 302);
this.tabControl1.TabIndex = 0;
//
// tabPage2
@@ -108,7 +106,7 @@
this.tabPage2.Controls.Add(this.flowLayoutPanel2);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Size = new System.Drawing.Size(546, 260);
this.tabPage2.Size = new System.Drawing.Size(576, 276);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Application";
this.tabPage2.UseVisualStyleBackColor = true;
@@ -119,7 +117,7 @@
this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 0);
this.flowLayoutPanel2.Name = "flowLayoutPanel2";
this.flowLayoutPanel2.Size = new System.Drawing.Size(546, 260);
this.flowLayoutPanel2.Size = new System.Drawing.Size(576, 276);
this.flowLayoutPanel2.TabIndex = 0;
//
// groupBox3
@@ -152,9 +150,9 @@
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(546, 260);
this.tabPage1.Size = new System.Drawing.Size(576, 276);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Connections";
this.tabPage1.Text = "Servers";
this.tabPage1.UseVisualStyleBackColor = true;
//
// tableLayoutPanel3
@@ -162,93 +160,26 @@
this.tableLayoutPanel3.ColumnCount = 2;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel3.Controls.Add(this.groupBox1, 1, 0);
this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel1, 0, 0);
this.tableLayoutPanel3.Controls.Add(this.tableLayoutPanel4, 1, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 1;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(540, 254);
this.tableLayoutPanel3.Size = new System.Drawing.Size(570, 270);
this.tableLayoutPanel3.TabIndex = 2;
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.listBox1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel6, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 85F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(264, 248);
this.tableLayoutPanel1.TabIndex = 1;
//
// listBox1
//
this.listBox1.DisplayMember = "Name";
this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(3, 3);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(258, 204);
this.listBox1.TabIndex = 0;
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.ListBox1_SelectedIndexChanged);
//
// tableLayoutPanel6
//
this.tableLayoutPanel6.ColumnCount = 3;
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel6.Controls.Add(this.button2, 1, 0);
this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 213);
this.tableLayoutPanel6.Name = "tableLayoutPanel6";
this.tableLayoutPanel6.RowCount = 1;
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel6.Size = new System.Drawing.Size(258, 32);
this.tableLayoutPanel6.TabIndex = 1;
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.button2.Location = new System.Drawing.Point(89, 4);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(80, 23);
this.button2.TabIndex = 0;
this.button2.Text = "Remove";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.Button2_Click);
//
// tableLayoutPanel4
//
this.tableLayoutPanel4.ColumnCount = 1;
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.Controls.Add(this.groupBox1, 0, 0);
this.tableLayoutPanel4.Controls.Add(this.tableLayoutPanel5, 0, 1);
this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel4.Location = new System.Drawing.Point(273, 3);
this.tableLayoutPanel4.Name = "tableLayoutPanel4";
this.tableLayoutPanel4.RowCount = 2;
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 85F));
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(264, 248);
this.tableLayoutPanel4.TabIndex = 2;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.tableLayoutPanel2);
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox1.Location = new System.Drawing.Point(3, 3);
this.groupBox1.Location = new System.Drawing.Point(288, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(258, 204);
this.groupBox1.Size = new System.Drawing.Size(279, 264);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Server";
this.groupBox1.Text = "Server Settings";
//
// tableLayoutPanel2
//
@@ -271,15 +202,15 @@
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(252, 185);
this.tableLayoutPanel2.Size = new System.Drawing.Size(273, 245);
this.tableLayoutPanel2.TabIndex = 0;
//
// serverNameTextBox
//
this.serverNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.serverNameTextBox.Location = new System.Drawing.Point(66, 13);
this.serverNameTextBox.Location = new System.Drawing.Point(71, 20);
this.serverNameTextBox.Name = "serverNameTextBox";
this.serverNameTextBox.Size = new System.Drawing.Size(183, 20);
this.serverNameTextBox.Size = new System.Drawing.Size(199, 20);
this.serverNameTextBox.TabIndex = 1;
//
// label5
@@ -286,28 +217,30 @@
//
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(3, 16);
this.label5.Location = new System.Drawing.Point(3, 24);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(57, 13);
this.label5.Size = new System.Drawing.Size(62, 13);
this.label5.TabIndex = 3;
this.label5.Text = "Name";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label3
//
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(3, 62);
this.label3.Location = new System.Drawing.Point(3, 85);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(57, 13);
this.label3.Size = new System.Drawing.Size(62, 13);
this.label3.TabIndex = 2;
this.label3.Text = "URL";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// serverUrlTextBox
//
this.serverUrlTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.serverUrlTextBox.Location = new System.Drawing.Point(66, 59);
this.serverUrlTextBox.Location = new System.Drawing.Point(71, 81);
this.serverUrlTextBox.Name = "serverUrlTextBox";
this.serverUrlTextBox.Size = new System.Drawing.Size(183, 20);
this.serverUrlTextBox.Size = new System.Drawing.Size(199, 20);
this.serverUrlTextBox.TabIndex = 2;
//
// label1
@@ -314,18 +247,19 @@
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(3, 108);
this.label1.Location = new System.Drawing.Point(3, 146);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(57, 13);
this.label1.Size = new System.Drawing.Size(62, 13);
this.label1.TabIndex = 5;
this.label1.Text = "Username";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// serverUsernameTextBox
//
this.serverUsernameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.serverUsernameTextBox.Location = new System.Drawing.Point(66, 105);
this.serverUsernameTextBox.Location = new System.Drawing.Point(71, 142);
this.serverUsernameTextBox.Name = "serverUsernameTextBox";
this.serverUsernameTextBox.Size = new System.Drawing.Size(183, 20);
this.serverUsernameTextBox.Size = new System.Drawing.Size(199, 20);
this.serverUsernameTextBox.TabIndex = 4;
//
// label2
@@ -332,55 +266,105 @@
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(3, 155);
this.label2.Location = new System.Drawing.Point(3, 207);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(57, 13);
this.label2.Size = new System.Drawing.Size(62, 13);
this.label2.TabIndex = 7;
this.label2.Text = "Password";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// serverPasswordTextBox
//
this.serverPasswordTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.serverPasswordTextBox.Location = new System.Drawing.Point(66, 151);
this.serverPasswordTextBox.Location = new System.Drawing.Point(71, 204);
this.serverPasswordTextBox.Name = "serverPasswordTextBox";
this.serverPasswordTextBox.PasswordChar = '*';
this.serverPasswordTextBox.Size = new System.Drawing.Size(183, 20);
this.serverPasswordTextBox.Size = new System.Drawing.Size(199, 20);
this.serverPasswordTextBox.TabIndex = 5;
//
// tableLayoutPanel5
// tableLayoutPanel1
//
this.tableLayoutPanel5.ColumnCount = 3;
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel5.Controls.Add(this.button1, 1, 0);
this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 213);
this.tableLayoutPanel5.Name = "tableLayoutPanel5";
this.tableLayoutPanel5.RowCount = 1;
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel5.Size = new System.Drawing.Size(258, 32);
this.tableLayoutPanel5.TabIndex = 1;
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel6, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.groupBox5, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 85F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(279, 264);
this.tableLayoutPanel1.TabIndex = 1;
//
// tableLayoutPanel6
//
this.tableLayoutPanel6.ColumnCount = 3;
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel6.Controls.Add(this.button1, 0, 0);
this.tableLayoutPanel6.Controls.Add(this.button2, 2, 0);
this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 227);
this.tableLayoutPanel6.Name = "tableLayoutPanel6";
this.tableLayoutPanel6.RowCount = 1;
this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel6.Size = new System.Drawing.Size(273, 34);
this.tableLayoutPanel6.TabIndex = 1;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(89, 4);
this.button1.Location = new System.Drawing.Point(3, 5);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(80, 23);
this.button1.Size = new System.Drawing.Size(85, 23);
this.button1.TabIndex = 6;
this.button1.Text = "Update";
this.button1.Text = "Add";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.Button1_Click);
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.button2.Location = new System.Drawing.Point(185, 5);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(85, 23);
this.button2.TabIndex = 0;
this.button2.Text = "Remove";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.Button2_Click);
//
// groupBox5
//
this.groupBox5.Controls.Add(this.listBox1);
this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox5.Location = new System.Drawing.Point(3, 3);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(273, 218);
this.groupBox5.TabIndex = 2;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "Gotify Servers";
//
// listBox1
//
this.listBox1.DisplayMember = "Name";
this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listBox1.FormattingEnabled = true;
this.listBox1.Location = new System.Drawing.Point(3, 16);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(267, 199);
this.listBox1.TabIndex = 0;
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.ListBox1_SelectedIndexChanged);
//
// tabPage3
//
this.tabPage3.Controls.Add(this.tableLayoutPanel7);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(546, 260);
this.tabPage3.Size = new System.Drawing.Size(576, 276);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Notifications";
this.tabPage3.Text = "Announcements";
this.tabPage3.UseVisualStyleBackColor = true;
//
// tableLayoutPanel7
@@ -388,97 +372,33 @@
this.tableLayoutPanel7.ColumnCount = 2;
this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel7.Controls.Add(this.tableLayoutPanel8, 0, 1);
this.tableLayoutPanel7.Controls.Add(this.tableLayoutPanel9, 1, 1);
this.tableLayoutPanel7.Controls.Add(this.groupBox2, 1, 0);
this.tableLayoutPanel7.Controls.Add(this.groupBox4, 0, 0);
this.tableLayoutPanel7.Controls.Add(this.tableLayoutPanel4, 0, 0);
this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel7.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel7.Name = "tableLayoutPanel7";
this.tableLayoutPanel7.RowCount = 2;
this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 85F));
this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
this.tableLayoutPanel7.Size = new System.Drawing.Size(546, 260);
this.tableLayoutPanel7.RowCount = 1;
this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel7.Size = new System.Drawing.Size(576, 276);
this.tableLayoutPanel7.TabIndex = 0;
//
// listBox2
//
this.listBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.listBox2.FormattingEnabled = true;
this.listBox2.Location = new System.Drawing.Point(3, 16);
this.listBox2.Name = "listBox2";
this.listBox2.Size = new System.Drawing.Size(261, 196);
this.listBox2.TabIndex = 0;
this.listBox2.SelectedIndexChanged += new System.EventHandler(this.ListBox2_SelectedIndexChanged);
//
// tableLayoutPanel8
//
this.tableLayoutPanel8.ColumnCount = 3;
this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel8.Controls.Add(this.button3, 1, 0);
this.tableLayoutPanel8.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel8.Location = new System.Drawing.Point(3, 224);
this.tableLayoutPanel8.Name = "tableLayoutPanel8";
this.tableLayoutPanel8.RowCount = 1;
this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel8.Size = new System.Drawing.Size(267, 33);
this.tableLayoutPanel8.TabIndex = 1;
//
// button3
//
this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.button3.Location = new System.Drawing.Point(92, 5);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(83, 23);
this.button3.TabIndex = 0;
this.button3.Text = "Remove";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.Button3_Click);
//
// tableLayoutPanel9
//
this.tableLayoutPanel9.ColumnCount = 3;
this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel9.Controls.Add(this.button4, 1, 0);
this.tableLayoutPanel9.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel9.Location = new System.Drawing.Point(276, 224);
this.tableLayoutPanel9.Name = "tableLayoutPanel9";
this.tableLayoutPanel9.RowCount = 1;
this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel9.Size = new System.Drawing.Size(267, 33);
this.tableLayoutPanel9.TabIndex = 2;
//
// button4
//
this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.button4.Location = new System.Drawing.Point(92, 5);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(83, 23);
this.button4.TabIndex = 0;
this.button4.Text = "Update";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.Button4_Click);
//
// groupBox2
//
this.groupBox2.Controls.Add(this.tableLayoutPanel10);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox2.Location = new System.Drawing.Point(276, 3);
this.groupBox2.Location = new System.Drawing.Point(291, 3);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(267, 215);
this.groupBox2.Size = new System.Drawing.Size(282, 270);
this.groupBox2.TabIndex = 3;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Notification";
this.groupBox2.Text = "Announcement Settings";
//
// tableLayoutPanel10
//
this.tableLayoutPanel10.ColumnCount = 2;
this.tableLayoutPanel10.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel10.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel10.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tableLayoutPanel10.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 75F));
this.tableLayoutPanel10.Controls.Add(this.speakTextBox, 1, 2);
this.tableLayoutPanel10.Controls.Add(this.label4, 0, 0);
this.tableLayoutPanel10.Controls.Add(this.appIdTextBox, 1, 0);
@@ -492,15 +412,15 @@
this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel10.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel10.Size = new System.Drawing.Size(261, 196);
this.tableLayoutPanel10.Size = new System.Drawing.Size(276, 251);
this.tableLayoutPanel10.TabIndex = 4;
//
// speakTextBox
//
this.speakTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.speakTextBox.Location = new System.Drawing.Point(133, 153);
this.speakTextBox.Location = new System.Drawing.Point(72, 198);
this.speakTextBox.Name = "speakTextBox";
this.speakTextBox.Size = new System.Drawing.Size(125, 20);
this.speakTextBox.Size = new System.Drawing.Size(201, 20);
this.speakTextBox.TabIndex = 1;
//
// label4
@@ -507,18 +427,19 @@
//
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(3, 26);
this.label4.Location = new System.Drawing.Point(3, 35);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(124, 13);
this.label4.Size = new System.Drawing.Size(63, 13);
this.label4.TabIndex = 0;
this.label4.Text = "App Id";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// appIdTextBox
//
this.appIdTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.appIdTextBox.Location = new System.Drawing.Point(133, 22);
this.appIdTextBox.Location = new System.Drawing.Point(72, 31);
this.appIdTextBox.Name = "appIdTextBox";
this.appIdTextBox.Size = new System.Drawing.Size(125, 20);
this.appIdTextBox.Size = new System.Drawing.Size(201, 20);
this.appIdTextBox.TabIndex = 1;
//
// label6
@@ -525,18 +446,19 @@
//
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(3, 91);
this.label6.Location = new System.Drawing.Point(3, 118);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(124, 13);
this.label6.Size = new System.Drawing.Size(63, 13);
this.label6.TabIndex = 2;
this.label6.Text = "Linger Time";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lingerTimeTextBox
//
this.lingerTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.lingerTimeTextBox.Location = new System.Drawing.Point(133, 87);
this.lingerTimeTextBox.Location = new System.Drawing.Point(72, 114);
this.lingerTimeTextBox.Name = "lingerTimeTextBox";
this.lingerTimeTextBox.Size = new System.Drawing.Size(125, 20);
this.lingerTimeTextBox.Size = new System.Drawing.Size(201, 20);
this.lingerTimeTextBox.TabIndex = 3;
//
// label7
@@ -543,12 +465,66 @@
//
this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(3, 156);
this.label7.Location = new System.Drawing.Point(3, 202);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(124, 13);
this.label7.Size = new System.Drawing.Size(63, 13);
this.label7.TabIndex = 4;
this.label7.Text = "Speak";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// tableLayoutPanel4
//
this.tableLayoutPanel4.ColumnCount = 1;
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel4.Controls.Add(this.tableLayoutPanel5, 0, 1);
this.tableLayoutPanel4.Controls.Add(this.groupBox4, 0, 0);
this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel4.Name = "tableLayoutPanel4";
this.tableLayoutPanel4.RowCount = 2;
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 85F));
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(282, 270);
this.tableLayoutPanel4.TabIndex = 4;
//
// tableLayoutPanel5
//
this.tableLayoutPanel5.ColumnCount = 3;
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel5.Controls.Add(this.button4, 0, 0);
this.tableLayoutPanel5.Controls.Add(this.button3, 2, 0);
this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 232);
this.tableLayoutPanel5.Name = "tableLayoutPanel5";
this.tableLayoutPanel5.RowCount = 1;
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel5.Size = new System.Drawing.Size(276, 35);
this.tableLayoutPanel5.TabIndex = 0;
//
// button4
//
this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.button4.Location = new System.Drawing.Point(3, 6);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(86, 23);
this.button4.TabIndex = 0;
this.button4.Text = "Add";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.Button4_Click);
//
// button3
//
this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.button3.Location = new System.Drawing.Point(187, 6);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(86, 23);
this.button3.TabIndex = 0;
this.button3.Text = "Remove";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.Button3_Click);
//
// groupBox4
//
this.groupBox4.Controls.Add(this.listBox2);
@@ -555,18 +531,29 @@
this.groupBox4.Dock = System.Windows.Forms.DockStyle.Fill;
this.groupBox4.Location = new System.Drawing.Point(3, 3);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(267, 215);
this.groupBox4.Size = new System.Drawing.Size(276, 223);
this.groupBox4.TabIndex = 4;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Application Id";
//
// listBox2
//
this.listBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.listBox2.FormattingEnabled = true;
this.listBox2.Location = new System.Drawing.Point(3, 16);
this.listBox2.Name = "listBox2";
this.listBox2.Size = new System.Drawing.Size(270, 204);
this.listBox2.TabIndex = 0;
this.listBox2.SelectedIndexChanged += new System.EventHandler(this.ListBox2_SelectedIndexChanged);
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(554, 286);
this.ClientSize = new System.Drawing.Size(584, 302);
this.Controls.Add(this.tabControl1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimumSize = new System.Drawing.Size(600, 340);
this.Name = "SettingsForm";
this.Text = "Winify: Settings";
this.tabControl1.ResumeLayout(false);
@@ -576,20 +563,19 @@
this.groupBox3.PerformLayout();
this.tabPage1.ResumeLayout(false);
this.tableLayoutPanel3.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel6.ResumeLayout(false);
this.tableLayoutPanel4.ResumeLayout(false);
this.groupBox1.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
this.tableLayoutPanel5.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel6.ResumeLayout(false);
this.groupBox5.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.tableLayoutPanel7.ResumeLayout(false);
this.tableLayoutPanel8.ResumeLayout(false);
this.tableLayoutPanel9.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.tableLayoutPanel10.ResumeLayout(false);
this.tableLayoutPanel10.PerformLayout();
this.tableLayoutPanel4.ResumeLayout(false);
this.tableLayoutPanel5.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
this.ResumeLayout(false);
 
@@ -611,7 +597,6 @@
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
private System.Windows.Forms.TextBox serverPasswordTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox serverNameTextBox;
@@ -619,23 +604,23 @@
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox serverUsernameTextBox;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.GroupBox groupBox5;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel7;
private System.Windows.Forms.ListBox listBox2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel8;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel9;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel10;
private System.Windows.Forms.TextBox speakTextBox;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox appIdTextBox;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox lingerTimeTextBox;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox speakTextBox;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.ListBox listBox2;
}
}
/trunk/Winify/SettingsForm.cs
@@ -12,10 +12,18 @@
{
#region Private Delegates, Events, Enums, Properties, Indexers and Fields
 
private readonly Announcements.Announcements _notifications;
private readonly BindingSource _announcementBindingSource;
 
private readonly Announcements.Announcements _announcements;
 
private readonly BindingSource _serverBindingSource;
 
private readonly global::Servers.Servers _servers;
 
private Announcement _announcement;
 
private Server _server;
 
#endregion
 
#region Constructors, Destructors and Finalizers
@@ -25,19 +33,48 @@
InitializeComponent();
}
 
public SettingsForm(global::Servers.Servers servers, Announcements.Announcements notifications) : this()
public SettingsForm(global::Servers.Servers servers, Announcements.Announcements announcements) : this()
{
_servers = servers;
_server = _servers.Server.FirstOrDefault() ?? new Server();
 
_serverBindingSource = new BindingSource();
_serverBindingSource.DataSource = _server;
 
serverNameTextBox.DataBindings.Add(new Binding("Text", _serverBindingSource, nameof(_server.Name), true,
DataSourceUpdateMode.OnPropertyChanged));
serverUrlTextBox.DataBindings.Add(new Binding("Text", _serverBindingSource, nameof(_server.Url), true,
DataSourceUpdateMode.OnPropertyChanged));
serverUsernameTextBox.DataBindings.Add(new Binding("Text", _serverBindingSource, nameof(_server.Username),
true,
DataSourceUpdateMode.OnPropertyChanged));
serverPasswordTextBox.DataBindings.Add(new Binding("Text", _serverBindingSource, nameof(_server.Password),
true,
DataSourceUpdateMode.OnPropertyChanged));
 
listBox1.DataSource = _servers.Server;
listBox1.DisplayMember = "Name";
listBox1.DataBindings.Add(new Binding("Text", _servers.Server, "Name", true,
DataSourceUpdateMode.OnPropertyChanged));
 
_notifications = notifications;
listBox2.DataSource = _notifications.Announcement;
_announcements = announcements;
_announcement = _announcements.Announcement.FirstOrDefault() ?? new Announcement();
 
_announcementBindingSource = new BindingSource();
_announcementBindingSource.DataSource = _announcement;
 
appIdTextBox.DataBindings.Add(new Binding("Text", _announcementBindingSource, nameof(_announcement.AppId),
true,
DataSourceUpdateMode.OnPropertyChanged));
lingerTimeTextBox.DataBindings.Add(new Binding("Text", _announcementBindingSource,
nameof(_announcement.LingerTime), true,
DataSourceUpdateMode.OnPropertyChanged));
speakTextBox.DataBindings.Add(new Binding("Text", _announcementBindingSource, nameof(_announcement.Speak),
true, DataSourceUpdateMode.OnPropertyChanged));
 
listBox2.DataSource = _announcements.Announcement;
listBox2.DisplayMember = "Id";
listBox2.DataBindings.Add(new Binding("Text", _notifications.Announcement, "Id", true,
listBox2.DataBindings.Add(new Binding("Text", _announcements.Announcement, "Id", true,
DataSourceUpdateMode.OnPropertyChanged));
}
 
@@ -54,45 +91,17 @@
 
private void Button1_Click(object sender, EventArgs e)
{
var name = serverNameTextBox.Text;
var url = serverUrlTextBox.Text;
var username = serverUsernameTextBox.Text;
var password = serverPasswordTextBox.Text;
var server = new Server();
 
if (string.IsNullOrEmpty(name) ||
string.IsNullOrEmpty(url) ||
string.IsNullOrEmpty(username) ||
string.IsNullOrEmpty(password))
{
return;
}
 
var server = new Server(name, url, username, password);
 
var update = _servers.Server.FirstOrDefault(select => select.Name == server.Name);
switch (update)
{
default:
_servers.Server.Remove(update);
update.Url = server.Url;
update.Username = server.Username;
update.Password = server.Password;
_servers.Server.Add(update);
break;
case null:
_servers.Server.Add(server);
break;
}
_servers.Server.Add(server);
}
 
private void Button2_Click(object sender, EventArgs e)
{
listBox1.InvokeIfRequired(listBox =>
if (listBox1.SelectedItem is Server server)
{
var item = listBox.SelectedItem;
 
_servers.Server.Remove((Server) item);
});
_servers.Server.Remove(server);
}
}
 
private void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
@@ -99,65 +108,27 @@
{
var listBox = (ListBox) sender;
 
if (listBox.SelectedIndex == -1)
if (listBox.SelectedItem is Server server)
{
serverNameTextBox.Text = string.Empty;
serverUrlTextBox.Text = string.Empty;
serverUsernameTextBox.Text = string.Empty;
serverPasswordTextBox.Text = string.Empty;
_server = server;
 
return;
_serverBindingSource.DataSource = _server;
}
 
var server = (Server) listBox.SelectedItem;
 
serverNameTextBox.Text = server.Name;
serverUrlTextBox.Text = server.Url;
serverUsernameTextBox.Text = server.Username;
serverPasswordTextBox.Text = server.Password;
}
 
private void Button3_Click(object sender, EventArgs e)
{
listBox2.InvokeIfRequired(listbox =>
if (listBox2.SelectedItem is Announcement announcement)
{
var item = listbox.SelectedItem;
 
_notifications.Announcement.Remove((Announcement) item);
});
_announcements.Announcement.Remove(announcement);
}
}
 
private void Button4_Click(object sender, EventArgs e)
{
var appId = appIdTextBox.Text;
var lingerTime = lingerTimeTextBox.Text;
var speak = speakTextBox.Text;
var announcement = new Announcement();
 
if (string.IsNullOrEmpty(appId) ||
!int.TryParse(appId, out var numAppId) ||
string.IsNullOrEmpty(lingerTime) ||
!int.TryParse(lingerTime, out var numLingerTime) ||
string.IsNullOrEmpty(speak))
{
return;
}
 
var notification = new Announcement(numAppId, numLingerTime, speak);
 
var update = _notifications.Announcement.FirstOrDefault(select => select.Id == notification.Id);
switch (update)
{
default:
_notifications.Announcement.Remove(update);
update.AppId = numAppId;
update.LingerTime = numLingerTime;
update.Speak = speak;
_notifications.Announcement.Add(update);
break;
case null:
_notifications.Announcement.Add(notification);
break;
}
_announcements.Announcement.Add(announcement);
}
 
private void ListBox2_SelectedIndexChanged(object sender, EventArgs e)
@@ -164,20 +135,12 @@
{
var listBox = (ListBox) sender;
 
if (listBox.SelectedIndex == -1)
if (listBox.SelectedItem is Announcement announcement)
{
appIdTextBox.Text = string.Empty;
lingerTimeTextBox.Text = string.Empty;
speakTextBox.Text = string.Empty;
_announcement = announcement;
 
return;
_announcementBindingSource.DataSource = _announcement;
}
 
var notification = (Announcement) listBox.SelectedItem;
 
appIdTextBox.Text = notification.AppId.ToString();
lingerTimeTextBox.Text = notification.LingerTime.ToString();
speakTextBox.Text = notification.Speak;
}
 
#endregion
/trunk/Winify/Winify.csproj
@@ -44,7 +44,7 @@
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\packages\Serilog.2.10.0\lib\net45\Serilog.dll</HintPath>
<HintPath>..\packages\Serilog.2.11.0\lib\net45\Serilog.dll</HintPath>
</Reference>
<Reference Include="Serilog.Sinks.File, Version=5.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
<HintPath>..\packages\Serilog.Sinks.File.5.0.0\lib\net45\Serilog.Sinks.File.dll</HintPath>
/trunk/Winify/packages.config
@@ -3,7 +3,7 @@
<packages>
<package id="Autoupdater.NET.Official" version="1.7.0" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
<package id="Serilog" version="2.10.0" targetFramework="net452" />
<package id="Serilog" version="2.11.0" targetFramework="net452" />
<package id="Serilog.Sinks.File" version="5.0.0" targetFramework="net452" />
<package id="System.Buffers" version="4.5.1" targetFramework="net452" />
<package id="System.Net.WebSockets.Client.Managed" version="1.0.22" targetFramework="net452" />