Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
LanguageInfo.cs
1using System.ComponentModel;
2using System.Globalization;
3
5{
6 public class LanguageInfo : CultureInfo, INotifyPropertyChanged
7 {
8 public LanguageInfo(string Language, string ShownName)
9 : base(Language)
10 {
11 this.MyNativeName = ShownName;
12 LocalizationManager.CurrentCultureChanged += this.OnCurrentCultureChanged;
13 }
14
16 {
17 LocalizationManager.CurrentCultureChanged -= this.OnCurrentCultureChanged;
18 }
19
20 public string MyNativeName { get; private set; }
21
22 private void OnCurrentCultureChanged(object? sender, CultureInfo culture)
23 {
24 PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(this.IsCurrent)));
25 }
26
27 public bool IsCurrent => this.Name == CurrentCulture.Name;
28
29 public event PropertyChangedEventHandler? PropertyChanged;
30 }
31}