Browse Source

Prevent disposing and recreating WorkbenchWindows on layout change. Fixes SD2-1003.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1771 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
c6885b51e2
  1. 3
      src/Main/Base/Project/Src/Gui/IWorkbenchWindow.cs
  2. 12
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/LayoutConfiguration.cs
  3. 7
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
  4. 6
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs
  5. 3
      src/Main/Base/Project/Src/Services/RefactoringService/FindReferencesAndRenameHelper.cs

3
src/Main/Base/Project/Src/Gui/IWorkbenchWindow.cs

@ -47,8 +47,9 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -47,8 +47,9 @@ namespace ICSharpCode.SharpDevelop.Gui
}
*/
/// <summary>
/// <summary>
/// The current view content which is shown inside this window.
/// This method is thread-safe.
/// </summary>
IBaseViewContent ActiveViewContent {
get;

12
src/Main/Base/Project/Src/Gui/Workbench/Layouts/LayoutConfiguration.cs

@ -198,11 +198,13 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -198,11 +198,13 @@ namespace ICSharpCode.SharpDevelop.Gui
w.Formatting = Formatting.Indented;
w.WriteStartElement("LayoutConfig");
foreach (LayoutConfiguration lc in Layouts) {
w.WriteStartElement("Layout");
w.WriteAttributeString("name", lc.name);
w.WriteAttributeString("file", lc.fileName);
w.WriteAttributeString("readonly", lc.readOnly.ToString());
w.WriteEndElement();
if (lc.custom) {
w.WriteStartElement("Layout");
w.WriteAttributeString("name", lc.name);
w.WriteAttributeString("file", lc.fileName);
w.WriteAttributeString("readonly", lc.readOnly.ToString());
w.WriteEndElement();
}
}
w.WriteEndElement();
}

7
src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs

@ -245,8 +245,8 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -245,8 +245,8 @@ namespace ICSharpCode.SharpDevelop.Gui
IViewContent activeView = GetActiveView();
dockPanel.ActiveDocumentChanged -= new EventHandler(ActiveMdiChanged);
DetachPadContents(true);
DetachViewContents(true);
DetachPadContents(false);
DetachViewContents(false);
dockPanel.ActiveDocumentChanged += new EventHandler(ActiveMdiChanged);
LoadLayoutConfiguration();
@ -448,7 +448,8 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -448,7 +448,8 @@ namespace ICSharpCode.SharpDevelop.Gui
}
if (!contentHash.ContainsKey(content.Class)) {
DockContent newContent = CreateContent(content);
newContent.Show(dockPanel);
// TODO: read the default dock state from the PadDescriptor
newContent.Show(dockPanel, DockState.Hidden);
} else {
contentHash[content.Class].Show();
}

6
src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs

@ -56,6 +56,10 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -56,6 +56,10 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
/// <summary>
/// The current view content which is shown inside this window.
/// This method is thread-safe.
/// </summary>
public IBaseViewContent ActiveViewContent {
get {
if (viewTabControl != null) {
@ -317,7 +321,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -317,7 +321,7 @@ namespace ICSharpCode.SharpDevelop.Gui
IBaseViewContent GetSubViewContent(int index)
{
if (index == 0)
if (index == 0 || content == null)
return content;
else
return content.SecondaryViewContents[index - 1];

3
src/Main/Base/Project/Src/Services/RefactoringService/FindReferencesAndRenameHelper.cs

@ -255,8 +255,7 @@ namespace ICSharpCode.SharpDevelop.Refactoring @@ -255,8 +255,7 @@ namespace ICSharpCode.SharpDevelop.Refactoring
List<IViewContent> modifiedContents = new List<IViewContent>();
List<Modification> modifications = new List<Modification>();
foreach (Reference r in list) {
FileService.OpenFile(r.FileName);
IViewContent viewContent = FileService.GetOpenFile(r.FileName).ViewContent;
IViewContent viewContent = FileService.OpenFile(r.FileName).ViewContent;
if (!modifiedContents.Contains(viewContent)) {
modifiedContents.Add(viewContent);
}

Loading…
Cancel
Save