Browse Source

Initialize $(SharpDevelopBinPath) for project copy done when editing inactive configuration/platform. Fixed forum-13465.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2079 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
2d6c265816
  1. 6
      src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs
  2. 16
      src/Main/Base/Project/Src/Project/MSBuildInternals.cs
  3. 49
      src/Main/Core/Project/Src/Services/MessageService/MessageService.cs

6
src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs

@ -112,7 +112,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -112,7 +112,7 @@ namespace ICSharpCode.SharpDevelop.Project
protected virtual void Create(ProjectCreateInformation information)
{
InitializeMSBuildProject();
InitializeMSBuildProject(project);
Name = information.ProjectName;
FileName = information.OutputProjectFileName;
@ -788,7 +788,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -788,7 +788,7 @@ namespace ICSharpCode.SharpDevelop.Project
#region Loading
protected bool isLoading;
void InitializeMSBuildProject()
internal static void InitializeMSBuildProject(MSBuild.Project project)
{
project.GlobalProperties.SetProperty("BuildingInsideVisualStudio", "true");
foreach (KeyValuePair<string, string> pair in MSBuildEngine.MSBuildProperties) {
@ -802,7 +802,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -802,7 +802,7 @@ namespace ICSharpCode.SharpDevelop.Project
try {
this.FileName = fileName;
InitializeMSBuildProject();
InitializeMSBuildProject(project);
try {
project.Load(fileName);

16
src/Main/Base/Project/Src/Project/MSBuildInternals.cs

@ -119,11 +119,17 @@ namespace ICSharpCode.SharpDevelop.Project @@ -119,11 +119,17 @@ namespace ICSharpCode.SharpDevelop.Project
if (tempProject != null && tempProject != baseProject) {
tempProject.ParentEngine.UnloadAllProjects();
}
MSBuild.Engine engine = CreateEngine();
tempProject = engine.CreateNewProject();
tempProject.LoadXml(baseProject.Xml);
tempProject.SetProperty("Configuration", configuration);
tempProject.SetProperty("Platform", platform);
try {
MSBuild.Engine engine = CreateEngine();
tempProject = engine.CreateNewProject();
MSBuildBasedProject.InitializeMSBuildProject(tempProject);
tempProject.LoadXml(baseProject.Xml);
tempProject.SetProperty("Configuration", configuration);
tempProject.SetProperty("Platform", platform);
} catch (Exception ex) {
ICSharpCode.Core.MessageService.ShowWarning(ex.ToString());
tempProject = baseProject;
}
}
internal static PropertyStorageLocations GetLocationFromCondition(string condition)

49
src/Main/Core/Project/Src/Services/MessageService/MessageService.cs

@ -81,20 +81,17 @@ namespace ICSharpCode.Core @@ -81,20 +81,17 @@ namespace ICSharpCode.Core
}
if (MessageService.MainForm == null) {
// let's try this; don't know if it's threadsafe? I expect
// that MainForm.InvokeRequired can be assumed to be false
// if MainForm doesn't exist yet...
MessageBox.Show(StringParser.Parse(msg), StringParser.Parse("SharpDevelop: ${res:Global.ErrorText}"), MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(StringParser.Parse(msg), StringParser.Parse("SharpDevelop: ${res:Global.ErrorText}"), MessageBoxButtons.OK, MessageBoxIcon.Error);
} else {
MethodInvoker showError = delegate {
MessageBox.Show(MessageService.MainForm, StringParser.Parse(msg), StringParser.Parse("${res:Global.ErrorText}"), MessageBoxButtons.OK, MessageBoxIcon.Error);
};
if (MessageService.MainForm.InvokeRequired) {
MessageService.MainForm.BeginInvoke(showError);;
} else {
showError();
}
MethodInvoker showError = delegate {
MessageBox.Show(MessageService.MainForm, StringParser.Parse(msg), StringParser.Parse("${res:Global.ErrorText}"), MessageBoxButtons.OK, MessageBoxIcon.Error);
};
if (MessageService.MainForm.InvokeRequired) {
MessageService.MainForm.BeginInvoke(showError);
} else {
showError();
}
}
}
@ -102,13 +99,25 @@ namespace ICSharpCode.Core @@ -102,13 +99,25 @@ namespace ICSharpCode.Core
{
message = StringParser.Parse(message);
LoggingService.Warn(message);
MessageBox.Show(MessageService.MainForm,
message,
StringParser.Parse("${res:Global.WarningText}"),
MessageBoxButtons.OK,
MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button1,
GetOptions(message, message));
string caption = StringParser.Parse("${res:Global.WarningText}");
if (MessageService.MainForm == null) {
MessageBox.Show(message, caption,
MessageBoxButtons.OK, MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button1, GetOptions(message, caption));
} else {
MethodInvoker showWarning = delegate {
MessageBox.Show(MessageService.MainForm,
message, caption,
MessageBoxButtons.OK, MessageBoxIcon.Warning,
MessageBoxDefaultButton.Button1, GetOptions(message, caption));
};
if (MessageService.MainForm.InvokeRequired) {
MessageService.MainForm.BeginInvoke(showWarning);
} else {
showWarning();
}
}
}
public static void ShowWarningFormatted(string formatstring, params string[] formatitems)

Loading…
Cancel
Save