コード例 #1
0
        public GlobalizationUtilities()
        {
            SupportedCultures = new List<SupportedCulture>();
            SupportedCultures.Add(new SupportedCulture("de-DE", OnSelectedCultureChanged));
            SupportedCultures.Add(new SupportedCulture("en-GB", OnSelectedCultureChanged));
            SupportedCultures.Add(new SupportedCulture("en-US", OnSelectedCultureChanged));
            SupportedCultures.Add(new SupportedCulture("fr-FR", OnSelectedCultureChanged));
            SupportedCultures.Add(new SupportedCulture("fa-IR", OnSelectedCultureChanged));

            SelectedCulture = SupportedCultures.FirstOrDefault();
        }
コード例 #2
0
        public GlobalizationUtilities()
        {
            SupportedCultures = new List <SupportedCulture>();
            SupportedCultures.Add(new SupportedCulture("de-DE", OnSelectedCultureChanged));
            SupportedCultures.Add(new SupportedCulture("en-GB", OnSelectedCultureChanged));
            SupportedCultures.Add(new SupportedCulture("en-US", OnSelectedCultureChanged));
            SupportedCultures.Add(new SupportedCulture("fr-FR", OnSelectedCultureChanged));
            SupportedCultures.Add(new SupportedCulture("fa-IR", OnSelectedCultureChanged));

            SelectedCulture = SupportedCultures.FirstOrDefault();
        }
コード例 #3
0
        private void SelectCulture(SupportedCulture culture)
        {
            if (SelectedCulture != null)
            {
                SelectedCulture.IsSelected = false;
            }
            SelectedCulture = culture;

            Thread.CurrentThread.CurrentCulture = culture.CultureInfo;
            Thread.CurrentThread.CurrentUICulture = culture.CultureInfo;

            if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(null));
            if (SelectedCultureChanged != null) SelectedCultureChanged(this, EventArgs.Empty);
        }
コード例 #4
0
        private void SelectCulture(SupportedCulture culture)
        {
            if (SelectedCulture != null)
            {
                SelectedCulture.IsSelected = false;
            }
            SelectedCulture = culture;

            Thread.CurrentThread.CurrentCulture   = culture.CultureInfo;
            Thread.CurrentThread.CurrentUICulture = culture.CultureInfo;

            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(null));
            }
            if (SelectedCultureChanged != null)
            {
                SelectedCultureChanged(this, EventArgs.Empty);
            }
        }
コード例 #5
0
ファイル: ViewModelBase.cs プロジェクト: Slesa/Poseidon
 // Die Kultur hat sich geändert
 void OnSelectedCultureChanged(object sender, EventArgs e)
 {
     CurrentCulture = GlobalizationUtilities.TheInstance.SelectedCulture;
 }
コード例 #6
0
ファイル: ViewModelBase.cs プロジェクト: Slesa/Poseidon
 // Konstruktor. Richtet Kultur und Änderungsbenachrichtigung ein
 public ViewModelBase()
 {
     _currentCulture = GlobalizationUtilities.TheInstance.SelectedCulture;
     GlobalizationUtilities.TheInstance.SelectedCultureChanged += OnSelectedCultureChanged;
 }