Browse Source

Fix various bugs in new solution model.

pull/32/merge
Daniel Grunwald 13 years ago
parent
commit
453c566254
  1. 1
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs
  2. 1
      src/Main/Base/Project/Src/Project/AbstractProject.cs
  3. 1
      src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs
  4. 3
      src/Main/Base/Project/Src/Project/MSBuildConfigurationOrPlatformNameCollection.cs
  5. 6
      src/Main/SharpDevelop/Project/Configuration/EditAvailableConfigurationsDialog.cs
  6. 4
      src/Main/SharpDevelop/Project/Configuration/SolutionConfigurationEditor.cs
  7. 7
      src/Main/SharpDevelop/Project/Solution.cs

1
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs

@ -313,6 +313,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -313,6 +313,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
}
}
info.TypeGuid = descriptor.Guid;
info.RootNamespace = standardNamespace.ToString();
info.ProjectName = newProjectName;
if (!string.IsNullOrEmpty(defaultPlatform))

1
src/Main/Base/Project/Src/Project/AbstractProject.cs

@ -46,6 +46,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -46,6 +46,7 @@ namespace ICSharpCode.SharpDevelop.Project
this.Name = information.ProjectName;
this.FileName = information.FileName;
this.idGuid = (information.IdGuid != Guid.Empty ? information.IdGuid : Guid.NewGuid());
Debug.Assert(information.TypeGuid != Guid.Empty);
this.TypeGuid = information.TypeGuid;
if (information.ProjectSections != null)
this.projectSections.AddRange(information.ProjectSections);

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

@ -171,6 +171,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -171,6 +171,7 @@ namespace ICSharpCode.SharpDevelop.Project
userProjectFile.FullPath = information.FileName + ".user";
projectFile.AddProperty(ProjectGuidPropertyName, IdGuid.ToString("B").ToUpperInvariant());
projectFile.AddProperty("ProjectTypeGuids", TypeGuid.ToString("B").ToUpperInvariant());
AddGuardedProperty("Configuration", information.ActiveProjectConfiguration.Configuration);
AddGuardedProperty("Platform", information.ActiveProjectConfiguration.Platform);

3
src/Main/Base/Project/Src/Project/MSBuildConfigurationOrPlatformNameCollection.cs

@ -109,6 +109,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -109,6 +109,7 @@ namespace ICSharpCode.SharpDevelop.Project
var userProjectFile = project.MSBuildUserProjectFile;
bool copiedGroupInMainFile = false;
if (copyFrom != null) {
copyFrom = MSBuildInternals.FixPlatformNameForProject(copyFrom);
foreach (ProjectPropertyGroupElement g in projectFile.PropertyGroups.ToList()) {
var gConfig = ConfigurationAndPlatform.FromCondition(g.Condition);
if (HasName(gConfig, copyFrom)) {
@ -181,7 +182,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -181,7 +182,7 @@ namespace ICSharpCode.SharpDevelop.Project
string otherName = null;
foreach (string configName in this) {
if (!ConfigurationAndPlatform.ConfigurationNameComparer.Equals(configName, name)) {
otherName = name;
otherName = configName;
break;
}
}

6
src/Main/SharpDevelop/Project/Configuration/EditAvailableConfigurationsDialog.cs

@ -29,12 +29,14 @@ namespace ICSharpCode.SharpDevelop.Project @@ -29,12 +29,14 @@ namespace ICSharpCode.SharpDevelop.Project
ctl.Text = StringParser.Parse(ctl.Text);
}
this.configurable = configurable;
this.editPlatforms = editPlatforms;
if (editPlatforms) {
this.Text = StringParser.Parse("${res:Dialog.EditAvailableConfigurationsDialog.EditSolutionPlatforms}");
this.editedCollection = configurable.ConfigurationNames;
this.editedCollection = configurable.PlatformNames;
} else {
this.Text = StringParser.Parse("${res:Dialog.EditAvailableConfigurationsDialog.EditSolutionConfigurations}");
this.editedCollection = configurable.PlatformNames;
this.editedCollection = configurable.ConfigurationNames;
}
InitList();
}

4
src/Main/SharpDevelop/Project/Configuration/SolutionConfigurationEditor.cs

@ -160,8 +160,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -160,8 +160,8 @@ namespace ICSharpCode.SharpDevelop.Project
IProject project = (IProject)row.Tag;
var newConfig = new ConfigurationAndPlatform(
row.Cells[configurationColumn.Index].ToString(),
row.Cells[platformColumn.Index].ToString());
row.Cells[configurationColumn.Index].Value.ToString(),
row.Cells[platformColumn.Index].Value.ToString());
project.ConfigurationMapping.SetProjectConfiguration(solutionConfig, newConfig);
}

7
src/Main/SharpDevelop/Project/Solution.cs

@ -130,10 +130,12 @@ namespace ICSharpCode.SharpDevelop.Project @@ -130,10 +130,12 @@ namespace ICSharpCode.SharpDevelop.Project
{
foreach (var project in addedItems) {
project.ProjectSections.CollectionChanged += solution.OnSolutionSectionCollectionChanged;
project.ConfigurationMapping.Changed += solution.OnProjectConfigurationMappingChanged;
solution.OnSolutionSectionCollectionChanged(EmptyList<SolutionSection>.Instance, project.ProjectSections);
}
foreach (var project in removedItems) {
project.ProjectSections.CollectionChanged -= solution.OnSolutionSectionCollectionChanged;
project.ConfigurationMapping.Changed -= solution.OnProjectConfigurationMappingChanged;
solution.OnSolutionSectionCollectionChanged(project.ProjectSections, EmptyList<SolutionSection>.Instance);
}
// If the startup project was removed, reset that property
@ -198,6 +200,11 @@ namespace ICSharpCode.SharpDevelop.Project @@ -198,6 +200,11 @@ namespace ICSharpCode.SharpDevelop.Project
get { return globalSections; }
}
void OnProjectConfigurationMappingChanged(object sender, EventArgs e)
{
this.IsDirty = true;
}
void OnSolutionSectionCollectionChanged(IReadOnlyCollection<SolutionSection> oldItems, IReadOnlyCollection<SolutionSection> newItems)
{
this.IsDirty = true;

Loading…
Cancel
Save