Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ContractResponseNotificationEvent.cs
5using System.Text;
7
9{
14 {
19 : base()
20 {
21 }
22
27 public ContractResponseNotificationEvent(ContractPetitionResponseEventArgs e)
28 : base(e)
29 {
30 this.Response = e.Response;
31 }
32
36 public bool Response { get; set; }
37
41 public override async Task Open()
42 {
43 Contract? Contract = await this.GetContract();
44
45 if (!this.Response || Contract is null)
46 {
47 await ServiceRef.UiService.DisplayAlert(ServiceRef.Localizer[nameof(AppResources.Message)],
48 ServiceRef.Localizer[nameof(AppResources.PetitionToViewContractWasDenied)], ServiceRef.Localizer[nameof(AppResources.Ok)]);
49 }
50 else
51 {
52 ViewContractNavigationArgs Args = new(Contract, false);
53
55 }
56 }
57
61 public override async Task<string> GetDescription()
62 {
63 Contract? Contract = await this.GetContract();
64 StringBuilder Result = new();
65
66 Result.Append(ServiceRef.Localizer[nameof(AppResources.ContractResponse)]);
67
68 if (Contract is not null)
69 {
70 Result.Append(": ");
71 Result.Append(await ContractModel.GetCategory(Contract));
72 }
73
74 Result.Append('.');
75
76 return Result.ToString();
77 }
78 }
79}
override async Task< string > GetDescription()
Gets a descriptive text for the category of event.
ContractResponseNotificationEvent(ContractPetitionResponseEventArgs e)
Notification event for contract petition responses.
Base class that references services in the app.
Definition: ServiceRef.cs:31
static IUiService UiService
Service serializing and managing UI-related tasks.
Definition: ServiceRef.cs:55
static IStringLocalizer Localizer
Localization service
Definition: ServiceRef.cs:235
static async Task< string?> GetCategory(Contract Contract)
Gets the category of a contract
Contains the definition of a contract
Definition: Contract.cs:22
Task GoToAsync(string Route, BackMethod BackMethod=BackMethod.Inherited, string? UniqueId=null)
Navigates the AppShell to the specified route, with page arguments to match.
Task< bool > DisplayAlert(string Title, string Message, string? Accept=null, string? Cancel=null)
Displays an alert/message box to the user.
BackMethod
Navigation Back Method
Definition: BackMethod.cs:7