diff options
author | Michael Hutchinson <mhutch@xamarin.com> | 2013-12-18 07:39:16 +0400 |
---|---|---|
committer | Michael Hutchinson <mhutch@xamarin.com> | 2013-12-21 02:13:51 +0400 |
commit | 22c036f5ae55c2e902a0adead598a2c7b84b19a9 (patch) | |
tree | 66f11e78e6457d62ba866ed1a9a32a25f0c0b222 /main/src/core/MonoDevelop.Projects.Formats.MSBuild | |
parent | 4f738eaf7185fc5b31ec8c76e7a76af492b360d7 (diff) |
[MSBuild] Set UI culture on builder processes
Fixes BXC16864 - XS should set UI language on MSBuild builder processes
Diffstat (limited to 'main/src/core/MonoDevelop.Projects.Formats.MSBuild')
3 files changed, 18 insertions, 4 deletions
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.cs index 4c7249652c..580d746872 100644 --- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.cs +++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.cs @@ -26,13 +26,10 @@ using System; using System.Threading; -using System.IO; -using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Remoting; using System.Collections.Generic; -using System.Collections; using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; +using System.Globalization; namespace MonoDevelop.Projects.Formats.MSBuild { @@ -42,6 +39,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild static ThreadStart workDelegate; static object workLock = new object (); static Thread workThread; + static CultureInfo uiCulture; static Exception workError; ManualResetEvent doneEvent = new ManualResetEvent (false); @@ -57,6 +55,11 @@ namespace MonoDevelop.Projects.Formats.MSBuild get { return doneEvent; } } + public void SetUICulture (CultureInfo uiCulture) + { + BuildEngine.uiCulture = uiCulture; + } + public IProjectBuilder LoadProject (string file, string solutionFile, string binDir) { return new ProjectBuilder (this, GetEngine (binDir), file, solutionFile); @@ -130,6 +133,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild workThread = new Thread (STARunner); workThread.SetApartmentState (ApartmentState.STA); workThread.IsBackground = true; + workThread.CurrentUICulture = uiCulture; workThread.Start (); } else diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.v4.0.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.v4.0.cs index 4b633e152a..011f5400f4 100644 --- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.v4.0.cs +++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/BuildEngine.v4.0.cs @@ -35,6 +35,7 @@ using Microsoft.Build.Framework; using Microsoft.Build.Evaluation;
using Microsoft.Build.Construction;
using System.Linq;
+using System.Globalization;
namespace MonoDevelop.Projects.Formats.MSBuild
{
@@ -44,6 +45,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild static ThreadStart workDelegate;
static object workLock = new object ();
static Thread workThread;
+ static CultureInfo uiCulture;
static Exception workError;
ManualResetEvent doneEvent = new ManualResetEvent (false);
@@ -59,6 +61,11 @@ namespace MonoDevelop.Projects.Formats.MSBuild get { return doneEvent; }
}
+ public void SetUICulture (CultureInfo uiCulture)
+ {
+ BuildEngine.uiCulture = uiCulture;
+ }
+
public IProjectBuilder LoadProject (string file, string solutionFile, string binDir)
{
return new ProjectBuilder (this, GetEngine (binDir), file, solutionFile);
@@ -150,6 +157,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild workThread = new Thread (STARunner);
workThread.SetApartmentState (ApartmentState.STA);
workThread.IsBackground = true;
+ workThread.CurrentUICulture = uiCulture;
workThread.Start ();
}
else
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IBuildEngine.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IBuildEngine.cs index b7debb94de..1fc493c469 100644 --- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IBuildEngine.cs +++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild/IBuildEngine.cs @@ -25,11 +25,13 @@ // THE SOFTWARE. using System; +using System.Globalization; namespace MonoDevelop.Projects.Formats.MSBuild { public interface IBuildEngine: IDisposable { + void SetUICulture (CultureInfo uiCulture); IProjectBuilder LoadProject (string file, string solutionFile, string binPath); void UnloadProject (IProjectBuilder pb); } |