public void GetLocales() { List <WebLocale> locales; locales = LocaleManager.GetLocales(GetContext()); Assert.IsTrue(locales.IsNotEmpty()); }
public void GetLocale() { WebLocale testLocale; // Test get locale by id. foreach (WebLocale locale in LocaleManager.GetLocales(GetContext())) { testLocale = LocaleManager.GetLocale(GetContext(), locale.Id); Assert.AreEqual(testLocale.Id, locale.Id); Assert.AreEqual(testLocale.ISOCode, locale.ISOCode); } // Test get locale by ISO code. foreach (WebLocale locale in LocaleManager.GetLocales(GetContext())) { testLocale = LocaleManager.GetLocale(GetContext(), locale.ISOCode); Assert.AreEqual(testLocale.Id, locale.Id); Assert.AreEqual(testLocale.ISOCode, locale.ISOCode); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { //AboutWindow.xaml VersionString.Text = string.Format("{0} {1} ({2})", TryFindResource("Version"), VersionInfo.Core, VersionInfo.Configuration); CopyrightLongBar.Text = string.Format("© 2010 LongBar Project Group. {0}", TryFindResource("AllRightsReserved")); CopyrightProject.Text = string.Format("© 2016-{1} The AvalonBar Project. {0}", TryFindResource("AllRightsReserved"), DateTime.Now.Year); //----------------- AutostartCheckBox.IsChecked = SidebarWindow.sett.startup; TopMostCheckBox.IsChecked = SidebarWindow.sett.topMost; LockedCheckBox.IsChecked = SidebarWindow.sett.locked; if (SidebarWindow.sett.side == AppBarSide.Left) { LocationComboBox.SelectedIndex = 0; } else { LocationComboBox.SelectedIndex = 1; } string[] locales = LocaleManager.GetLocales(Sidebar.SidebarWindow.sett.path); for (int i = 0; i <= locales.Length - 1; i++) { ComboBoxItem item2 = new ComboBoxItem(); item2.Content = locales[i]; LangComboBox.Items.Add(item2); } LangComboBox.Text = SidebarWindow.sett.locale; if (DwmManager.IsBlurAvailable) { AeroGlassCheckBox.IsEnabled = true; AeroGlassCheckBox.IsChecked = SidebarWindow.sett.enableGlass; } else { AeroGlassCheckBox.IsEnabled = false; AeroGlassCheckBox.IsChecked = false; } if (SidebarWindow.sett.topMost) { OverlapCheckBox.IsEnabled = true; OverlapCheckBox.IsChecked = SidebarWindow.sett.overlapTaskbar; } else { OverlapCheckBox.IsEnabled = false; OverlapCheckBox.IsChecked = false; } if (SidebarWindow.sett.enableShadow) { ShadowCheckBox.IsChecked = true; } else { ShadowCheckBox.IsChecked = false; } UpdatesCheckBox.IsChecked = SidebarWindow.sett.enableUpdates; string[] themes = ThemesManager.GetThemes(Sidebar.SidebarWindow.sett.path); for (int i = 0; i <= themes.Length - 1; i++) { ComboBoxItem newItem = new ComboBoxItem(); newItem.Content = themes[i]; ThemesComboBox.Items.Add(newItem); } ThemesComboBox.Text = SidebarWindow.sett.theme; ApplyButton.IsEnabled = false; string[] screenNames = Utils.GetScreenFriendlyNames(); System.Windows.Forms.Screen[] screens = System.Windows.Forms.Screen.AllScreens; for (int i = 0; i < screenNames.Length; i++) { ComboBoxItem item = new ComboBoxItem(); item.Content = screenNames[i]; item.Tag = screens[i].DeviceName; ScreenComboBox.Items.Add(item); } if (SidebarWindow.sett.screen == "Primary") { ScreenComboBox.SelectedIndex = 0; } else { ScreenComboBox.SelectedIndex = 0; foreach (ComboBoxItem cbItem in ScreenComboBox.Items) { if ((string)cbItem.Content != "Primary" && (string)cbItem.Tag == SidebarWindow.sett.screen) { ScreenComboBox.SelectedItem = cbItem; break; } } } }