mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-24 11:50:05 +02:00
feature: Server error provider added, client notification service added
This commit is contained in:
1 parent
3c67595d94
commit
b928e0fec9
14 files changed
+200
-11
No files matched your search
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using WotBlitzStatisticsPro.Blazor.Model;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Blazor.Services
|
||||
{
|
||||
public class NotificationsService: INotificationsService
|
||||
{
|
||||
// ToDo: Add JSInterop console.log
|
||||
|
||||
public NotificationType Type { get; private set; } = NotificationType.Info;
|
||||
|
||||
public string Message { get; private set; } = string.Empty;
|
||||
|
||||
public string Summary { get; private set; }
|
||||
|
||||
public event Action MessageArrived;
|
||||
|
||||
public void ReportInfo(string summary, string message)
|
||||
{
|
||||
Type = NotificationType.Info;
|
||||
Message = message;
|
||||
Summary = summary;
|
||||
MessageArrived?.Invoke();
|
||||
}
|
||||
|
||||
public void ReportWarning(string summary, string message)
|
||||
{
|
||||
Type = NotificationType.Warning;
|
||||
Message = message;
|
||||
Summary = summary;
|
||||
MessageArrived?.Invoke();
|
||||
}
|
||||
|
||||
public void ReportError(string summary, string message)
|
||||
{
|
||||
Type = NotificationType.Error;
|
||||
Message = message;
|
||||
Summary = summary;
|
||||
MessageArrived?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user