Exemple #1
0
        private void OnLangChanged(object sender, SelectionChangedEventArgs e)
        {
            var selLang = cmbLang.SelectedIndex;

            if (selLang != selectedLang)
            {
                LanguageSetting.SetLanguage((LanguageEnum)cmbLang.SelectedIndex);
                selectedLang = selLang;
            }
        }
Exemple #2
0
        public MainWindow()
        {
            InitializeComponent();
            LanguageSetting.SetLanguage("he");

            setBinding();


            unitBtns.Visibility = Visibility.Hidden;
        }
Exemple #3
0
        public ActionResult SetLanguage(string lang)
        {
            var        Path          = Request.UrlReferrer.AbsolutePath;
            HttpCookie cultureCookie = new HttpCookie("culture");

            cultureCookie.Value   = lang;
            cultureCookie.Expires = DateTime.Now.AddDays(1);
            Response.SetCookie(cultureCookie);
            LanguageSetting.SetLanguage(lang);
            return(Redirect(Path));
        }
        protected override IAsyncResult BeginExecuteCore(AsyncCallback callback, object state)
        {
            string lang;
            var    langCookie = Request.Cookies["culture"];

            if (langCookie != null)
            {
                lang = langCookie.Value;
            }
            else
            {
                var userLanguage = Request.UserLanguages;
                lang = userLanguage != null ? userLanguage[0] : "ar";
            }
            LanguageSetting.SetLanguage(lang);
            return(base.BeginExecuteCore(callback, state));
        }
Exemple #5
0
 private void Button_Click2(object sender, RoutedEventArgs e)
 {
     LanguageSetting.SetLanguage("en");
     setBinding();
 }