|
|
|
@ -6,10 +6,13 @@
@@ -6,10 +6,13 @@
|
|
|
|
|
// </file>
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using System.IO; |
|
|
|
|
using System.Windows; |
|
|
|
|
using AvalonDock; |
|
|
|
|
using System.Windows.Controls; |
|
|
|
|
using System.Windows.Media.Imaging; |
|
|
|
|
|
|
|
|
|
using AvalonDock; |
|
|
|
|
using ICSharpCode.Core; |
|
|
|
|
|
|
|
|
|
namespace ICSharpCode.SharpDevelop.Gui |
|
|
|
@ -63,17 +66,69 @@ namespace ICSharpCode.SharpDevelop.Gui
@@ -63,17 +66,69 @@ namespace ICSharpCode.SharpDevelop.Gui
|
|
|
|
|
|
|
|
|
|
public void ShowPad(PadDescriptor content) |
|
|
|
|
{ |
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
AvalonPadContent pad = new AvalonPadContent(content); |
|
|
|
|
GetPane(Dock.Right).Items.Add(pad); |
|
|
|
|
dockingManager.Show(pad, DockableContentState.Docked); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DockablePane GetPane(Dock dockPosition) |
|
|
|
|
{ |
|
|
|
|
List<DockablePane> allPanes = new List<DockablePane>(); |
|
|
|
|
ListAllPanes(allPanes, dockingManager.Content); |
|
|
|
|
// try to find an existing pane
|
|
|
|
|
DockablePane pane = allPanes.Find(p => DetectDock(p) == dockPosition); |
|
|
|
|
if (pane == null) { |
|
|
|
|
// none found: create a new pane
|
|
|
|
|
pane = new DockablePane(); |
|
|
|
|
UIElement content = (UIElement)dockingManager.Content; |
|
|
|
|
ResizingPanel rp = new ResizingPanel(); |
|
|
|
|
dockingManager.Content = rp; |
|
|
|
|
if (dockPosition == Dock.Left || dockPosition == Dock.Right) { |
|
|
|
|
rp.Orientation = Orientation.Horizontal; |
|
|
|
|
} else { |
|
|
|
|
rp.Orientation = Orientation.Vertical; |
|
|
|
|
} |
|
|
|
|
if (dockPosition == Dock.Left || dockPosition == Dock.Top) { |
|
|
|
|
rp.Children.Add(pane); |
|
|
|
|
rp.Children.Add(content); |
|
|
|
|
} else { |
|
|
|
|
rp.Children.Add(content); |
|
|
|
|
rp.Children.Add(pane); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return pane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static Dock? DetectDock(DockablePane pane) |
|
|
|
|
{ |
|
|
|
|
ResizingPanel rp = pane.Parent as ResizingPanel; |
|
|
|
|
if (rp != null) { |
|
|
|
|
if (rp.Children[0] == pane) { |
|
|
|
|
return rp.Orientation == Orientation.Vertical ? Dock.Top : Dock.Left; |
|
|
|
|
} else if (rp.Children[rp.Children.Count - 1] == pane) { |
|
|
|
|
return rp.Orientation == Orientation.Vertical ? Dock.Bottom : Dock.Right; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void ListAllPanes(List<DockablePane> list, object content) |
|
|
|
|
{ |
|
|
|
|
if (content is DockablePane) { |
|
|
|
|
list.Add((DockablePane)content); |
|
|
|
|
} else if (content is ResizingPanel) { |
|
|
|
|
ResizingPanel rp = (ResizingPanel)content; |
|
|
|
|
foreach (object o in rp.Children) |
|
|
|
|
ListAllPanes(list, o); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void ActivatePad(PadDescriptor content) |
|
|
|
|
{ |
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void ActivatePad(string fullyQualifiedTypeName) |
|
|
|
|
{ |
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void HidePad(PadDescriptor content) |
|
|
|
@ -88,7 +143,7 @@ namespace ICSharpCode.SharpDevelop.Gui
@@ -88,7 +143,7 @@ namespace ICSharpCode.SharpDevelop.Gui
|
|
|
|
|
|
|
|
|
|
public bool IsVisible(PadDescriptor padContent) |
|
|
|
|
{ |
|
|
|
|
throw new NotImplementedException(); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void RedrawAllComponents() |
|
|
|
@ -106,6 +161,7 @@ namespace ICSharpCode.SharpDevelop.Gui
@@ -106,6 +161,7 @@ namespace ICSharpCode.SharpDevelop.Gui
|
|
|
|
|
|
|
|
|
|
public void LoadConfiguration() |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
try { |
|
|
|
|
if (File.Exists(LayoutConfiguration.CurrentLayoutFileName)) { |
|
|
|
|
dockingManager.RestoreLayout(LayoutConfiguration.CurrentLayoutFileName); |
|
|
|
|