Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
BrowserLink.cs
4
6{
10 public class BrowserLink : ILinkOpener
11 {
15 public BrowserLink()
16 {
17 }
18
24 public Grade Supports(Uri Link)
25 {
26 if (Link.Scheme == "http" || Link.Scheme == "https")
27 return Grade.Ok;
28 else
29 return Grade.NotAtAll;
30 }
31
33 public async Task<bool> TryOpenLink(Uri Link, bool ShowErrorIfUnable)
34 {
35 bool CanOpen = false;
36
37 await MainThread.InvokeOnMainThreadAsync(async () =>
38 {
39 CanOpen = await Browser.Default.OpenAsync(Link);
40 });
41
42 if (CanOpen)
43 return true;
44 else
45 {
46 if (ShowErrorIfUnable)
47 {
48 await ServiceRef.UiService.DisplayAlert(
51 Environment.NewLine + Environment.NewLine + Link.OriginalString);
52 }
53
54 return false;
55 }
56 }
57 }
58}
A strongly-typed resource class, for looking up localized strings, etc.
static string QrCodeNotUnderstood
Looks up a localized string similar to Code not understood.
static string ErrorTitle
Looks up a localized string similar to An error has occurred.
Base class that references services in the app.
Definition: ServiceRef.cs:43
static IUiService UiService
Service serializing and managing UI-related tasks.
Definition: ServiceRef.cs:130
static IReportingStringLocalizer Localizer
Localization service
Definition: ServiceRef.cs:370
Grade
Grade enumeration
Definition: Grade.cs:7