BadScript 2
Loading...
Searching...
No Matches
CultureInfoExtensions.cs
Go to the documentation of this file.
1// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
2
3using System;
4using System.Globalization;
5using System.Threading;
6
8{
10 {
11 public Action ChangeCulture;
12 public Action ResetCulture;
13 }
14
16 {
17 public static CultureHandlers MakeCultureHandlers(this CultureInfo newCulture)
18 {
19 var currentCulutre = Thread.CurrentThread.CurrentCulture;
20
21 Action changer = () => Thread.CurrentThread.CurrentCulture = newCulture;
22
23 Action resetter = () => Thread.CurrentThread.CurrentCulture = currentCulutre;
24
25 return new CultureHandlers { ChangeCulture = changer, ResetCulture = resetter };
26 }
27 }
28}
static CultureHandlers MakeCultureHandlers(this CultureInfo newCulture)