C# BackgroundWorker's culture

前端 未结 6 896
情歌与酒
情歌与酒 2021-02-07 04:28

I woudl like to set the culture for my whole application. I tried the following :

Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(wanted         


        
6条回答
  •  逝去的感伤
    2021-02-07 04:54

    My solution was to have a central culture property (Application.CurrentCulture is per-thread) and set the current thread culture to this in the beginning of a worker thread. A job system helps with this, since you can then easily execute generic code before and after the work item, and the job system class can hold the culture accessible by its jobs, so you don't need globals.

提交回复
热议问题