mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Renaming to BaseNotification
This commit is contained in:
@@ -5,6 +5,6 @@ namespace BTCPayServer.Events
|
|||||||
internal class NotificationEvent
|
internal class NotificationEvent
|
||||||
{
|
{
|
||||||
internal string[] ApplicationUserIds { get; set; }
|
internal string[] ApplicationUserIds { get; set; }
|
||||||
internal NotificationBase Notification { get; set; }
|
internal BaseNotification Notification { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ namespace BTCPayServer.Models.NotificationViewModels
|
|||||||
{
|
{
|
||||||
public static NotificationViewModel ViewModel(this NotificationData data)
|
public static NotificationViewModel ViewModel(this NotificationData data)
|
||||||
{
|
{
|
||||||
var baseType = typeof(NotificationBase);
|
var baseType = typeof(BaseNotification);
|
||||||
|
|
||||||
var fullTypeName = baseType.FullName.Replace(nameof(NotificationBase), data.NotificationType, StringComparison.OrdinalIgnoreCase);
|
var fullTypeName = baseType.FullName.Replace(nameof(BaseNotification), data.NotificationType, StringComparison.OrdinalIgnoreCase);
|
||||||
var parsedType = baseType.Assembly.GetType(fullTypeName);
|
var parsedType = baseType.Assembly.GetType(fullTypeName);
|
||||||
var instance = Activator.CreateInstance(parsedType) as NotificationBase;
|
var instance = Activator.CreateInstance(parsedType) as BaseNotification;
|
||||||
|
|
||||||
var casted = JsonConvert.DeserializeObject(ZipUtils.Unzip(data.Blob), parsedType);
|
var casted = JsonConvert.DeserializeObject(ZipUtils.Unzip(data.Blob), parsedType);
|
||||||
var obj = new NotificationViewModel
|
var obj = new NotificationViewModel
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ using Newtonsoft.Json;
|
|||||||
|
|
||||||
namespace BTCPayServer.Services.Notifications.Blobs
|
namespace BTCPayServer.Services.Notifications.Blobs
|
||||||
{
|
{
|
||||||
// Make sure to keep all NotificationEventBase classes in same namespace
|
// Make sure to keep all Blob Notification classes in same namespace
|
||||||
// because of dependent initialization and parsing to view models logic
|
// because of dependent initialization and parsing to view models logic
|
||||||
// IndexViewModel.cs#32
|
// IndexViewModel.cs#32
|
||||||
internal abstract class NotificationBase
|
internal abstract class BaseNotification
|
||||||
{
|
{
|
||||||
internal virtual string NotificationType { get { return GetType().Name; } }
|
internal virtual string NotificationType { get { return GetType().Name; } }
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@ using Newtonsoft.Json;
|
|||||||
|
|
||||||
namespace BTCPayServer.Services.Notifications.Blobs
|
namespace BTCPayServer.Services.Notifications.Blobs
|
||||||
{
|
{
|
||||||
internal class NewVersionNotification : NotificationBase
|
internal class NewVersionNotification : BaseNotification
|
||||||
{
|
{
|
||||||
internal override string NotificationType => "NewVersionNotification";
|
internal override string NotificationType => "NewVersionNotification";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user