Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
BalanceNotificationEvent.cs
1using EDaler;
2using EDaler.Events;
8
10{
15 {
20 : base()
21 {
22 }
23
29 : base(e)
30 {
31 this.Amount = e.Balance.Amount;
32 this.Currency = e.Balance.Currency;
33 this.Event = e.Balance.Event;
34 this.Reserved = e.Balance.Reserved;
35 this.Timestamp = e.Balance.Timestamp;
36 this.Category = e.Balance.Event?.TransactionId.ToString() ?? string.Empty;
37 }
38
42 public decimal Amount { get; set; }
43
47 public decimal Reserved { get; set; }
48
52 public CaseInsensitiveString? Currency { get; set; }
53
57 public AccountEvent? Event { get; set; }
58
62 public override async Task<string> GetDescription()
63 {
64 if (string.IsNullOrEmpty(this.Event?.Remote))
66 else
67 return await ContactInfo.GetFriendlyName(this.Event.Remote);
68 }
69
73 public override async Task Open()
74 {
75 if ((this.Event?.Change ?? 0) > 0)
76 {
77 Balance Balance = new(this.Timestamp, this.Amount, this.Reserved, this.Currency, this.Event);
78
80 }
81 else
82 await ServiceRef.NeuroWalletOrchestratorService.OpenEDalerWallet();
83 }
84 }
85}
Account event
Definition: AccountEvent.cs:16
CaseInsensitiveString Remote
Remote party
Definition: AccountEvent.cs:56
Guid TransactionId
Transaction ID
Definition: AccountEvent.cs:38
Contains information about a balance.
Definition: Balance.cs:11
CaseInsensitiveString Currency
Currency of amount.
Definition: Balance.cs:54
AccountEvent Event
Any account event associated to the balance message.
Definition: Balance.cs:59
decimal Amount
Amount at given point in time.
Definition: Balance.cs:44
decimal Reserved
Reserved amount, that the user cannot use directly.
Definition: Balance.cs:49
DateTime Timestamp
Timestamp of balance.
Definition: Balance.cs:39
Wallet balance event arguments.
A strongly-typed resource class, for looking up localized strings, etc.
static string BalanceUpdated
Looks up a localized string similar to Balance updated..
Contains information about a contact.
Definition: ContactInfo.cs:22
static async Task< string > GetFriendlyName(CaseInsensitiveString RemoteId)
Gets the friendly name of a remote identity (Legal ID or Bare JID).
Definition: ContactInfo.cs:258
BalanceNotificationEvent(BalanceEventArgs e)
Contains information about an incoming chat message.
BalanceNotificationEvent()
Contains information about an incoming chat message.
override async Task< string > GetDescription()
Gets a descriptive text for the event.
Base class that references services in the app.
Definition: ServiceRef.cs:43
static INavigationService NavigationService
The navigation service for navigating between pages.
Definition: ServiceRef.cs:178
static INeuroWalletOrchestratorService NeuroWalletOrchestratorService
Neuro Wallet orchestrator service.
Definition: ServiceRef.cs:262
static IReportingStringLocalizer Localizer
Localization service
Definition: ServiceRef.cs:370
Holds navigation parameters specific to an eDaler balance event.
A page that displays information about eDaler received.
Represents a case-insensitive string.