Browse Source

Upgrade to new AvalonDock version.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0wpf@3444 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
57b90f070b
  1. BIN
      src/Libraries/AvalonDock/AvalonDock.dll
  2. 64
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonDockLayout.cs

BIN
src/Libraries/AvalonDock/AvalonDock.dll

Binary file not shown.

64
src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonDockLayout.cs

@ -119,69 +119,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -119,69 +119,7 @@ namespace ICSharpCode.SharpDevelop.Gui
pad = new AvalonPadContent(this, content);
pads.Add(content, pad);
padsByClass.Add(content.Class, pad);
GetPane(AnchorStyle.Right).Items.Add(pad);
dockingManager.Show(pad, DockableContentState.Docked);
}
}
/// <summary>
/// Gets or creates a pane at the specified position.
/// </summary>
DockablePane GetPane(AnchorStyle 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 == AnchorStyle.Left || dockPosition == AnchorStyle.Right) {
rp.Orientation = Orientation.Horizontal;
} else {
rp.Orientation = Orientation.Vertical;
}
if (dockPosition == AnchorStyle.Left || dockPosition == AnchorStyle.Top) {
rp.Children.Add(pane);
rp.Children.Add(content);
} else {
rp.Children.Add(content);
rp.Children.Add(pane);
}
}
return pane;
}
/// <summary>
/// Detects the orientation of a DockablePane.
/// </summary>
static AnchorStyle? DetectDock(DockablePane pane)
{
ResizingPanel rp = pane.Parent as ResizingPanel;
if (rp != null) {
if (rp.Children[0] == pane) {
return rp.Orientation == Orientation.Vertical ? AnchorStyle.Top : AnchorStyle.Left;
} else if (rp.Children[rp.Children.Count - 1] == pane) {
return rp.Orientation == Orientation.Vertical ? AnchorStyle.Bottom : AnchorStyle.Right;
}
}
return null;
}
/// <summary>
/// Puts all DockablePanes into the list.
/// </summary>
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);
dockingManager.Show(pad, DockableContentState.Docked, AnchorStyle.Right);
}
}

Loading…
Cancel
Save