public ViewResult View(CultureInfo language, object model) { language.SetCurrentCulture(); return View(model); }
public ActionResult HtmlRepresentation(CultureInfo language, DateTime date) { language.SetCurrentCulture(); return View(date); }
public ActionResult HtmlRepresentation(CultureInfo language, string key) { language.SetCurrentCulture(); ViewBag.Key = key; return View(HttpContext.Cache[key]); }
public ActionResult ContentNegotiation(CultureInfo language) { if (null == language) { throw new ArgumentNullException("language"); } if (CultureInfo.InvariantCulture == language) { throw new ArgumentOutOfRangeException("language"); } language.SetCurrentCulture(); Accept accept = Request.Headers["Accept"]; return accept.Negotiate(Request, GetType()); }
public void op_SetCurrentCulture_CultureInfo() { var culture = Thread.CurrentThread.CurrentUICulture; try { var expected = new CultureInfo("fr"); expected.SetCurrentCulture(); var actual = Thread.CurrentThread.CurrentUICulture; Assert.Equal(expected, actual); } finally { Thread.CurrentThread.CurrentUICulture = culture; } }