ISynchronizeInvoke and UI Culture problem

S

schaf

Hi NG !
I set the CurrentCulture and the CurrentUICulture at the start of my
app using this code:

string sUICulture =
System.Configuration.ConfigurationSettings.AppSettings["UICulture"];
if (sUICulture != null) {
CultureInfo cultInfo = new CultureInfo(sUICulture);
Thread.CurrentThread.CurrentUICulture = cultInfo;
Thread.CurrentThread.CurrentCulture = cultInfo;
}

That fine, all my UI text appears according the settings in the
app.config. But in one case, I handle an event of a related system. (At
the moment no synchronisation is done). This code runs with the culture
settings of the System. (That's OK, because i did not synchronize). Now
I would like to check if Invoke is required (InvokeRequired). But this
does not work. The value is set to true, but if I debug the project,
the code within the if clause would not be executed. Why ?
In this state of execution it is possible to retrieve the
CurrentUICulture for the thread, but after an aditional call of a
function, it is neither possible the get the UICulture from the thread,
nor from the System. Why? What could go wrong ?

Thanks
Marcel
 
S

schaf

I'm sorry my fault I just have the following problem:
I set the CurrentCulture and the CurrentUICulture at the start of my
app using this code:

string sUICulture =
System.Configuration.ConfigurationSettings.AppSettings["UICulture"];
if (sUICulture != null) {
CultureInfo cultInfo = new CultureInfo(sUICulture);
Thread.CurrentThread.CurrentUICulture = cultInfo;
Thread.CurrentThread.CurrentCulture = cultInfo;
}

That fine, all my UI text appears according the settings in the
app.config. But in one case, I handle an event of a related system. (At
the moment no synchronisation is done). This code runs with the culture
settings of the System. (That's OK, because i did not synchronize).
In this state of execution it is possible to retrieve the
CurrentUICulture for the thread, but after an additional call of a
function, it is neither possible the get the UICulture from the thread,
nor from the System. Why? What could go wrong ?


Hi NG !
I set the CurrentCulture and the CurrentUICulture at the start of my
app using this code:

string sUICulture =
System.Configuration.ConfigurationSettings.AppSettings["UICulture"];
if (sUICulture != null) {
CultureInfo cultInfo = new CultureInfo(sUICulture);
Thread.CurrentThread.CurrentUICulture = cultInfo;
Thread.CurrentThread.CurrentCulture = cultInfo;
}

That fine, all my UI text appears according the settings in the
app.config. But in one case, I handle an event of a related system. (At
the moment no synchronisation is done). This code runs with the culture
settings of the System. (That's OK, because i did not synchronize). Now
I would like to check if Invoke is required (InvokeRequired). But this
does not work. The value is set to true, but if I debug the project,
the code within the if clause would not be executed. Why ?
In this state of execution it is possible to retrieve the
CurrentUICulture for the thread, but after an aditional call of a
function, it is neither possible the get the UICulture from the thread,
nor from the System. Why? What could go wrong ?

Thanks
Marcel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top