public HomeController(IApplicationUsersService applicationUsersService, ITraceManager traceManager, ILocalizedStrings localizedStrings, ILocalizationManager localizationManager) : base(localizationManager) { _applicationUsersService = applicationUsersService; _traceManager = traceManager; _localizedStrings = localizedStrings; }
public UtilsController(IApplicationUsersService applicationUsersService, ITraceManager traceManager, ILocalizedStrings localizedStrings, IAPIHttpClient apiHttpClient, ILocalizationManager localizationManager) : base(localizationManager) { _applicationUsersService = applicationUsersService; _traceManager = traceManager; _localizedStrings = localizedStrings; _apiHttpClient = apiHttpClient; }
public AccountController(ILanguageStorageProvider languageStorageProvider, ILocalizedStrings localizedStrings, IAPIHttpClient apiHttpClient, IApplicationUsersService applicationUsersService, ILocalizationManager localizationManager) : base(localizationManager) { _languageStorageProvider = languageStorageProvider; _apiHttpClient = apiHttpClient; _applicationUsersService = applicationUsersService; }
/// <inheritdoc/> public void Load(CultureInfo culture) { ExceptionUtility.CheckArgumentNotNull(culture, "culture"); if (culture == this.Culture) { return; } this.strings = this.repository.GetLocalizedStrings(culture); this.Culture = culture; this.OnLoaded(); }
public void Add(string translatedString, ILocalizedStrings localizedStrings, long index) { IList <TranslationSource> translationSourceList; if (this._translatedStrings.ContainsKey(key: translatedString)) { translationSourceList = this._translatedStrings[key : translatedString]; } else { translationSourceList = new List <TranslationSource>(); this._translatedStrings[key : translatedString] = translationSourceList; } translationSourceList.Add(item: new TranslationSource(localizedStrings: localizedStrings, translationIndex: index)); }
public WireguardKeysManager(Func <bool> isCanUpdateKey, AppSettings appSettings, ILocalizedStrings appServices) { __IsCanUpdateKey = isCanUpdateKey; __AppSettings = appSettings; __LocalizedStrings = appServices; // try regenerate keys by a timer __CheckTimer = new Timer(async(object state) => { try { await RegenerateKeysIfNecessary(); } catch (Exception ex) { Logging.Info($"WARNING (WireguardKeysManager): automatic keys regeneration failed: {ex}"); } }); // check if we should regenerate keys when settings changed ('WireGuardKeysRegenerationIntervalHours' or 'WireGuardKeysTimestamp') __AppSettings.PropertyChanged += __AppSettings_PropertyChanged; }
public ViewModelWireguardSettings(MainViewModel mainViewModel, ILocalizedStrings localizedStrings) { __LocalizedStrings = localizedStrings; __MainViewModel = mainViewModel; Settings = __MainViewModel.AppState.Settings; KeysManager.OnStarted += () => { IsUpdateInProgress = true; }; KeysManager.OnStopped += () => { IsUpdateInProgress = false; }; Settings.PropertyChanged += (sender, e) => { if (string.Equals(e.PropertyName, nameof(Settings.WireGuardKeysTimestamp)) || string.Equals(e.PropertyName, nameof(Settings.WireGuardKeysRegenerationIntervalHours))) { RaisePropertyWillChange(nameof(Generated)); RaisePropertyChanged(nameof(Generated)); RaisePropertyWillChange(nameof(ExpirationDate)); RaisePropertyChanged(nameof(ExpirationDate)); RaisePropertyWillChange(nameof(AutoRegenerationDate)); RaisePropertyChanged(nameof(AutoRegenerationDate)); RaisePropertyWillChange(nameof(RegenerationIntervalDays)); RaisePropertyChanged(nameof(RegenerationIntervalDays)); RaisePropertyWillChange(nameof(WireGuardClientInternalIp)); RaisePropertyChanged(nameof(WireGuardClientInternalIp)); RaisePropertyWillChange(nameof(WireGuardClientPublicKey)); RaisePropertyChanged(nameof(WireGuardClientPublicKey)); } }; KeysManager.OnProgress += (string progress) => { ProgressStatus = progress; }; }
public ViewModelWireguardSettings(MainViewModel mainViewModel, IService service, ILocalizedStrings localizedStrings) { __Service = service; __LocalizedStrings = localizedStrings; __MainViewModel = mainViewModel; Settings = AppSettings.Instance(); KeysManager.OnStarted += () => { IsUpdateInProgress = true; }; KeysManager.OnStopped += () => { IsUpdateInProgress = false; }; __MainViewModel.AppState.OnSessionChanged += (SessionInfo sessionInfo) => { RaisePropertyWillChange(nameof(Generated)); RaisePropertyChanged(nameof(Generated)); RaisePropertyWillChange(nameof(ExpirationDate)); RaisePropertyChanged(nameof(ExpirationDate)); RaisePropertyWillChange(nameof(AutoRegenerationDate)); RaisePropertyChanged(nameof(AutoRegenerationDate)); RaisePropertyWillChange(nameof(RegenerationIntervalDays)); RaisePropertyChanged(nameof(RegenerationIntervalDays)); RaisePropertyWillChange(nameof(WireGuardClientInternalIp)); RaisePropertyChanged(nameof(WireGuardClientInternalIp)); RaisePropertyWillChange(nameof(WireGuardClientPublicKey)); RaisePropertyChanged(nameof(WireGuardClientPublicKey)); }; KeysManager.OnProgress += (string progress) => { ProgressStatus = progress; }; }
public TranslationSource(ILocalizedStrings localizedStrings, long translationIndex) { this._localizedStrings = localizedStrings; this._translationIndex = translationIndex; }
public ApplicationServices(ILocalizedStrings localizedStrings) { __LocalizedStrings = localizedStrings; }
/// <summary> /// Initialise le LocalizationManager. /// </summary> public LocalizationManager(ILocalizedStrings localizedStrings) { _localizedStrings = localizedStrings; SupportedCultures = _localizedStrings.GetSupportedLanguages(); }
static LocalizationManager() { _localizedStrings = new LocalizedStrings(new SQLiteLanguageStorageProvider("Data Source=Resources\\Localization.sqlite;")); SupportedCultures = _localizedStrings.GetSupportedLanguages(); CurrentCulture = Thread.CurrentThread.CurrentCulture; }
public ProofsViewModel(ILocalizedStrings localizedStrings) { __LocalizedStrings = localizedStrings; UpdateCommand = new RelayCommand(Update); }
public static ILocalizedStrings CreateRef(this ILocalizedStrings objectRef) => ((ILocalizedStrings)objectRef.CreateRef(typeof(ILocalizedStrings)));