1using System.Diagnostics;
3using System.Globalization;
4using System.Reflection;
5using Microsoft.Extensions.Localization;
47 private static IStringLocalizer? localizer;
49 private static IBarcodeReader? barcodeReader;
107 return networkService;
119 return contractOrchestratorService;
131 return thingRegistryOrchestratorService;
143 return neuroWalletOrchestratorService;
155 return attachmentCacheService;
167 return cryptoService;
179 return settingsService;
191 return storageService;
215 return notificationService;
227 return pushNotificationService;
238 localizer ??=
new LocalizerReportingMissingStrings(
LocalizationManager.GetStringLocalizer<AppResources>());
247 private class LocalizerReportingMissingStrings(IStringLocalizer
Localizer) : IStringLocalizer
249 private readonly IStringLocalizer localizer = Localizer;
251 public LocalizedString
this[
string Name]
255 LocalizedString Result = this.localizer[Name];
256 if (Result is not
null && !Result.ResourceNotFound)
259 StackTrace Trace =
new();
261 int i, c = Trace.FrameCount;
262 Assembly ThisAssembly = typeof(
App).Assembly;
264 for (i = 1; i < c; i++)
266 Type? T = Trace.GetFrame(i)?.GetMethod()?.DeclaringType;
270 if (T.Assembly.FullName == ThisAssembly.FullName)
272 if (T == typeof(LocalizerReportingMissingStrings))
275 if (T.IsConstructedGenericType)
276 T = T.GetGenericTypeDefinition();
285 return new LocalizedString(Name, Name,
true);
289 public LocalizedString
this[
string Name, params
object[] Arguments]
293 LocalizedString Result =
this[Name];
294 if (Result.ResourceNotFound)
297 return new LocalizedString(Name,
string.Format(CultureInfo.CurrentCulture, Result.Value, Arguments));
301 public IEnumerable<LocalizedString> GetAllStrings(
bool includeParentCultures)
303 return this.localizer.GetAllStrings(includeParentCultures);
315 return platformSpecific;
323 public static IBarcodeReader BarcodeReader
327 barcodeReader ??=
ServiceHelper.GetService<IBarcodeReader>();
328 return barcodeReader;
The Application class, representing an instance of the Neuro-Access app.
Access to localized strings.
static void ReportMissingString(string StringId, Type Type)
Reports a missing string
Near-Field Communication (NFC) Service.
Push notification service
Base class that references services in the app.
static ILogService LogService
Log service.
static INetworkService NetworkService
Network service.
static IAttachmentCacheService AttachmentCacheService
AttachmentCache service.
static IStorageService StorageService
Storage service.
static ICryptoService CryptoService
Crypto service.
static INeuroWalletOrchestratorService NeuroWalletOrchestratorService
Neuro Wallet orchestrator service.
static IStringLocalizer Localizer
Localization service
static IContractOrchestratorService ContractOrchestratorService
Contract orchestrator service.
static IThingRegistryOrchestratorService ThingRegistryOrchestratorService
Thing Registry orchestrator service.
static IXmppService XmppService
The XMPP service for XMPP communication.
static ISettingsService SettingsService
Settings service.
The TAG Profile is the heart of the digital identity for a specific user/device. Use this instance to...
Represents a service that caches images downloaded via http calls. They are stored for a certain dura...
Orchestrates operations on contracts upon receiving certain events, like approving or rejecting other...
Cryptographic service that helps create passwords and other security related tasks.
A log implementation for logging warnings, exceptions and events.
The network service is a wafer-thin wrapper around the Connectivity object. It exposes an event handl...
Interface for the Near-Field Communication (NFC) Service.
Interface for push notification services.
Interface for push notification services.
Handles common runtime settings that need to be persisted during sessions.
Wraps the Database for easy access to persistent encrypted storage. Use this for any sensitive data.
The TAG Profile is the heart of the digital identity for a specific user/device. Use this instance to...
Orchestrates operations on things via Thing Registry services.
Service serializing and managing UI-related tasks.
Orchestrates eDaler operations.
Represents an abstraction of a connection to an XMPP Server.