Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CurrentCulture
Message
From
09/05/2011 10:00:24
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
C# 4.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01509427
Message ID:
01510044
Views:
51
>>Hi All,
>>
>>What would be the difference in these in reality?
>>
>>
>>
>>In a WPF Application object
>>Dispatcher.Thread.CurrentCulture
>>
>>In a class
>>System.Threading.Thread.CurrentThread.CurrentCulture
>>
>>
>>
>>Will these basically be the same thing in the end?
>
>I guess this is a WPF question and comes down to whether System.Threading.Thread.CurrentThread will be the same as Dispatcher.Thread - and the answer is no. e.g:
System.Diagnostics.Debug.WriteLine((Dispatcher.Thread == System.Threading.Thread.CurrentThread).ToString());
>
>BackgroundWorker b = new BackgroundWorker();
>b.DoWork += new DoWorkEventHandler(b_DoWork);
>b.RunWorkerAsync();
>
>void b_DoWork(object sender, DoWorkEventArgs e)
>{ System.Diagnostics.Debug.WriteLine((Dispatcher.Thread == System.Threading.Thread.CurrentThread).ToString()); }
OK, I looked into this a bit further and I don't think it would be an issue. The culture was being retrieved from Dispatcher.thread and some settings adjusted then set back on Dispatcher.Thread. Because of my changes there isn't access to the Dispatcher when I need it. I am getting it from system.Threading, making the adjustments, and then setting it on the Dispatcher Thread later. They are just adjusting for language and only between German and English. The company that did this originally was in Germany so I think it was probably internal. We do not localize this application.

Thanks
Tim
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform