Winify

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 66  →  ?path2? @ 67
/trunk/Winify/AboutForm.Designer.cs
@@ -1,4 +1,7 @@

using System.ComponentModel;
using System.Windows.Forms;
 
namespace Winify
{
partial class AboutForm
@@ -6,7 +9,7 @@
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
private IContainer components = null;
 
#region Windows Form Designer generated code
 
@@ -87,8 +90,8 @@
 
#endregion
 
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox VersionTextBox;
private System.Windows.Forms.PictureBox pictureBox1;
private TextBox textBox1;
private TextBox VersionTextBox;
private PictureBox pictureBox1;
}
}
/trunk/Winify/AboutForm.cs
@@ -1,5 +1,4 @@
using System;
using System.Threading;
using System.Windows.Forms;
 
namespace Winify
File deleted
\ No newline at end of file
/trunk/Winify/Gotify/GotifyNotificationEventArgs.cs
/trunk/Winify/Gotify/GotifyConnection.cs
@@ -3,13 +3,10 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Runtime.Caching;
using System.Runtime.CompilerServices;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
@@ -17,9 +14,7 @@
using System.Threading;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
using System.Windows.Forms;
using Newtonsoft.Json;
using Org.BouncyCastle.Asn1.Pkcs;
using Serilog;
using Servers;
using WebSocketSharp;
@@ -34,7 +29,7 @@
{
#region Public Events & Delegates
 
public event EventHandler<GotifyNotificationEventArgs> GotifyNotification;
public event EventHandler<GotifyMessageEventArgs> GotifyMessage;
 
#endregion
 
@@ -57,8 +52,6 @@
private readonly Configuration.Configuration _configuration;
private IDisposable _tplRetrievePastMessagesLink;
private IDisposable _tplWebSocketsBufferBlockTransformLink;
private IDisposable _tplWebSocketsTransformActionLink;
private IDisposable _tplWebSocketsTransformActionNullLink;
private readonly BufferBlock<GotifyConnectionData> _webSocketMessageBufferBlock;
private readonly Stopwatch _webSocketsClientPingStopWatch;
private readonly ScheduledContinuation _webSocketsServerResponseScheduledContinuation;
@@ -82,64 +75,47 @@
CancellationToken = _cancellationToken
});
 
var webSocketTransformBlock = new TransformBlock<GotifyConnectionData, GotifyMessage>(data =>
var webSocketActionBlock = new ActionBlock<GotifyConnectionData>(async gotifyConnectionData =>
{
if (data.Payload == null || data.Payload.Length == 0)
try
{
return null;
}
using var memoryStream = new MemoryStream(gotifyConnectionData.Payload);
using var streamReader = new StreamReader(memoryStream);
using var jsonTextReader = new JsonTextReader(streamReader);
 
GotifyMessage gotifyNotification;
var gotifyMessage = _jsonSerializer.Deserialize<GotifyMessage>(jsonTextReader) ?? throw new ArgumentNullException();
 
try
{
var message = Encoding.UTF8.GetString(data.Payload, 0, data.Payload.Length);
gotifyMessage.Server = gotifyConnectionData.Server;
 
gotifyNotification = JsonConvert.DeserializeObject<GotifyMessage>(message);
using var imageStream = await RetrieveGotifyApplicationImage(gotifyMessage.AppId, _cancellationToken);
 
if (gotifyNotification == null)
if (imageStream == null || imageStream.Length == 0)
{
throw new ArgumentNullException();
Log.Warning("Could not find any application image for notification.");
 
return;
}
 
gotifyNotification.Server = data.Server;
var image = new Bitmap(imageStream);
 
GotifyMessage?.Invoke(this,
new GotifyMessageEventArgs(gotifyMessage, image));
 
Log.Debug($"Notification message received: {gotifyMessage.Message}");
}
catch (Exception exception)
catch (JsonSerializationException exception)
{
Log.Warning(exception, "Could not deserialize notification.");
 
return null;
Log.Warning(exception, "Could not deserialize notification message.");
}
 
return gotifyNotification;
 
}, new ExecutionDataflowBlockOptions { CancellationToken = _cancellationToken });
 
var webSocketActionBlock = new ActionBlock<GotifyMessage>(async message =>
{
using var imageStream = await RetrieveGotifyApplicationImage(message.AppId, _cancellationToken);
if (imageStream == null || imageStream.Length == 0)
catch (Exception exception)
{
Log.Warning("Could not find any application image for notification.");
 
return;
Log.Warning(exception, "Generic failure.");
}
 
var image = new Bitmap(imageStream);
 
GotifyNotification?.Invoke(this,
new GotifyNotificationEventArgs(message, image));
 
Log.Debug($"Notification message received: {message.Message}");
 
}, new ExecutionDataflowBlockOptions { CancellationToken = _cancellationToken });
 
_tplWebSocketsBufferBlockTransformLink = _webSocketMessageBufferBlock.LinkTo(webSocketTransformBlock,
_tplWebSocketsBufferBlockTransformLink = _webSocketMessageBufferBlock.LinkTo(webSocketActionBlock,
new DataflowLinkOptions { PropagateCompletion = true });
_tplWebSocketsTransformActionLink = webSocketTransformBlock.LinkTo(webSocketActionBlock,
new DataflowLinkOptions { PropagateCompletion = true }, message => message != null);
_tplWebSocketsTransformActionNullLink = webSocketTransformBlock.LinkTo(DataflowBlock.NullTarget<GotifyMessage>(),
new DataflowLinkOptions() { PropagateCompletion = true });
}
 
public GotifyConnection(Server server, Configuration.Configuration configuration) : this()
@@ -208,18 +184,6 @@
_tplWebSocketsBufferBlockTransformLink = null;
}
 
if (_tplWebSocketsTransformActionLink != null)
{
_tplWebSocketsTransformActionLink.Dispose();
_tplWebSocketsTransformActionLink = null;
}
 
if (_tplWebSocketsTransformActionNullLink != null)
{
_tplWebSocketsTransformActionNullLink.Dispose();
_tplWebSocketsTransformActionNullLink = null;
}
 
if (_tplRetrievePastMessagesLink != null)
{
_tplRetrievePastMessagesLink.Dispose();
@@ -309,7 +273,7 @@
 
private void OnUnresponsiveServer()
{
Log.Warning($"Server {_server} has not responded in a long while...");
Log.Warning($"Server {_server.Name} has not responded in a long while...");
}
 
private async void WebSocketSharp_OnError(object sender, ErrorEventArgs e)
@@ -329,7 +293,7 @@
{
if (e.IsPing)
{
Log.Information($"Server {_server} sent PING message");
Log.Information($"Server {_server.Name} sent PING message");
 
_webSocketsServerResponseScheduledContinuation.Schedule(TimeSpan.FromMinutes(1), OnUnresponsiveServer, _cancellationToken);
return;
@@ -382,7 +346,6 @@
return;
}
 
GotifyMessageQuery gotifyMessageQuery;
try
{
using var messageStream = await _httpClient.GetStreamAsync(combinedUri);
@@ -389,50 +352,52 @@
using var streamReader = new StreamReader(messageStream);
using var jsonTextReader = new JsonTextReader(streamReader);
 
gotifyMessageQuery = _jsonSerializer.Deserialize<GotifyMessageQuery>(jsonTextReader);
var gotifyMessageQuery = _jsonSerializer.Deserialize<GotifyMessageQuery>(jsonTextReader) ??
throw new ArgumentNullException();
 
if (gotifyMessageQuery.Messages == null)
{
Log.Warning("Invalid application messages deserialized deserialized.");
 
return;
}
 
foreach (var message in gotifyMessageQuery.Messages)
{
if (message.Date <
DateTime.Now - TimeSpan.FromHours(_configuration.RetrievePastNotificationHours))
{
continue;
}
 
using var imageStream = await RetrieveGotifyApplicationImage(message.AppId, _cancellationToken);
if (imageStream == null || imageStream.Length == 0)
{
Log.Warning("Could not find any application image for notification.");
 
continue;
}
 
var image = new Bitmap(imageStream);
message.Server = gotifyConnectionApplication.Server;
 
GotifyMessage?.Invoke(this,
new GotifyMessageEventArgs(message, image));
}
}
catch (HttpRequestException exception)
{
Log.Warning(exception, $"Could not get application {gotifyConnectionApplication.Application.Id}.");
 
return;
}
catch (JsonSerializationException exception)
{
Log.Warning(exception,$"Could not deserialize the message response for application {gotifyConnectionApplication.Application.Id}.");
 
return;
Log.Warning(exception,
$"Could not deserialize the message response for application {gotifyConnectionApplication.Application.Id}.");
}
 
if (gotifyMessageQuery == null || gotifyMessageQuery.Messages == null)
catch (Exception exception)
{
Log.Warning("Invalid application messages deserialized deserialized.");
 
return;
Log.Warning(exception, "Generic failure.");
}
 
foreach (var message in gotifyMessageQuery.Messages)
{
if (message.Date < DateTime.Now - TimeSpan.FromHours(_configuration.RetrievePastNotificationHours))
{
continue;
}
using var imageStream = await RetrieveGotifyApplicationImage(message.AppId, _cancellationToken);
if (imageStream == null || imageStream.Length == 0)
{
Log.Warning("Could not find any application image for notification.");
 
continue;
}
 
var image = new Bitmap(imageStream);
message.Server = gotifyConnectionApplication.Server;
 
GotifyNotification?.Invoke(this,
new GotifyNotificationEventArgs(message, image));
}
 
}, new ExecutionDataflowBlockOptions { CancellationToken = cancellationToken });
 
gotifyApplicationBufferBlock.LinkTo(gotifyApplicationActionBlock,
@@ -448,7 +413,6 @@
await Task.WhenAll(tasks);
gotifyApplicationBufferBlock.Complete();
await gotifyApplicationActionBlock.Completion;
 
}
 
private async Task HeartBeat(CancellationToken cancellationToken)
@@ -462,13 +426,13 @@
_webSocketsClientPingStopWatch.Restart();
if (!_webSocketSharp.Ping())
{
Log.Warning($"Server {_server} did not respond to PING message.");
Log.Warning($"Server {_server.Name} did not respond to PING message.");
continue;
}
 
var delta = _webSocketsClientPingStopWatch.ElapsedMilliseconds;
 
Log.Information($"PING response latency for {_server} is {delta}ms");
Log.Information($"PING response latency for {_server.Name} is {delta}ms");
 
_webSocketsServerResponseScheduledContinuation.Schedule(TimeSpan.FromMinutes(1), OnUnresponsiveServer, _cancellationToken);
} while (!cancellationToken.IsCancellationRequested);
@@ -479,7 +443,7 @@
}
catch (Exception exception)
{
Log.Warning(exception, $"Heartbeat for server {_server} has failed due to {exception.Message}");
Log.Warning(exception, $"Heartbeat for server {_server.Name} has failed.");
}
}
 
@@ -537,17 +501,17 @@
 
try
{
var imageResponse = await _httpClient.GetAsync(applicationImageUri, cancellationToken);
var imageResponse = await _httpClient.GetStreamAsync(applicationImageUri);
 
var memoryStream = new MemoryStream();
 
await imageResponse.Content.CopyToAsync(memoryStream);
await imageResponse.CopyToAsync(memoryStream);
 
return memoryStream;
}
catch (Exception exception)
{
Log.Error($"Could not retrieve application image: {exception.Message}");
Log.Error(exception,"Could not retrieve application image.");
}
}
 
/trunk/Winify/Gotify/GotifyMessageEventArgs.cs
@@ -0,0 +1,26 @@
using System;
using System.Drawing;
 
namespace Winify.Gotify
{
public class GotifyMessageEventArgs : EventArgs
{
#region Constructors, Destructors and Finalizers
 
public GotifyMessageEventArgs(GotifyMessage message, Image image)
{
Message = message;
Image = image;
}
 
#endregion
 
#region Public Enums, Properties and Fields
 
public GotifyMessage Message { get; set; }
 
public Image Image { get; set; }
 
#endregion
}
}
/trunk/Winify/Gotify/GotifyMessageExtras.cs
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json;
 
namespace Winify.Gotify
{
/trunk/Winify/Gotify/GotifyMessageExtrasClientDisplay.cs
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json;
 
namespace Winify.Gotify
{
/trunk/Winify/Gotify/GotifyMessageQuery.cs
@@ -1,10 +1,4 @@
using Newtonsoft.Json;
using Servers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Winify.Gotify
{
/trunk/Winify/Gotify/GotifyPaging.cs
@@ -1,10 +1,4 @@
using Newtonsoft.Json;
using Servers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Winify.Gotify
{
/trunk/Winify/LogViewForm.Designer.cs
@@ -1,4 +1,7 @@
namespace Winify
using System.ComponentModel;
using System.Windows.Forms;
 
namespace Winify
{
partial class LogViewForm
{
@@ -5,7 +8,7 @@
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
private IContainer components = null;
 
#region Windows Form Designer generated code
 
@@ -46,6 +49,6 @@
 
#endregion
 
private System.Windows.Forms.TextBox textBox1;
private TextBox textBox1;
}
}
/trunk/Winify/MainForm.Designer.cs
@@ -1,4 +1,7 @@

using System.ComponentModel;
using System.Windows.Forms;
 
namespace Winify
{
partial class MainForm
@@ -6,7 +9,7 @@
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
private IContainer components = null;
 
#region Windows Form Designer generated code
 
@@ -120,15 +123,15 @@
 
#endregion
 
private System.Windows.Forms.NotifyIcon notifyIcon1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem settingsToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem quitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem updateToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem logViewToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private NotifyIcon notifyIcon1;
private ContextMenuStrip contextMenuStrip1;
private ToolStripMenuItem settingsToolStripMenuItem;
private ToolStripSeparator toolStripSeparator1;
private ToolStripMenuItem aboutToolStripMenuItem;
private ToolStripMenuItem quitToolStripMenuItem;
private ToolStripMenuItem updateToolStripMenuItem;
private ToolStripMenuItem logViewToolStripMenuItem;
private ToolStripSeparator toolStripSeparator2;
}
}
 
/trunk/Winify/MainForm.cs
@@ -21,7 +21,6 @@
using Winify.Utilities;
using Winify.Utilities.Serialization;
using ScheduledContinuation = Toasts.ScheduledContinuation;
using Toasts = Toasts.Toasts;
 
namespace Winify
{
@@ -55,7 +54,7 @@
 
private readonly LogMemorySink _memorySink;
 
private readonly global::Toasts.Toasts _toasts;
private readonly Toasts.Toasts _toasts;
 
#endregion
 
@@ -63,18 +62,18 @@
 
public MainForm()
{
InitializeComponent();
 
_cancellationTokenSource = new CancellationTokenSource();
_cancellationToken = _cancellationTokenSource.Token;
 
ChangedConfigurationContinuation = new ScheduledContinuation();
 
_toasts = new global::Toasts.Toasts(_cancellationToken);
_toasts = new Toasts.Toasts(_cancellationToken);
}
 
public MainForm(Mutex mutex) : this()
{
InitializeComponent();
 
_memorySink = new LogMemorySink();
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
@@ -121,7 +120,7 @@
foreach (var server in servers.Server)
{
var gotifyConnection = new GotifyConnection(server, Configuration);
gotifyConnection.GotifyNotification += GotifyConnection_GotifyNotification;
gotifyConnection.GotifyMessage += GotifyConnectionGotifyMessage;
gotifyConnection.Start();
_gotifyConnections.Add(gotifyConnection);
}
@@ -129,7 +128,10 @@
 
private void LogViewToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_logViewForm != null) return;
if (_logViewForm != null)
{
return;
}
 
_logViewForm = new LogViewForm(this, _memorySink, _cancellationToken);
_logViewForm.Closing += LogViewForm_Closing;
@@ -138,7 +140,10 @@
 
private void LogViewForm_Closing(object sender, CancelEventArgs e)
{
if (_logViewForm == null) return;
if (_logViewForm == null)
{
return;
}
 
_logViewForm.Closing -= LogViewForm_Closing;
_logViewForm.Close();
@@ -172,42 +177,45 @@
// Update connections to gotify servers.
while (_gotifyConnections.TryTake(out var gotifyConnection))
{
gotifyConnection.GotifyNotification -= GotifyConnection_GotifyNotification;
gotifyConnection.Stop();
gotifyConnection.GotifyMessage -= GotifyConnectionGotifyMessage;
await gotifyConnection.Stop();
gotifyConnection.Dispose();
gotifyConnection = null;
}
 
foreach (var server in e.Servers.Server)
{
var gotifyConnection = new GotifyConnection(server, Configuration);
gotifyConnection.GotifyNotification += GotifyConnection_GotifyNotification;
gotifyConnection.GotifyMessage += GotifyConnectionGotifyMessage;
gotifyConnection.Start();
_gotifyConnections.Add(gotifyConnection);
}
}
 
private async void GotifyConnection_GotifyNotification(object sender, GotifyNotificationEventArgs e)
private async void GotifyConnectionGotifyMessage(object sender, GotifyMessageEventArgs e)
{
var announcements = await LoadAnnouncements();
 
foreach (var announcement in announcements.Announcement)
if (announcement.AppId == e.Notification.AppId)
{
if (announcement.AppId != e.Message.AppId)
{
var configuredNotification = new ToastForm(
$"{e.Notification.Title} ({e.Notification.Server.Name}/{e.Notification.AppId})",
e.Notification.Message, announcement.LingerTime, e.Image);
await _toasts.Queue(configuredNotification);
 
return;
continue;
}
 
var configuredNotification = new ToastForm(
$"{e.Message.Title} ({e.Message.Server.Name}/{e.Message.AppId})",
e.Message.Message, announcement.LingerTime, e.Image);
 
await _toasts.Queue(configuredNotification);
 
return;
}
 
if (Configuration.InfiniteToastDuration)
{
var infiniteToastForm = new ToastForm(
$"{e.Notification.Title} ({e.Notification.Server.Name}/{e.Notification.AppId})",
e.Notification.Message, e.Image);
$"{e.Message.Title} ({e.Message.Server.Name}/{e.Message.AppId})",
e.Message.Message, e.Image);
 
await _toasts.Queue(infiniteToastForm);
 
@@ -215,15 +223,18 @@
}
 
var toastForm = new ToastForm(
$"{e.Notification.Title} ({e.Notification.Server.Name}/{e.Notification.AppId})",
e.Notification.Message, Configuration.ToastDuration, e.Image);
$"{e.Message.Title} ({e.Message.Server.Name}/{e.Message.AppId})",
e.Message.Message, Configuration.ToastDuration, e.Image);
 
await _toasts.Queue(toastForm);
}
 
private void SettingsForm_Closing(object sender, CancelEventArgs e)
{
if (_settingsForm == null) return;
if (_settingsForm == null)
{
return;
}
 
_settingsForm.Save -= SettingsForm_Save;
_settingsForm.Closing -= SettingsForm_Closing;
@@ -233,7 +244,10 @@
 
private void AboutToolStripMenuItem_Click(object sender, EventArgs e)
{
if (_aboutForm != null) return;
if (_aboutForm != null)
{
return;
}
 
_aboutForm = new AboutForm();
_aboutForm.Closing += AboutForm_Closing;
@@ -242,7 +256,10 @@
 
private void AboutForm_Closing(object sender, CancelEventArgs e)
{
if (_aboutForm == null) return;
if (_aboutForm == null)
{
return;
}
 
_aboutForm.Closing -= AboutForm_Closing;
_aboutForm.Dispose();
/trunk/Winify/Properties/Resources.Designer.cs
@@ -8,10 +8,15 @@
// </auto-generated>
//------------------------------------------------------------------------------
 
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Resources;
using System.Runtime.CompilerServices;
 
namespace Winify.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@@ -19,16 +24,16 @@
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[DebuggerNonUserCode()]
[CompilerGenerated()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
private static CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
@@ -35,11 +40,11 @@
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Winify.Properties.Resources", typeof(Resources).Assembly);
if (ReferenceEquals(resourceMan, null)) {
ResourceManager temp = new ResourceManager("Winify.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -50,8 +55,8 @@
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static CultureInfo Culture {
get {
return resourceCulture;
}
/trunk/Winify/Settings/SettingsForm.Designer.cs
@@ -1,4 +1,7 @@

using System.ComponentModel;
using System.Windows.Forms;
 
namespace Winify.Settings
{
partial class SettingsForm
@@ -6,7 +9,7 @@
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
private IContainer components = null;
 
/// <summary>
/// Clean up any resources being used.
@@ -952,70 +955,70 @@
 
#endregion
 
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
private System.Windows.Forms.TextBox serverUrlTextBox;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel6;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox serverPasswordTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox serverNameTextBox;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox serverUsernameTextBox;
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.GroupBox groupBox2;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel10;
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.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;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel8;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel9;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.GroupBox groupBox6;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel11;
private System.Windows.Forms.CheckBox checkBox2;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel12;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.CheckBox checkBox3;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.GroupBox groupBox7;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel13;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.CheckBox checkBox4;
private System.Windows.Forms.GroupBox groupBox8;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel14;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.TrackBar trackBar1;
private System.Windows.Forms.TextBox textBox4;
private TabControl tabControl1;
private TabPage tabPage1;
private GroupBox groupBox1;
private TableLayoutPanel tableLayoutPanel2;
private TextBox serverUrlTextBox;
private TabPage tabPage2;
private FlowLayoutPanel flowLayoutPanel2;
private GroupBox groupBox3;
private CheckBox checkBox1;
private TableLayoutPanel tableLayoutPanel3;
private TableLayoutPanel tableLayoutPanel1;
private ListBox listBox1;
private TableLayoutPanel tableLayoutPanel6;
private Button button2;
private TextBox serverPasswordTextBox;
private Label label2;
private TextBox serverNameTextBox;
private Label label5;
private Label label3;
private Label label1;
private TextBox serverUsernameTextBox;
private Button button1;
private TabPage tabPage3;
private GroupBox groupBox5;
private TableLayoutPanel tableLayoutPanel7;
private GroupBox groupBox2;
private TableLayoutPanel tableLayoutPanel10;
private Label label4;
private TextBox appIdTextBox;
private Label label6;
private TextBox lingerTimeTextBox;
private TableLayoutPanel tableLayoutPanel4;
private TableLayoutPanel tableLayoutPanel5;
private Button button4;
private Button button3;
private GroupBox groupBox4;
private ListBox listBox2;
private TableLayoutPanel tableLayoutPanel8;
private TableLayoutPanel tableLayoutPanel9;
private Button button5;
private Button button6;
private GroupBox groupBox6;
private TableLayoutPanel tableLayoutPanel11;
private CheckBox checkBox2;
private TabPage tabPage4;
private TableLayoutPanel tableLayoutPanel12;
private Label label7;
private Label label8;
private Label label9;
private TextBox textBox1;
private TextBox textBox2;
private TextBox textBox3;
private CheckBox checkBox3;
private Label label10;
private GroupBox groupBox7;
private TableLayoutPanel tableLayoutPanel13;
private Label label11;
private NumericUpDown numericUpDown1;
private Label label12;
private CheckBox checkBox4;
private GroupBox groupBox8;
private TableLayoutPanel tableLayoutPanel14;
private Label label13;
private TrackBar trackBar1;
private TextBox textBox4;
}
}
/trunk/Winify/Settings/SettingsForm.cs
@@ -4,8 +4,6 @@
using System.Windows.Forms;
using Announcements;
using Servers;
using Winify.Utilities;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
 
namespace Winify.Settings
{
/trunk/Winify/Utilities/Components/ReadOnlyRichTextBox.Designer.cs
@@ -1,4 +1,6 @@

using System.ComponentModel;
 
namespace Winify.Utilities.Components
{
partial class ReadOnlyRichTextBox
@@ -6,7 +8,7 @@
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
private IContainer components = null;
 
/// <summary>
/// Clean up any resources being used.
/trunk/Winify/Utilities/LogMemorySink.cs
@@ -6,7 +6,7 @@
using Serilog.Formatting;
using Serilog.Formatting.Display;
 
namespace Winify
namespace Winify.Utilities
{
public class LogMemorySink : ILogEventSink
{
@@ -18,7 +18,10 @@
 
public void Emit(LogEvent logEvent)
{
if (logEvent == null) throw new ArgumentNullException(nameof(logEvent));
if (logEvent == null)
{
throw new ArgumentNullException(nameof(logEvent));
}
 
using var stringWriter = new StringWriter();
_textFormatter.Format(logEvent, stringWriter);
/trunk/Winify/Utilities/Miscellaneous.cs
@@ -147,12 +147,12 @@
using var rk = localMachineX64View.OpenSubKey(location);
if (rk == null)
throw new KeyNotFoundException(
string.Format("Key Not Found: {0}", location));
$"Key Not Found: {location}");
 
var machineGuid = rk.GetValue(name);
if (machineGuid == null)
throw new IndexOutOfRangeException(
string.Format("Index Not Found: {0}", name));
$"Index Not Found: {name}");
 
return machineGuid.ToString();
}
/trunk/Winify/Winify.csproj
@@ -82,6 +82,12 @@
<HintPath>..\packages\Serilog.Sinks.File.5.0.0\lib\net45\Serilog.Sinks.File.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
@@ -92,6 +98,9 @@
<Private>True</Private>
</Reference>
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.2\lib\netstandard2.0\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http, Version=4.1.1.3, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll</HintPath>
<Private>True</Private>
@@ -98,6 +107,9 @@
<Private>True</Private>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
<Private>True</Private>
@@ -172,7 +184,7 @@
<Compile Include="Gotify\GotifyApplication.cs" />
<Compile Include="Gotify\GotifyConnection.cs" />
<Compile Include="Gotify\GotifyMessage.cs" />
<Compile Include="Gotify\GotifyNotificationEventArgs.cs" />
<Compile Include="Gotify\GotifyMessageEventArgs.cs" />
<Compile Include="Settings\SettingsSavedEventArgs.cs" />
<Compile Include="Utilities\AES.cs" />
<Compile Include="Utilities\LogMemorySink.cs" />
/trunk/Winify/app.config
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0"/>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /></startup></configuration>
/trunk/Winify/packages.config
@@ -8,10 +8,15 @@
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
<package id="Serilog" version="3.0.1" targetFramework="net472" />
<package id="Serilog.Sinks.File" version="5.0.0" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
<package id="System.Collections.Immutable" version="1.3.1" targetFramework="net48" />
<package id="System.IO" version="4.3.0" targetFramework="net472" />
<package id="System.Memory" version="4.5.2" targetFramework="net48" />
<package id="System.Net.Http" version="4.3.4" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
<package id="System.Runtime" version="4.3.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net48" />
<package id="System.Runtime.InteropServices.WindowsRuntime" version="4.3.0" targetFramework="net48" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net472" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net472" />