Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with threads ? maybe ?

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support
View previous topic :: View next topic  
Author Message
BernardG



Joined: 22 Apr 2010
Posts: 5
Location: France

PostPosted: Tue Apr 27, 2010 12:31 pm    Post subject: Problem with threads ? maybe ? Reply with quote

I am about done localizing my WPF application while evaluating Globalizer, it works very well. I added a menu, copying your example, everything is fine.

There is just a little annoying problem I am not sure how to solve, but I have to confess I am still new at .net and have a lot to learn!

Our connections steps are displayed to the user from an event coming from another control/thread. Those keep the Machine culture and do not change when the menu item is clicked. I tried to put CultureManager.SynchronizeThreadCulture = true, without success.

I am not sure what code would be useful for you to point me in the right direction, but here the method giving me fits:

Code:

    Private Sub TelecontrolProgressChangedHandler(ByVal progressStep As TelecontrolConnectionSteps) Handles TelecontrolControl.TelecontrolProgressChanged   

        Select Case progressStep
            Case TelecontrolConnectionSteps.TimeoutWhileWaitingConnectionAcceptation, TelecontrolConnectionSteps.DisplayDllLoadingFails
                MyUserMessageDisplay.AddMessage(Enums.MessageType.ErrorMessage, Telecontrolmanager.GetString("ConnectionStep_" & progressStep.ToString()) & " (" & myManager.GetString("StepValue:") & " '" & progressStep & "')")
            Case Else
                MyUserMessageDisplay.AddMessage(Enums.MessageType.InformationMessage, Telecontrolmanager.GetString("ConnectionStep_" & progressStep.ToString()) & " (" & myManager.GetString("StepValue:") & " '" & progressStep & "')")
        End Select
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Apr 27, 2010 10:46 pm    Post subject: Reply with quote

For threads other than the main GUI thread you need to set the CurrentUICulture yourself if that thread is accessing culture specific resources. If the thread is a long running thread then you will probably need to set these each time before you access the resources (to handle the possibility the culture has been changed) eg:

Code:
Thread.CurrentThread.CurrentUICulture = CultureManager.UICulture;

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
BernardG



Joined: 22 Apr 2010
Posts: 5
Location: France

PostPosted: Wed Apr 28, 2010 7:06 am    Post subject: Reply with quote

Thanks you! This works like a charm! BTW, we bought yesterday, after barely a week of evaluating your product.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group