예제 #1
0
        /// <summary>
        ///     Constructor.
        /// </summary>
        ///
        /// <exception cref="ArgumentNullException">    Thrown when one or more required arguments are null. </exception>
        ///
        /// <param name="messengerService">     The messenger service. This cannot be null. </param>
        /// <param name="localisationService">  The localisation service. This cannot be null. </param>
        /// <param name="traceService">         The trace service. This cannot be null. </param>
        /// <param name="logger">               The logger. This cannot be null. </param>
        /// <param name="messageFactory">       The message factory. This cannot be null. </param>
        /// <param name="dateTimeService">      The date time service. This cannot be null. </param>
        public LoggingServiceSingleton(
            [NotNull] IMessengerService messengerService,
            [NotNull] ILocalisationService localisationService,
            [NotNull] ITraceService traceService,
            [NotNull] ILogger logger,
            [NotNull] IMessageFactory messageFactory,
            [NotNull] IDateTimeService dateTimeService)
        {
            if (logger is null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            _messengerService    = messengerService ?? throw new ArgumentNullException(nameof(messengerService));
            _localisationService = localisationService ?? throw new ArgumentNullException(nameof(localisationService));
            _traceService        = traceService ?? throw new ArgumentNullException(nameof(traceService));
            _messageFactory      = messageFactory ?? throw new ArgumentNullException(nameof(messageFactory));
            _dateTimeService     = dateTimeService ?? throw new ArgumentNullException(nameof(dateTimeService));

            _logActionDictionary = new Dictionary <MessageLevelEnum, Action <string> >(6)
            {
                { MessageLevelEnum.Verbose, logger.Verbose },
                { MessageLevelEnum.Debug, logger.Debug },
                { MessageLevelEnum.Information, logger.Information },
                { MessageLevelEnum.Warning, logger.Warning },
                { MessageLevelEnum.Error, logger.Error },
                { MessageLevelEnum.Fatal, logger.Fatal }
            };
        }
예제 #2
0
        private void InitialiseCulture()
        {
            IPlatformProvider platformProvider = container.GetInstance <IPlatformProvider>();

            if (platformProvider.PlatformInfo.PlatformType != PlatformTypeEnum.AppleIOS ||
                platformProvider.PlatformInfo.PlatformType != PlatformTypeEnum.Android)
            {
                return;
            }

            ILocalisationService localise = container.GetInstance <ILocalisationService>();

            localise.SetCulture(localise.GetCurrentCultureInfo());
        }
예제 #3
0
        public async Task <IActionResult> GetBadgeStatusAsync(
            [FromServices] ILocalisationService localisationService,
            [FromRoute] string languageId)
        {
            int progress = await localisationService.GetLanguageProgressAsync(languageId);

            string progressSvg = await GetProgressImageAsync(progress);

            if (progressSvg == null)
            {
                return(new StatusCodeResult(404));
            }

            return(Content(progressSvg, MimeTypes.ImageSvgXml));
        }
예제 #4
0
        protected XFrame(
            ILifetimeScope c,
            ILoadStatusService systemTrayService,
            IOrientationService orientationService,
            ILocalisationService localisationService,
            IXNavigation xNavigationService,
            IDispatcher dispatcher)
        {
            _loadStatusService   = systemTrayService;
            _orientationService  = orientationService;
            _localisationService = localisationService;
            _navigation          = xNavigationService;
            Dispatcher           = dispatcher;
            Container            = c;

            Id = Guid.NewGuid();
        }
예제 #5
0
 public XRootFrame(ILifetimeScope c, ILoadStatusService systemTrayService, IOrientationService orientationService, ILocalisationService localisationService, IXNavigation xNavigationService, IDispatcher dispatcher) : base(c, systemTrayService, orientationService, localisationService, xNavigationService, dispatcher)
 {
 }
예제 #6
0
 public SettingsService(ILocalisationService localisationService, IStorageService storageService)
 {
     _localisationService = localisationService;
     _storageService      = storageService;
     GetSettingsAsync().ConfigureAwait(false);
 }
예제 #7
0
 public XEntry()
 {
     _localisationService = ContainerHost.Container.Resolve <ILocalisationService>();
 }
예제 #8
0
 public XEntry()
 {
     _localisationService = ContainerHost.Container.Resolve<ILocalisationService>();
 }
 public LocaleRouteConstraint(ILocalisationService localisationService)
 {
     this._localisationService = localisationService;
 }
예제 #10
0
 public ContractService(ILocalisationService localisationService, IStorageService storageService)
 {
     _localisationService = localisationService;
     _storageService      = storageService;
     // GetContractsAsync().ConfigureAwait(false);
 }
예제 #11
0
 public ContractService(ILocalisationService localisationService, IStorageService storageService)
 {
     _localisationService = localisationService;
     _storageService = storageService;
     // GetContractsAsync().ConfigureAwait(false);
 }
예제 #12
0
 public CustomersViewModel(CustomerService customerService, ILocalisationService localisationService)
 {
     _customerService     = customerService;
     _localisationService = localisationService;
 }
 public LocalisationTextsController(ILocalisationService localisationService)
 {
     _localisationService = localisationService;
 }
예제 #14
0
 public LocalisationZipCodeResolver(ILocalisationService localisationService) => _localisationService = localisationService;
예제 #15
0
        /// <summary>
        /// Initialises a specific .Net Resource file with localised strings to application culture through localisation service.
        /// </summary>
        private void InitialiseLocalisedResourceFileWithCulture(out CultureInfo targetCultureInResourceFile)
        {
            ILocalisationService localise = container.GetInstance <ILocalisationService>();

            targetCultureInResourceFile = localise.GetCurrentCultureInfo();
        }