Browse Source

Fixed SD2-613: Renaming a solution generates a Not Implemented exception.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@949 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
7420da5fc4
  1. 4
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs
  2. 2
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/SolutionFolderNode.cs
  3. 38
      src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/SolutionNode.cs
  4. 3
      src/Main/Base/Project/Src/Project/Solution/Solution.cs

4
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs

@ -211,7 +211,9 @@ namespace ICSharpCode.FormsDesigner @@ -211,7 +211,9 @@ namespace ICSharpCode.FormsDesigner
void UnloadDesigner()
{
generator.Detach();
bool savedIsDirty = viewContent.IsDirty;
p.Controls.Clear();
viewContent.IsDirty = savedIsDirty;
// We cannot dispose the design surface now because of SD2-451:
// When the switch to the source view was triggered by a double-click on an event
// in the PropertyPad, "InvalidOperationException: The container cannot be disposed
@ -250,11 +252,13 @@ namespace ICSharpCode.FormsDesigner @@ -250,11 +252,13 @@ namespace ICSharpCode.FormsDesigner
failedDesignerInitialize = false;
LoadDesigner();
bool savedIsDirty = viewContent.IsDirty;
if (designSurface != null && p.Controls.Count == 0) {
Control designer = designSurface.View as Control;
designer.Dock = DockStyle.Fill;
p.Controls.Add(designer);
}
viewContent.IsDirty = savedIsDirty;
} catch (Exception e) {
failedDesignerInitialize = true;
TextBox errorText = new TextBox();

2
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/SolutionFolderNode.cs

@ -85,7 +85,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -85,7 +85,7 @@ namespace ICSharpCode.SharpDevelop.Project
public void AddItem(string fileName)
{
string relativeFileName = FileUtility.GetRelativePath(Path.GetDirectoryName(solution.FileName), fileName);
string relativeFileName = FileUtility.GetRelativePath(solution.Directory, fileName);
SolutionItem newItem = new SolutionItem(relativeFileName, relativeFileName);
folder.SolutionItems.Items.Add(newItem);
new SolutionItemNode(solution, newItem).AddTo(this);

38
src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/SolutionNode.cs

@ -46,19 +46,41 @@ namespace ICSharpCode.SharpDevelop.Project @@ -46,19 +46,41 @@ namespace ICSharpCode.SharpDevelop.Project
Tag = solution;
}
public override void BeforeLabelEdit()
{
Text = solution.Name;
}
public override void AfterLabelEdit(string newName)
{
try {
if (solution.Name == newName)
return;
if (!FileService.CheckFileName(newName))
return;
string newFileName = Path.Combine(solution.Directory, newName + ".sln");
if (File.Exists(newFileName)) {
MessageService.ShowError("The file " + newFileName + " already exists.");
return;
}
FileService.RenameFile(solution.FileName, newFileName, false);
solution.FileName = newFileName;
solution.Name = newName;
} finally {
Text = "Solution " + solution.Name;
}
}
public void AddItem(string fileName)
{
throw new NotImplementedException();
// string relativeFileName = FileUtility.GetRelativePath(Path.GetDirectoryName(solution.FileName), fileName);
// folder.SolutionItems.Items.Add(new SolutionItem(relativeFileName, relativeFileName));
// new FileNode(fileName, FileNodeStatus.InProject).AddTo(this);
//string relativeFileName = FileUtility.GetRelativePath(solution.Directory, fileName);
//SolutionItem newItem = new SolutionItem(relativeFileName, relativeFileName);
//this.Container.SolutionItems.Items.Add(newItem);
//new SolutionItemNode(solution, newItem).AddTo(this);
}
// protected override void Initialize()
// {
// base.Initialize();
// }
#region Drag & Drop
public override DragDropEffects GetDragDropEffect(IDataObject dataObject, DragDropEffects proposedEffect)
{

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

@ -142,6 +142,9 @@ namespace ICSharpCode.SharpDevelop.Project @@ -142,6 +142,9 @@ namespace ICSharpCode.SharpDevelop.Project
get {
return fileName;
}
set {
fileName = value;
}
}
public string Directory {

Loading…
Cancel
Save