Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #101: Draft for precision-based calculator #1

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
We didn't fully reset culture settings while disposing.
  • Loading branch information
wahidshalaly committed Mar 29, 2014
commit b206a45ce79793f960d7e1493eb370ad07edd1ec
7 changes: 4 additions & 3 deletions src/Humanizer.Tests/AmbientCulture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ namespace Humanizer.Tests
{
public class AmbientCulture : IDisposable
{
private readonly CultureInfo _culture;
private readonly CultureInfo _callerCulture;

public AmbientCulture(CultureInfo culture)
{
_culture = Thread.CurrentThread.CurrentUICulture;
_callerCulture = Thread.CurrentThread.CurrentUICulture;
Thread.CurrentThread.CurrentCulture = culture;
Thread.CurrentThread.CurrentUICulture = culture;
}
Expand All @@ -22,7 +22,8 @@ public AmbientCulture(string cultureName)

public void Dispose()
{
Thread.CurrentThread.CurrentUICulture = _culture;
Thread.CurrentThread.CurrentCulture = _callerCulture;
Thread.CurrentThread.CurrentUICulture = _callerCulture;
}
}
}