Winify

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 77  →  ?path2? @ 78
/trunk/Winify/MainForm.cs
@@ -55,7 +55,7 @@
 
private readonly LogMemorySink _memorySink;
 
private readonly Toasts.Toasts _toasts;
private readonly Toasts.ToastDisplay _toastDisplay;
 
#endregion
 
@@ -72,7 +72,7 @@
 
ChangedConfigurationContinuation = new ScheduledContinuation();
 
_toasts = new Toasts.Toasts(_cancellationToken);
_toastDisplay = new Toasts.ToastDisplay(_cancellationToken);
}
 
public MainForm(Mutex mutex) : this()
@@ -240,46 +240,44 @@
return;
}
 
var configuredNotification = new ToastForm(
$"{e.Message.Title} ({e.Message.Server.Name}/{e.Message.AppId})",
e.Message.Message)
{
EnableChime = announcement.EnableChime,
Chime = announcement.Chime ?? Configuration.Chime,
LingerTime = (int)announcement.LingerTime,
Image = e.Image
};
await _toastDisplay.Queue(
new ToastDisplayData
{
Title = $"{e.Message.Title} ({e.Message.Server.Name}/{e.Message.AppId})",
Body = e.Message.Message,
EnableChime = announcement.EnableChime,
Chime = announcement.Chime ?? Configuration.Chime,
LingerTime = (int)announcement.LingerTime,
Image = e.Image,
Content = e.Message.Extras.GotifyMessageExtrasClientDisplay.ContentType
});
 
await _toasts.Queue(configuredNotification);
 
return;
}
 
if (Configuration.InfiniteToastDuration)
{
var infiniteToastForm = new ToastForm(
$"{e.Message.Title} ({e.Message.Server.Name}/{e.Message.AppId})",
e.Message.Message)
await _toastDisplay.Queue(new ToastDisplayData
{
Title = $"{e.Message.Title} ({e.Message.Server.Name}/{e.Message.AppId})",
Body = e.Message.Message,
Chime = Configuration.Chime,
Image = e.Image
};
Image = e.Image,
Content = e.Message.Extras.GotifyMessageExtrasClientDisplay.ContentType
});
 
await _toasts.Queue(infiniteToastForm);
 
return;
}
 
var toastForm = new ToastForm(
$"{e.Message.Title} ({e.Message.Server.Name}/{e.Message.AppId})",
e.Message.Message)
await _toastDisplay.Queue(new ToastDisplayData
{
Title = $"{e.Message.Title} ({e.Message.Server.Name}/{e.Message.AppId})",
Body = e.Message.Message,
Chime = Configuration.Chime,
LingerTime = Configuration.ToastDuration,
Image = e.Image
};
 
await _toasts.Queue(toastForm);
Image = e.Image,
Content = e.Message.Extras.GotifyMessageExtrasClientDisplay.ContentType
});
}
 
private void SettingsForm_Closing(object sender, CancelEventArgs e)