From ba9bc1ba9c2f321ab5fc967c3a2597fa21e1ae77 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Mon, 31 May 2010 16:14:33 +0000 Subject: [PATCH] Remove AvalonDock 1.2 (prepare for update to 1.3) git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5878 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- src/Libraries/AvalonDock/AlignedImage.cs | 190 - src/Libraries/AvalonDock/AvalonDock.csproj | 256 -- src/Libraries/AvalonDock/AvalonDock.snk | Bin 596 -> 0 bytes src/Libraries/AvalonDock/AvalonDockBrushes.cs | 116 - src/Libraries/AvalonDock/ColorFactory.cs | 261 -- .../AvalonDock/ContextMenuElement.cs | 53 - src/Libraries/AvalonDock/Converters.cs | 99 - .../DeserializationCallbackEventArgs.cs | 25 - src/Libraries/AvalonDock/DockableContent.cs | 581 --- .../AvalonDock/DockableFloatingWindow.cs | 279 -- src/Libraries/AvalonDock/DockablePane.cs | 501 --- .../AvalonDock/DockablePaneAnchorTab.cs | 117 - .../AvalonDock/DockablePaneAnchorTabGroup.cs | 64 - src/Libraries/AvalonDock/DockableTabPanel.cs | 113 - src/Libraries/AvalonDock/DockingManager.cs | 3243 ----------------- src/Libraries/AvalonDock/DocumentContent.cs | 298 -- .../AvalonDock/DocumentFloatingWindow.cs | 357 -- src/Libraries/AvalonDock/DocumentNavigator.cs | 252 -- src/Libraries/AvalonDock/DocumentPane.cs | 520 --- .../AvalonDock/DocumentPaneResizingPanel.cs | 55 - src/Libraries/AvalonDock/DocumentTabPanel.cs | 105 - .../AvalonDock/DrWPF/ConceptualPanel.cs | 120 - .../DrWPF/DisconnectedUIElementCollection.cs | 367 -- .../AvalonDock/DrWPF/LogicalPanel.cs | 78 - src/Libraries/AvalonDock/DragPaneServices.cs | 177 - .../AvalonDock/FloatingDockablePane.cs | 68 - src/Libraries/AvalonDock/FloatingWindow.cs | 502 --- .../AvalonDock/FlyoutDockablePane.cs | 113 - src/Libraries/AvalonDock/FlyoutPaneWindow.cs | 923 ----- .../AvalonDock/GreyableImage/GreyableImage.cs | 121 - src/Libraries/AvalonDock/HelperFunc.cs | 206 -- src/Libraries/AvalonDock/IDockableControl.cs | 36 - src/Libraries/AvalonDock/IDropSurface.cs | 72 - src/Libraries/AvalonDock/ManagedContent.cs | 534 --- src/Libraries/AvalonDock/NavigatorWindow.cs | 358 -- src/Libraries/AvalonDock/OverlayWindow.cs | 383 -- .../AvalonDock/OverlayWindowAnchorButton.cs | 125 - src/Libraries/AvalonDock/Pane.cs | 300 -- src/Libraries/AvalonDock/PaneTabPanel.cs | 77 - .../AvalonDock/Properties/AssemblyInfo.cs | 62 - .../Properties/Resources.Designer.cs | 63 - .../AvalonDock/Properties/Resources.resx | 117 - .../Properties/Settings.Designer.cs | 26 - .../AvalonDock/Properties/Settings.settings | 7 - .../RequestDocumentCloseEventArgs.cs | 21 - src/Libraries/AvalonDock/ResizingPanel.cs | 1307 ------- .../AvalonDock/ResizingPanelSplitter.cs | 75 - .../AvalonDock/Resources/Brushes.xaml | 116 - .../AvalonDock/Resources/Common.xaml | 95 - .../Resources/DockablePaneStyles.xaml | 255 -- .../Resources/DockingManagerStyles.xaml | 147 - .../DocumentNavigatorWindowStyle.xaml | 131 - .../Resources/DocumentPaneStyles.xaml | 267 -- .../Resources/FloatingWindowStyle.xaml | 111 - .../Resources/ManagedContentStyle.xaml | 32 - .../Resources/NavigatorWindowStyle.xaml | 145 - .../Resources/OverlayWindowStyle.xaml | 58 - .../Resources/images/Aero/AeroDockBottom.png | Bin 699 -> 0 bytes .../images/Aero/AeroDockBottomHover.png | Bin 1260 -> 0 bytes .../Resources/images/Aero/AeroDockLeft.png | Bin 747 -> 0 bytes .../images/Aero/AeroDockLeftHover.png | Bin 1198 -> 0 bytes .../Resources/images/Aero/AeroDockPane.png | Bin 3624 -> 0 bytes .../images/Aero/AeroDockPaneBottom.png | Bin 4356 -> 0 bytes .../images/Aero/AeroDockPaneInto.png | Bin 4277 -> 0 bytes .../images/Aero/AeroDockPaneLeft.png | Bin 4244 -> 0 bytes .../images/Aero/AeroDockPaneRight.png | Bin 4174 -> 0 bytes .../Resources/images/Aero/AeroDockPaneTop.png | Bin 4353 -> 0 bytes .../Resources/images/Aero/AeroDockRight.png | Bin 755 -> 0 bytes .../images/Aero/AeroDockRightHover.png | Bin 1183 -> 0 bytes .../Resources/images/Aero/AeroDockTop.png | Bin 712 -> 0 bytes .../images/Aero/AeroDockTopHover.png | Bin 1281 -> 0 bytes .../Resources/images/Classic/PinAutoHide.png | Bin 2855 -> 0 bytes .../images/Classic/PinAutoHideSelected.png | Bin 2838 -> 0 bytes .../Resources/images/Classic/PinClose.png | Bin 2865 -> 0 bytes .../images/Classic/PinCloseSelected.png | Bin 2856 -> 0 bytes .../Resources/images/Classic/PinMenu.png | Bin 2856 -> 0 bytes .../images/Classic/PinMenuSelected.png | Bin 2839 -> 0 bytes .../Resources/images/DockBottom.PNG | Bin 701 -> 0 bytes .../AvalonDock/Resources/images/DockLeft.PNG | Bin 697 -> 0 bytes .../AvalonDock/Resources/images/DockPane.PNG | Bin 2790 -> 0 bytes .../AvalonDock/Resources/images/DockRight.PNG | Bin 691 -> 0 bytes .../AvalonDock/Resources/images/DockTop.PNG | Bin 719 -> 0 bytes .../AvalonDock/Resources/images/HTabGroup.png | Bin 358 -> 0 bytes .../AvalonDock/Resources/images/Locked.png | Bin 357 -> 0 bytes .../Resources/images/PinAutoHide.png | Bin 99 -> 0 bytes .../AvalonDock/Resources/images/PinClose.png | Bin 108 -> 0 bytes .../Resources/images/PinDocMenu.png | Bin 99 -> 0 bytes .../AvalonDock/Resources/images/PinMenu.png | Bin 99 -> 0 bytes .../AvalonDock/Resources/images/VTabGroup.png | Bin 403 -> 0 bytes .../AvalonDock/WindowInteropWrapper.cs | 146 - src/Libraries/AvalonDock/WpfApplication.cs | 96 - src/Libraries/AvalonDock/doc/AvalonDock.shfb | 46 - .../themes/aero.normalcolor.brushes.xaml | 154 - .../AvalonDock/themes/aero.normalcolor.xaml | 621 ---- .../AvalonDock/themes/classic.brushes.xaml | 100 - src/Libraries/AvalonDock/themes/classic.xaml | 548 --- src/Libraries/AvalonDock/themes/classic2.xaml | 548 --- src/Libraries/AvalonDock/themes/generic.xaml | 18 - .../AvalonDock/themes/luna.normalcolor.xaml | 18 - 99 files changed, 17375 deletions(-) delete mode 100644 src/Libraries/AvalonDock/AlignedImage.cs delete mode 100644 src/Libraries/AvalonDock/AvalonDock.csproj delete mode 100644 src/Libraries/AvalonDock/AvalonDock.snk delete mode 100644 src/Libraries/AvalonDock/AvalonDockBrushes.cs delete mode 100644 src/Libraries/AvalonDock/ColorFactory.cs delete mode 100644 src/Libraries/AvalonDock/ContextMenuElement.cs delete mode 100644 src/Libraries/AvalonDock/Converters.cs delete mode 100644 src/Libraries/AvalonDock/DeserializationCallbackEventArgs.cs delete mode 100644 src/Libraries/AvalonDock/DockableContent.cs delete mode 100644 src/Libraries/AvalonDock/DockableFloatingWindow.cs delete mode 100644 src/Libraries/AvalonDock/DockablePane.cs delete mode 100644 src/Libraries/AvalonDock/DockablePaneAnchorTab.cs delete mode 100644 src/Libraries/AvalonDock/DockablePaneAnchorTabGroup.cs delete mode 100644 src/Libraries/AvalonDock/DockableTabPanel.cs delete mode 100644 src/Libraries/AvalonDock/DockingManager.cs delete mode 100644 src/Libraries/AvalonDock/DocumentContent.cs delete mode 100644 src/Libraries/AvalonDock/DocumentFloatingWindow.cs delete mode 100644 src/Libraries/AvalonDock/DocumentNavigator.cs delete mode 100644 src/Libraries/AvalonDock/DocumentPane.cs delete mode 100644 src/Libraries/AvalonDock/DocumentPaneResizingPanel.cs delete mode 100644 src/Libraries/AvalonDock/DocumentTabPanel.cs delete mode 100644 src/Libraries/AvalonDock/DrWPF/ConceptualPanel.cs delete mode 100644 src/Libraries/AvalonDock/DrWPF/DisconnectedUIElementCollection.cs delete mode 100644 src/Libraries/AvalonDock/DrWPF/LogicalPanel.cs delete mode 100644 src/Libraries/AvalonDock/DragPaneServices.cs delete mode 100644 src/Libraries/AvalonDock/FloatingDockablePane.cs delete mode 100644 src/Libraries/AvalonDock/FloatingWindow.cs delete mode 100644 src/Libraries/AvalonDock/FlyoutDockablePane.cs delete mode 100644 src/Libraries/AvalonDock/FlyoutPaneWindow.cs delete mode 100644 src/Libraries/AvalonDock/GreyableImage/GreyableImage.cs delete mode 100644 src/Libraries/AvalonDock/HelperFunc.cs delete mode 100644 src/Libraries/AvalonDock/IDockableControl.cs delete mode 100644 src/Libraries/AvalonDock/IDropSurface.cs delete mode 100644 src/Libraries/AvalonDock/ManagedContent.cs delete mode 100644 src/Libraries/AvalonDock/NavigatorWindow.cs delete mode 100644 src/Libraries/AvalonDock/OverlayWindow.cs delete mode 100644 src/Libraries/AvalonDock/OverlayWindowAnchorButton.cs delete mode 100644 src/Libraries/AvalonDock/Pane.cs delete mode 100644 src/Libraries/AvalonDock/PaneTabPanel.cs delete mode 100644 src/Libraries/AvalonDock/Properties/AssemblyInfo.cs delete mode 100644 src/Libraries/AvalonDock/Properties/Resources.Designer.cs delete mode 100644 src/Libraries/AvalonDock/Properties/Resources.resx delete mode 100644 src/Libraries/AvalonDock/Properties/Settings.Designer.cs delete mode 100644 src/Libraries/AvalonDock/Properties/Settings.settings delete mode 100644 src/Libraries/AvalonDock/RequestDocumentCloseEventArgs.cs delete mode 100644 src/Libraries/AvalonDock/ResizingPanel.cs delete mode 100644 src/Libraries/AvalonDock/ResizingPanelSplitter.cs delete mode 100644 src/Libraries/AvalonDock/Resources/Brushes.xaml delete mode 100644 src/Libraries/AvalonDock/Resources/Common.xaml delete mode 100644 src/Libraries/AvalonDock/Resources/DockablePaneStyles.xaml delete mode 100644 src/Libraries/AvalonDock/Resources/DockingManagerStyles.xaml delete mode 100644 src/Libraries/AvalonDock/Resources/DocumentNavigatorWindowStyle.xaml delete mode 100644 src/Libraries/AvalonDock/Resources/DocumentPaneStyles.xaml delete mode 100644 src/Libraries/AvalonDock/Resources/FloatingWindowStyle.xaml delete mode 100644 src/Libraries/AvalonDock/Resources/ManagedContentStyle.xaml delete mode 100644 src/Libraries/AvalonDock/Resources/NavigatorWindowStyle.xaml delete mode 100644 src/Libraries/AvalonDock/Resources/OverlayWindowStyle.xaml delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockBottom.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockBottomHover.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockLeft.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockLeftHover.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockPane.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockPaneBottom.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockPaneInto.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockPaneLeft.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockPaneRight.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockPaneTop.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockRight.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockRightHover.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockTop.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Aero/AeroDockTopHover.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Classic/PinAutoHide.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Classic/PinAutoHideSelected.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Classic/PinClose.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Classic/PinCloseSelected.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Classic/PinMenu.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Classic/PinMenuSelected.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/DockBottom.PNG delete mode 100644 src/Libraries/AvalonDock/Resources/images/DockLeft.PNG delete mode 100644 src/Libraries/AvalonDock/Resources/images/DockPane.PNG delete mode 100644 src/Libraries/AvalonDock/Resources/images/DockRight.PNG delete mode 100644 src/Libraries/AvalonDock/Resources/images/DockTop.PNG delete mode 100644 src/Libraries/AvalonDock/Resources/images/HTabGroup.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/Locked.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/PinAutoHide.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/PinClose.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/PinDocMenu.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/PinMenu.png delete mode 100644 src/Libraries/AvalonDock/Resources/images/VTabGroup.png delete mode 100644 src/Libraries/AvalonDock/WindowInteropWrapper.cs delete mode 100644 src/Libraries/AvalonDock/WpfApplication.cs delete mode 100644 src/Libraries/AvalonDock/doc/AvalonDock.shfb delete mode 100644 src/Libraries/AvalonDock/themes/aero.normalcolor.brushes.xaml delete mode 100644 src/Libraries/AvalonDock/themes/aero.normalcolor.xaml delete mode 100644 src/Libraries/AvalonDock/themes/classic.brushes.xaml delete mode 100644 src/Libraries/AvalonDock/themes/classic.xaml delete mode 100644 src/Libraries/AvalonDock/themes/classic2.xaml delete mode 100644 src/Libraries/AvalonDock/themes/generic.xaml delete mode 100644 src/Libraries/AvalonDock/themes/luna.normalcolor.xaml diff --git a/src/Libraries/AvalonDock/AlignedImage.cs b/src/Libraries/AvalonDock/AlignedImage.cs deleted file mode 100644 index a41303b2d9..0000000000 --- a/src/Libraries/AvalonDock/AlignedImage.cs +++ /dev/null @@ -1,190 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows.Controls; -using System.Windows; -using System.Windows.Media; - -namespace AvalonDock -{ - public class AlignedImage : Decorator - { - /* - * Disabled because we use WPF 4.0 layout rounding instead. - public AlignedImage() - { - this.LayoutUpdated += new EventHandler(OnLayoutUpdated); - } - - - protected override System.Windows.Size MeasureOverride(Size constraint) - { - Size desideredSize = new Size(); - - if (Child != null) - { - Child.Measure(constraint); - - PresentationSource ps = PresentationSource.FromVisual(this); - if (ps != null) - { - Matrix fromDevice = ps.CompositionTarget.TransformFromDevice; - - Vector pixelSize = new Vector(Child.DesiredSize.Width, Child.DesiredSize.Height); - Vector measureSizeV = fromDevice.Transform(pixelSize); - desideredSize = new Size(measureSizeV.X, measureSizeV.Y); - } - } - - return desideredSize; - } - - protected override Size ArrangeOverride(Size arrangeBounds) - { - Size finalSize = new Size(); - - if (Child != null) - { - _pixelOffset = GetPixelOffset(); - Child.Arrange(new Rect(_pixelOffset, Child.DesiredSize)); - finalSize = arrangeBounds; - } - - return finalSize; - } - - private Point _pixelOffset; - - private void OnLayoutUpdated(object sender, EventArgs e) - { - // This event just means that layout happened somewhere. However, this is - // what we need since layout anywhere could affect our pixel positioning. - Point pixelOffset = GetPixelOffset(); - if (!AreClose(pixelOffset, _pixelOffset)) - { - InvalidateArrange(); - } - } - - // Gets the matrix that will convert a point from "above" the - // coordinate space of a visual into the the coordinate space - // "below" the visual. - private Matrix GetVisualTransform(Visual v) - { - if (v != null) - { - Matrix m = Matrix.Identity; - - Transform transform = VisualTreeHelper.GetTransform(v); - if (transform != null) - { - Matrix cm = transform.Value; - m = Matrix.Multiply(m, cm); - } - - Vector offset = VisualTreeHelper.GetOffset(v); - m.Translate(offset.X, offset.Y); - - return m; - } - - return Matrix.Identity; - } - - private Point TryApplyVisualTransform(Point point, Visual v, bool inverse, bool throwOnError, out bool success) - { - success = true; - if (v != null) - { - Matrix visualTransform = GetVisualTransform(v); - if (inverse) - { - if (!throwOnError && !visualTransform.HasInverse) - { - success = false; - return new Point(0, 0); - } - visualTransform.Invert(); - } - point = visualTransform.Transform(point); - } - return point; - } - - private Point ApplyVisualTransform(Point point, Visual v, bool inverse) - { - bool success = true; - return TryApplyVisualTransform(point, v, inverse, true, out success); - } - - private Point GetPixelOffset() - { - Point pixelOffset = new Point(); - - PresentationSource ps = PresentationSource.FromVisual(this); - if (ps != null) - { - Visual rootVisual = ps.RootVisual; - - // Transform (0,0) from this element up to pixels. - pixelOffset = this.TransformToAncestor(rootVisual).Transform(pixelOffset); - pixelOffset = ApplyVisualTransform(pixelOffset, rootVisual, false); - pixelOffset = ps.CompositionTarget.TransformToDevice.Transform(pixelOffset); - - // Round the origin to the nearest whole pixel. - pixelOffset.X = Math.Round(pixelOffset.X); - pixelOffset.Y = Math.Round(pixelOffset.Y); - - // Transform the whole-pixel back to this element. - pixelOffset = ps.CompositionTarget.TransformFromDevice.Transform(pixelOffset); - pixelOffset = ApplyVisualTransform(pixelOffset, rootVisual, true); - pixelOffset = rootVisual.TransformToDescendant(this).Transform(pixelOffset); - } - - return pixelOffset; - } - - private bool AreClose(Point point1, Point point2) - { - return AreClose(point1.X, point2.X) && AreClose(point1.Y, point2.Y); - } - - private bool AreClose(double value1, double value2) - { - if (value1 == value2) - { - return true; - } - double delta = value1 - value2; - return ((delta < 1.53E-06) && (delta > -1.53E-06)); - } - */ - } -} diff --git a/src/Libraries/AvalonDock/AvalonDock.csproj b/src/Libraries/AvalonDock/AvalonDock.csproj deleted file mode 100644 index 728cea778f..0000000000 --- a/src/Libraries/AvalonDock/AvalonDock.csproj +++ /dev/null @@ -1,256 +0,0 @@ - - - Debug - AnyCPU - {2FF700C2-A38A-48BD-A637-8CAFD4FE6237} - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - AvalonDock - AvalonDock - 4 - library - 1.0.0.* - - 3.0 - v4.0 - - - 2.0 - - - true - AvalonDock.snk - C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis - ..\..\..\bin\ - False - False - False - - - true - Full - false - DEBUG;TRACE - - - false - true - TRACE - None - - - False - - - False - Auto - 4194304 - AnyCPU - 4096 - - - - - 3.5 - - - - - 3.0 - - - 3.0 - - - 3.0 - - - 3.0 - - - - - 3.0 - - - 4.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ResXFileCodeGenerator - Designer - Resources.Designer.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - True - Resources.resx - - - True - True - Settings.settings - - - - - - - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/AvalonDock.snk b/src/Libraries/AvalonDock/AvalonDock.snk deleted file mode 100644 index 41474c43ec736c0c85e7aa8444bc52e9798e19b1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50097{c@UKJS|QT+U99gfWom!k3-wjeYN16) zQ3$`qu1YajjXV5uf$z=A9@yFUMj1Wv!vD zYO8KmM(0G{oF=kutBwmym=+xvqa;P8RzIYAfSjj*hRH^>inQm|h=SP>zf&v9NL#Y; zV&fZ1vCt;94ONgunvOCB2=LbT4!_!dr4?ZarP&^e2o`bt4YR< z)!Lof|I?49f4dNSvCY2vT@%ymI4ae_zckw)7}(&6zzuKJ(1u%Tj7)mCdPqNFoD*P} zk{Ux%>HUI3ua_nS_nbg6am=iu1iHBzJZ6BbT_eaLVh_B9Tk2Q>6a}h9ZFwDmW%W#cGfYH+Xzz40{|afjJ|N)&@DPb45wiDFg$_1yha;5 zS*o>Jhzn!<|EtkQZ1M27jNtm6j;M56;~)H82Vz>fD7r i5BQ(A-6}ibT>C>%aiP}sg4H=Myl(kz>uWG*uTDBq)FpiY diff --git a/src/Libraries/AvalonDock/AvalonDockBrushes.cs b/src/Libraries/AvalonDock/AvalonDockBrushes.cs deleted file mode 100644 index 20938b4fd0..0000000000 --- a/src/Libraries/AvalonDock/AvalonDockBrushes.cs +++ /dev/null @@ -1,116 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace AvalonDock -{ - /// - /// Defines a list of brushes used by AvalonDock templates - /// - public enum AvalonDockBrushes - { - /// - /// Default brush for DockingManager background - /// - DefaultBackgroundBrush, - - /// - /// Brush used for the title background of a . - /// - DockablePaneTitleBackground, - - /// - /// Brush used for the title background of a when is focused. - /// - DockablePaneTitleBackgroundSelected, - - /// - /// Brush used for the title foreground of a . - /// - DockablePaneTitleForeground, - - /// - /// Brush used for the title foreground of a when is focused. - /// - DockablePaneTitleForegroundSelected, - - /// - /// Brush used for the background of the pane command pins. - /// - PaneHeaderCommandBackground, - - /// - /// Brush used for the border of the pane command pins. - /// - PaneHeaderCommandBorderBrush, - - /// - /// Brush used for the background of a document header. - /// - DocumentHeaderBackground, - - /// - /// Brush used for the foreground of a document header. - /// - DocumentHeaderForeground, - - /// - /// Brush used for the background of a document header when active (). - /// - DocumentHeaderBackgroundSelected, - - /// - /// Brush used for the background of a document header when mouse is over it. - /// - DocumentHeaderBackgroundMouseOver, - - - DocumentHeaderBorder, - - DocumentHeaderBorder2, - - NavigatorWindowTopBackground, - - NavigatorWindowTitleForeground, - - NavigatorWindowDocumentTypeForeground, - - NavigatorWindowInfoTipForeground, - - NavigatorWindowForeground, - - NavigatorWindowBackground, - - NavigatorWindowSelectionBackground, - - NavigatorWindowSelectionBorderbrush, - - NavigatorWindowBottomBackground, - } -} diff --git a/src/Libraries/AvalonDock/ColorFactory.cs b/src/Libraries/AvalonDock/ColorFactory.cs deleted file mode 100644 index bac0381de5..0000000000 --- a/src/Libraries/AvalonDock/ColorFactory.cs +++ /dev/null @@ -1,261 +0,0 @@ -//Copyright (c) 2009, Juergen Schildmann -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -using System; -using System.IO; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Media; - -namespace AvalonDock -{ - /// - /// Is used for color-support to change the colors depending on a base theme. - /// - public sealed class ColorFactory - { - /// Change the theme to one from AvalonDock. - /// - /// for example: "aero.normalcolor" (default style) - public static void ChangeTheme(string theme) - { - ResourceDictionary rd = new ResourceDictionary(); - rd.Source = new Uri("/AvalonDock;component/themes/" + theme + ".xaml", UriKind.RelativeOrAbsolute); - - // first search and remove old one - ResetColors(); - - Application.Current.Resources.MergedDictionaries.Add(rd); - } - - /// - /// Change the colors based on the aero-theme from AvalonDock. - /// - /// Example: ChangeColors(Colors.DarkGreen) - /// - /// - /// the new Color - public static void ChangeColors(Color color) - { - ChangeColors("aero.normalcolor", color); - } - - /// - /// Change the colors based on a theme-name from AvalonDock. - /// - /// Example: ChangeColors("classic", Colors.DarkGreen) - /// - /// - /// the string of the base theme we want to change - /// the new Color - public static void ChangeColors(string baseTheme, Color color) - { - ResourceDictionary rd = new ResourceDictionary(); - rd.Source = new Uri("/AvalonDock;component/themes/" + baseTheme + ".xaml", UriKind.RelativeOrAbsolute); - - ChangeKeysInResourceDictionary(rd, color); - foreach (ResourceDictionary rd2 in rd.MergedDictionaries) - { - ChangeKeysInResourceDictionary(rd2, color); - } - - //ResourceDictionary parent = Application.Current.Resources; - // first search and remove old one - //foreach (ResourceDictionary res in Application.Current.Resources.MergedDictionaries) - //{ - // string source = res.Source.ToString(); - // if (source.Contains("/AvalonDock;component/themes/")) - // { - // Application.Current.Resources.MergedDictionaries.Remove(res); - // break; - // } - //} - ResetColors(); - - Application.Current.Resources.MergedDictionaries.Add(rd); - } - - /// - /// Reset custom colors to theme defaults - /// - public static void ResetColors() - { -//- foreach (ResourceDictionary res in Application.Current.Resources.MergedDictionaries) - ResourceDictionary res = GetActualResourceDictionary(); - if (res != null) - Application.Current.Resources.MergedDictionaries.Remove(res); - } - - /// - /// Change a specified brush inside the actual theme. - /// Look at AvalonDockBrushes.cs for possible values. - /// - /// an AvalonDockBrushes value - /// The new brush. It can be every brush type that is derived from Brush-class. - public static void ChangeBrush(AvalonDockBrushes brushName, Brush brush) - { - ChangeBrush(brushName.ToString(), brush); - } - - /// - /// Change a specified brush inside the actual theme. - /// - /// a brush name - /// The new brush. It can be every brush type that is derived from Brush-class. - public static void ChangeBrush(string brushName, Brush brush) - { - // get the actual ResourceDictionary - ResourceDictionary rd = GetActualResourceDictionary(); - if (rd == null) - { -//- string source = res.Source.ToString(); -//- if (source.Contains("/AvalonDock;component/themes/")) - ChangeTheme("aero.normalcolor"); - rd = GetActualResourceDictionary(); - } - - if (rd != null) - { - foreach (ResourceDictionary rd2 in rd.MergedDictionaries) - { -//- Application.Current.Resources.MergedDictionaries.Remove(res); -//- break; - foreach (object key in rd2.Keys) - { - object item = rd2[key]; - string keyTypeName = key.GetType().Name; - - string str = ""; - switch (keyTypeName) - { - case "ComponentResourceKey": - str = ((ComponentResourceKey)key).ResourceId.ToString(); - break; - case "String": - str = (string)key; - break; - } - if (str == brushName) - { - rd[key] = brush; - return; - } - } - } - } - } - - - // { - // string source = res.Source.ToString(); - // if (source.Contains("/AvalonDock;component/themes/")) - // { - // Application.Current.Resources.MergedDictionaries.Remove(res); - // break; - // } - // } - //} - - - /// - /// Searches for keys in the ResourceDictionary for brushes and changes the color-values - /// - /// the ResourceDictionary - /// the new Color - static void ChangeKeysInResourceDictionary(ResourceDictionary rd, Color color) - { - foreach (object key in rd.Keys) - { - object item = rd[key]; - - if (item is SolidColorBrush) - { - SolidColorBrush sb = item as SolidColorBrush; - sb.Color = GetColor(sb.Color, color); - } - else if (item is LinearGradientBrush) - { - LinearGradientBrush lg = item as LinearGradientBrush; - foreach (GradientStop gs in lg.GradientStops) - { - gs.Color = GetColor(gs.Color, color); - } - } - else if (item is RadialGradientBrush) - { - RadialGradientBrush rb = item as RadialGradientBrush; - foreach (GradientStop gs in rb.GradientStops) - { - gs.Color = GetColor(gs.Color, color); - } - } - } - } - - static ResourceDictionary GetActualResourceDictionary() - { - // get the actual ResourceDictionary - foreach (ResourceDictionary res in Application.Current.Resources.MergedDictionaries) - { - if (res.Source != null) - { - string source = res.Source.ToString(); - if (source.Contains("/AvalonDock;component/themes/")) - { - return res; - } - } - } - return null; - } - - static Color GetColor(Color c, Color newCol) - { - if (c.A == 0) return c; - - // get brightness for RGB values - byte brighness = (byte)(c.R * 0.2126 + c.G * 0.7152 + c.B * 0.0722); - - return Color.FromArgb(c.A, - GetSmoothColor(brighness, newCol.R), - GetSmoothColor(brighness, newCol.G), - GetSmoothColor(brighness, newCol.B)); - } - - static byte GetSmoothColor(int a, int b) - { - int c = a * b / 255; - return (byte)(c + a * (255 - ((255 - a) * (255 - b) / 255) - c) / 255); - } - - static Color GetSmoothColor(Color c, Color light) - { - return Color.FromArgb(c.A, GetSmoothColor(c.R, light.R), GetSmoothColor(c.G, light.G), GetSmoothColor(c.B, light.B)); - } - } -} diff --git a/src/Libraries/AvalonDock/ContextMenuElement.cs b/src/Libraries/AvalonDock/ContextMenuElement.cs deleted file mode 100644 index 8644d57305..0000000000 --- a/src/Libraries/AvalonDock/ContextMenuElement.cs +++ /dev/null @@ -1,53 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; - -namespace AvalonDock -{ - /// - /// Defines a list of context menu resources - /// - public enum ContextMenuElement - { - /// - /// Context menu related to a - /// - DockablePane, - - /// - /// Context menu related to a - /// - DocumentPane, - - /// - /// Context menu related to a - /// - FloatingWindow, - - } -} diff --git a/src/Libraries/AvalonDock/Converters.cs b/src/Libraries/AvalonDock/Converters.cs deleted file mode 100644 index 8f9e498234..0000000000 --- a/src/Libraries/AvalonDock/Converters.cs +++ /dev/null @@ -1,99 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Data; -using System.IO; -using System.Reflection; -using System.Windows.Media; -using System.Windows; - -namespace AvalonDock -{ - public class FindResourcePathConverter : IValueConverter - { - - #region IValueConverter Members - - public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - if (value == null) - { - return null; - //return new Uri(@"DocumentHS.png", UriKind.Relative); - } - - return value; - } - - public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - throw new NotImplementedException(); - } - - #endregion - } - - /// - /// Converter from boolean values to visibility (inverse mode) - /// - [ValueConversion(typeof(object), typeof(Visibility))] - public class BoolToVisibilityConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, - System.Globalization.CultureInfo culture) - { - return System.Convert.ToBoolean(value) ? Visibility.Visible : - (parameter != null && ((string)parameter) == "Hidden" ? Visibility.Hidden : Visibility.Collapsed); - } - - public object ConvertBack(object value, Type targetType, object parameter, - System.Globalization.CultureInfo culture) - { - return null; - } - } - - - public static class Converters - { - static BoolToVisibilityConverter _BoolToVisibilityConverter = null; - - public static BoolToVisibilityConverter BoolToVisibilityConverter - { - get - { - if (_BoolToVisibilityConverter == null) - _BoolToVisibilityConverter = new BoolToVisibilityConverter(); - - - return _BoolToVisibilityConverter; - } - } - - } -} diff --git a/src/Libraries/AvalonDock/DeserializationCallbackEventArgs.cs b/src/Libraries/AvalonDock/DeserializationCallbackEventArgs.cs deleted file mode 100644 index cc8acf2248..0000000000 --- a/src/Libraries/AvalonDock/DeserializationCallbackEventArgs.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace AvalonDock -{ - public class DeserializationCallbackEventArgs : EventArgs - { - public DeserializationCallbackEventArgs(string contentName) - { - Name = contentName; - } - - /// - /// Gets the name of the content to deserialize - /// - public string Name { get; protected set; } - - /// - /// Gets/Sets the content manually deserialized - /// - public DockableContent Content { get; set; } - } -} diff --git a/src/Libraries/AvalonDock/DockableContent.cs b/src/Libraries/AvalonDock/DockableContent.cs deleted file mode 100644 index ee17967fc6..0000000000 --- a/src/Libraries/AvalonDock/DockableContent.cs +++ /dev/null @@ -1,581 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.Diagnostics; -using System.Xml; - -namespace AvalonDock -{ - /// - /// Enumerates all the possible states of - /// - public enum DockableContentState - { - /// - /// Content is docked to a border of a within as control - /// - Docked, - - /// - /// Content is hosted by a flyout window and is visible only when user move mouse over an anchor thumb located to a controlo border - /// - AutoHide, - - /// - /// Content is hosted by a floating window and user can redock is on its container control - /// - DockableWindow, - - /// - /// Content is hosted by a floating window that can't be docked to a its container control - /// - FloatingWindow, - - /// - /// Content is hosted into a - /// - Document, - - /// - /// Content is hidden - /// - Hidden, - } - - - /// - /// Defines how a dockable content can be dragged over a docking manager - /// - /// This style can be composed with the 'or' operator. - public enum DockableStyle : uint - { - /// - /// Content is not dockable at all - /// - None = 0x0000, - - /// - /// Dockable as document - /// - Document = 0x0001, - - /// - /// Dockable to the left border of - /// - LeftBorder = 0x0002, - - /// - /// Dockable to the right border of - /// - RightBorder = 0x0004, - - /// - /// Dockable to the top border of - /// - TopBorder = 0x0008, - - /// - /// Dockable to the bottom border of - /// - BottomBorder= 0x0010, - - /// - /// A with this style can be hosted in a - /// - Floating = 0x0020, - - /// - /// A with this style can be the only one content in a pane (NOT YET SUPPORTED) - /// - /// This style is not compatible with style - Single = 0x0040, - - /// - /// A with this style can be autohidden. - /// - AutoHide = 0x0080, - - /// - /// Dockable only to a border of a - /// - DockableToBorders = LeftBorder | RightBorder | TopBorder | BottomBorder | AutoHide, - - /// - /// Dockable to a border of a and into a - /// - Dockable = DockableToBorders | Document | Floating, - - /// - /// Dockable to a border of a and into a but not in autohidden mode (WinForms controls) - /// - DockableButNotAutoHidden = Dockable & ~AutoHide - } - - - /// - /// Represent a state of a dockable content that can be used to restore it after it's hidden - /// - internal class DockableContentStateAndPosition - { - public readonly Pane ContainerPane = null; - public readonly int ChildIndex = -1; - public readonly double Width; - public readonly double Height; - public readonly DockableContentState State; - public readonly AnchorStyle Anchor = AnchorStyle.None; - - public DockableContentStateAndPosition( - Pane containerPane, - int childIndex, - double width, - double height, - AnchorStyle anchor, - DockableContentState state) - { - ContainerPane = containerPane; - ChildIndex = childIndex; - Width = Math.Max(width, 100.0); - Height = Math.Max(height, 100.0); - Anchor = anchor; - State = state; - } - - public DockableContentStateAndPosition( - DockableContent cntToSave) - { - ContainerPane = cntToSave.ContainerPane; - ChildIndex = ContainerPane.Items.IndexOf(cntToSave); - Width = Math.Max(ContainerPane.ActualWidth, 100.0); - Height = Math.Max(ContainerPane.ActualHeight, 100.0); - State = cntToSave.State; - - DockablePane dockablePane = ContainerPane as DockablePane; - if (dockablePane != null) - { - Anchor = dockablePane.Anchor; - } - } - } - - /// - /// Identifies a content that can be drag over a control or hosted by a window floating over it (). - /// - public class DockableContent : ManagedContent - { - static DockableContent() - { - //DefaultStyleKeyProperty.OverrideMetadata(typeof(DockableContent), new FrameworkPropertyMetadata(typeof(DockableContent))); - } - - public DockableContent() - { - } - - #region Drag content - protected override void OnDragMouseMove(object sender, MouseEventArgs e) - { - base.OnDragMouseMove(sender, e); - } - - protected override void OnDragStart(Point ptMouse, Point ptRelativeMouse) - { - if (DockableStyle != DockableStyle.None && - State != DockableContentState.AutoHide) - { - Manager.Drag(this, HelperFunc.PointToScreenWithoutFlowDirection(this, ptMouse), ptRelativeMouse); - } - - base.OnDragStart(ptMouse, ptRelativeMouse); - } - - #endregion - - #region State Properties & Events - - public delegate void DockableContentStateHandler(object sender, DockableContentState state); - public event DockableContentStateHandler StateChanged; - - public DockableContentState State - { - get { return (DockableContentState)GetValue(StatePropertyKey.DependencyProperty); } - //protected set { SetValue(StatePropertyKey, value); } - protected set - { - SetValue(StatePropertyKey, value); - if (StateChanged != null) - StateChanged(this, value); - } - } - - // Using a DependencyProperty as the backing store for State. This enables animation, styling, binding, etc... - public static readonly DependencyPropertyKey StatePropertyKey = - DependencyProperty.RegisterReadOnly("State", typeof(DockableContentState), typeof(DockableContent), new UIPropertyMetadata(DockableContentState.Docked)); - - DockableStyle _dockableStyle = DockableStyle.Dockable; - - /// - /// Get or sets a value that indicates how a dockable content can be dragged over and docked to a - /// - public DockableStyle DockableStyle - { - get { return _dockableStyle; } - set { _dockableStyle = value; } - } - - - - #endregion - - #region StateMachine - - internal void SetStateToAutoHide() - { - State = DockableContentState.AutoHide; - } - - internal void SetStateToDock() - { - State = DockableContentState.Docked; - } - - internal void SetStateToDockableWindow() - { - if (State == DockableContentState.DockableWindow) - return; - - Debug.Assert( - State == DockableContentState.Document || - State == DockableContentState.Docked || - State == DockableContentState.FloatingWindow); - - State = DockableContentState.DockableWindow; - } - - internal void SetStateToFloatingWindow() - { - if (State == DockableContentState.FloatingWindow) - return; - - Debug.Assert( - State == DockableContentState.Document || - State == DockableContentState.Docked || - State == DockableContentState.DockableWindow); - - State = DockableContentState.FloatingWindow; - } - - internal void SetStateToHidden() - { - State = DockableContentState.Hidden; - } - - internal void SetStateToDocument() - { - State = DockableContentState.Document; - } - #endregion - - #region HideOnClose - public static DependencyProperty HideOnCloseKey = DependencyProperty.Register("HideOnClose", typeof(bool), typeof(DockableContent), new PropertyMetadata(true)); - - public bool HideOnClose - { - get { return (bool)GetValue(HideOnCloseKey); } - set { SetValue(HideOnCloseKey, value); } - } - #endregion - - - - - - - protected override void OnInitialized(EventArgs e) - { - base.OnInitialized(e); - - this.CommandBindings.Add( - new CommandBinding(FloatingCommand, this.OnExecuteCommand, this.OnCanExecuteCommand)); - this.CommandBindings.Add( - new CommandBinding(DockableCommand, this.OnExecuteCommand, this.OnCanExecuteCommand)); - this.CommandBindings.Add( - new CommandBinding(ShowAsDocumentCommand, this.OnExecuteCommand, this.OnCanExecuteCommand)); - this.CommandBindings.Add( - new CommandBinding(DockablePane.ToggleAutoHideCommand, this.OnExecuteCommand, this.OnCanExecuteCommand)); - this.CommandBindings.Add( - new CommandBinding(HideCommand, this.OnExecuteCommand, this.OnCanExecuteCommand)); - } - - #region Commands - - static object syncRoot = new object(); - - - private static RoutedUICommand documentCommand = null; - public static RoutedUICommand ShowAsDocumentCommand - { - get - { - lock (syncRoot) - { - if (null == documentCommand) - { - documentCommand = new RoutedUICommand("Tabbed Document", "Document", typeof(DockableContent)); - } - } - return documentCommand; - } - } - - private static RoutedUICommand dockableCommand = null; - public static RoutedUICommand DockableCommand - { - get - { - lock (syncRoot) - { - if (null == dockableCommand) - { - dockableCommand = new RoutedUICommand("Dockable", "Dockable", typeof(DockablePane)); - } - } - return dockableCommand; - } - } - - private static RoutedUICommand floatingCommand = null; - public static RoutedUICommand FloatingCommand - { - get - { - lock (syncRoot) - { - if (null == floatingCommand) - { - floatingCommand = new RoutedUICommand("F_loating", "Floating", typeof(DockableContent)); - } - } - return floatingCommand; - } - } - - private static RoutedUICommand hideCommand = null; - public static RoutedUICommand HideCommand - { - get - { - lock (syncRoot) - { - if (null == hideCommand) - { - hideCommand = new RoutedUICommand("H_ide", "Hide", typeof(DockableContent)); - } - } - return hideCommand; - } - } - - internal virtual void OnExecuteCommand(object sender, ExecutedRoutedEventArgs e) - { - if (!e.Handled && - e.Command == DockablePane.ToggleAutoHideCommand) - { - if ((DockableStyle & DockableStyle.AutoHide) > 0) - { - ((ContainerPane as DockablePane)).ToggleAutoHide(); - e.Handled = true; - } - } - else if (!e.Handled && e.Command == DockableContent.HideCommand) - { - Manager.Hide(this); - - e.Handled = true; - } - else if (!e.Handled && e.Command == DockableContent.FloatingCommand) - { - Manager.Show(this, DockableContentState.FloatingWindow); - e.Handled = true; - } - else if (!e.Handled && e.Command == DockableContent.DockableCommand) - { - Manager.Show(this, DockableContentState.DockableWindow); - e.Handled = true; - } - else if (!e.Handled && e.Command == DockableContent.ShowAsDocumentCommand) - { - Manager.Show(this, DockableContentState.Document); - e.Handled = true; - } - - } - - protected virtual void OnCanExecuteCommand(object sender, CanExecuteRoutedEventArgs e) - { - if (State == DockableContentState.AutoHide) - { - if (e.Command == DockablePane.ToggleAutoHideCommand || - e.Command == DockablePane.CloseCommand || - e.Command == DockableContent.HideCommand) - e.CanExecute = true; - else - e.CanExecute = false; - } - else - e.CanExecute = true; - } - - #endregion - - #region Operations on content - - - /// - /// Remove this content from its parent container pane - /// - /// - internal DockableContent DetachFromContainerPane() - { - if (ContainerPane != null) - { - int indexOfContent = ContainerPane.Items.IndexOf(this); - return ContainerPane.RemoveContent(indexOfContent) as DockableContent; - } - - return null; - } - - DockableContentStateAndPosition _savedStateAndPosition = null; - - internal DockableContentStateAndPosition SavedStateAndPosition - { - get { return _savedStateAndPosition; } - } - - internal void SaveCurrentStateAndPosition() - { - //if (State == DockableContentState.Docked) - //{ - _savedStateAndPosition = new DockableContentStateAndPosition( - this); - //} - //else - //{ - // _savedStateAndPosition = null; - //} - } - - /// - /// Reset internal state and position of the content - /// - /// After a is hidden AvalonDock save its state and position in order to - /// restore it correctly when user wants to reshow it calling function. Call this method - /// if you want to reset these data and provide your state and anchor style calling one of the overloads of the function - /// . - public void ResetSavedStateAndPosition() - { - _savedStateAndPosition = null; - } - - #endregion - - #region Save/Restore Content Layout - /// - /// Save content specific layout settings - /// - /// Backend store writer - /// Custom derived class can overloads this method to handle custom layout persistence. - public virtual void SaveLayout(XmlWriter storeWriter) - { - if (!FloatingWindowSize.IsEmpty) - { - storeWriter.WriteAttributeString( - "FloatingWindowSize", new SizeConverter().ConvertToInvariantString(FloatingWindowSize)); - } - - if (SavedStateAndPosition != null) - { - storeWriter.WriteAttributeString( - "ChildIndex", SavedStateAndPosition.ChildIndex.ToString()); - storeWriter.WriteAttributeString( - "Width", SavedStateAndPosition.Width.ToString()); - storeWriter.WriteAttributeString( - "Height", SavedStateAndPosition.Height.ToString()); - storeWriter.WriteAttributeString( - "Anchor", SavedStateAndPosition.Anchor.ToString()); - storeWriter.WriteAttributeString( - "State", SavedStateAndPosition.State.ToString()); - } - - } - - /// - /// Restore content specific layout settings - /// - /// Saved xml element containg content layout settings - /// Custom derived class must overload this method to restore custom layout settings previously saved trought . - public virtual void RestoreLayout(XmlElement contentElement) - { - if (contentElement.HasAttribute("FloatingWindowSize")) - FloatingWindowSize = (Size)(new SizeConverter()).ConvertFromInvariantString(contentElement.GetAttribute("FloatingWindowSize")); - - - Size effectiveSize = new Size(0d, 0d); - if (contentElement.HasAttribute("EffectiveSize")) - { - // Store - effectiveSize = (Size)(new SizeConverter()).ConvertFromInvariantString(contentElement.GetAttribute("EffectiveSize")); - } - - ResizingPanel.SetEffectiveSize(this, effectiveSize); - - if (contentElement.HasAttribute("ChildIndex")) - { - _savedStateAndPosition = new DockableContentStateAndPosition( - ContainerPane, - int.Parse(contentElement.GetAttribute("ChildIndex")), - double.Parse(contentElement.GetAttribute("Width")), - double.Parse(contentElement.GetAttribute("Height")), - (AnchorStyle) Enum.Parse(typeof(AnchorStyle), contentElement.GetAttribute("Anchor")), - (DockableContentState) Enum.Parse(typeof(DockableContentState), contentElement.GetAttribute("State")) - ); - //contentElement.HasAttribute("State") ? (DockableContentState)Enum.Parse(typeof(DockableContentState), contentElement.GetAttribute("State") ); - } - } - #endregion - } -} diff --git a/src/Libraries/AvalonDock/DockableFloatingWindow.cs b/src/Libraries/AvalonDock/DockableFloatingWindow.cs deleted file mode 100644 index dc6663b3bd..0000000000 --- a/src/Libraries/AvalonDock/DockableFloatingWindow.cs +++ /dev/null @@ -1,279 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.ComponentModel; -using System.Windows.Markup; -using System.Diagnostics; -using System.Windows.Threading; -using System.Windows.Media.Animation; -using System.Windows.Interop; - -namespace AvalonDock -{ - public class DockableFloatingWindow : FloatingWindow - { - static DockableFloatingWindow() - { - //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. - //This style is defined in themes\generic.xaml - DefaultStyleKeyProperty.OverrideMetadata(typeof(DockableFloatingWindow), new FrameworkPropertyMetadata(typeof(DockableFloatingWindow))); - } - - - public DockableFloatingWindow(DockingManager manager) - : base(manager) - { - } - - - Pane _previousPane = null; - - int _arrayIndexPreviousPane = -1; - - - public DockableFloatingWindow(DockingManager manager, DockableContent content) - : this(manager) - { - - //create a new temporary pane - FloatingDockablePane pane = new FloatingDockablePane(this); - - //setup window size - //Width = content.ContainerPane.ActualWidth; - //Height = content.ContainerPane.ActualHeight; - - if (content.FloatingWindowSize.IsEmpty) - content.FloatingWindowSize = new Size(content.ContainerPane.ActualWidth, content.ContainerPane.ActualHeight); - - Width = content.FloatingWindowSize.Width; - Height = content.FloatingWindowSize.Height; - - //save current content position in container pane - _previousPane = content.ContainerPane; - _arrayIndexPreviousPane = _previousPane.Items.IndexOf(content); - - pane.Style = content.ContainerPane.Style; - - //remove content from container pane - content.ContainerPane.RemoveContent(_arrayIndexPreviousPane); - - //add content to my temporary pane - pane.Items.Add(content); - - //let templates access this pane - HostedPane = pane; - - //Change state on contents - IsDockableWindow = true; - - DocumentPane originalDocumentPane = _previousPane as DocumentPane; - if (originalDocumentPane != null) - originalDocumentPane.CheckContentsEmpty(); - } - - public DockableFloatingWindow(DockingManager manager, DockablePane dockablePane) - : this(manager) - { - //create a new temporary pane - FloatingDockablePane pane = new FloatingDockablePane(this); - - //setup window size - ManagedContent selectedContent = dockablePane.SelectedItem as ManagedContent; - - if (selectedContent != null && selectedContent.FloatingWindowSize.IsEmpty) - selectedContent.FloatingWindowSize = new Size(dockablePane.ActualWidth, dockablePane.ActualHeight); - - if (selectedContent != null) - { - Width = selectedContent.FloatingWindowSize.Width; - Height = selectedContent.FloatingWindowSize.Height; - this.ResizeMode = selectedContent.FloatingResizeMode; - } - else - { - Width = dockablePane.ActualWidth; - Height = dockablePane.ActualHeight; - } - - //transfer the style from the original dockablepane - pane.Style = dockablePane.Style; - - //Width = dockablePane.ActualWidth; - //Height = dockablePane.ActualHeight; - - ////save current content position in container pane - //pane.SetValue(ResizingPanel.ResizeWidthProperty, dockablePane.GetValue(ResizingPanel.ResizeWidthProperty)); - //pane.SetValue(ResizingPanel.ResizeHeightProperty, dockablePane.GetValue(ResizingPanel.ResizeHeightProperty)); - - int selectedIndex = dockablePane.SelectedIndex; - - //remove contents from container pane and insert in hosted pane - while (dockablePane.Items.Count > 0) - { - ManagedContent content = dockablePane.RemoveContent(0); - - //add content to my temporary pane - pane.Items.Add(content); - } - - //let templates access this pane - HostedPane = pane; - HostedPane.SelectedIndex = selectedIndex; - - //Change state on contents - IsDockableWindow = true; - } - - - protected override void OnInitialized(EventArgs e) - { - base.OnInitialized(e); - - if (HostedPane == null) - HostedPane = Content as FloatingDockablePane; - - if (HostedPane != null) - { - Content = HostedPane; - } - } - - - - protected override void OnClosed(EventArgs e) - { - base.OnClosed(e); - - DockableContent[] cntsToClose = new DockableContent[HostedPane.Items.Count]; - HostedPane.Items.CopyTo(cntsToClose, 0); - - foreach (DockableContent cntToClose in cntsToClose) - { - HostedPane.CloseOrHide(HostedPane.Items[0] as DockableContent, ForcedClosing); - } - - Manager.UnregisterFloatingWindow(this); - } - - public override Pane ClonePane() - { - DockablePane paneToAnchor = new DockablePane(); - - ResizingPanel.SetEffectiveSize(paneToAnchor, new Size(Width, Height)); - - if (HostedPane.Style != null) - paneToAnchor.Style = HostedPane.Style; - - int selectedIndex = HostedPane.SelectedIndex; - - //transfer contents from hosted pane in the floating window and - //the new created dockable pane - while (HostedPane.Items.Count > 0) - { - paneToAnchor.Items.Add( - HostedPane.RemoveContent(0)); - } - - paneToAnchor.SelectedIndex = selectedIndex; - - return paneToAnchor; - } - - protected override void OnExecuteCommand(object sender, ExecutedRoutedEventArgs e) - { - if (e.Command == TabbedDocumentCommand) - { - DockableContent currentContent = HostedPane.SelectedItem as DockableContent; - - Manager.MainDocumentPane.Items.Insert(0, HostedPane.RemoveContent(HostedPane.SelectedIndex)); - Manager.MainDocumentPane.SelectedIndex = 0; - - currentContent.SetStateToDocument(); - - if (HostedPane.Items.Count == 0) - this.Close(); - e.Handled = true; - } - else if (e.Command == CloseCommand) - { - //DockableContent currentContent = HostedPane.SelectedItem as DockableContent; - //Manager.Hide(currentContent); - HostedPane.CloseOrHide(); - if (HostedPane.Items.Count == 0) - this.Close(); - e.Handled = true; - } - - base.OnExecuteCommand(sender, e); - } - - protected override void Redock() - { - if (_previousPane != null) - { - if (_previousPane.GetManager() == null) - { - DockablePane newContainerPane = new DockablePane(); - newContainerPane.Items.Add(HostedPane.RemoveContent(0)); - newContainerPane.SetValue(ResizingPanel.ResizeWidthProperty, _previousPane.GetValue(ResizingPanel.ResizeWidthProperty)); - newContainerPane.SetValue(ResizingPanel.ResizeHeightProperty, _previousPane.GetValue(ResizingPanel.ResizeHeightProperty)); - - if (_previousPane.Style != null) - newContainerPane.Style = _previousPane.Style; - - Manager.Anchor(newContainerPane, ((DockablePane)_previousPane).Anchor); - } - else - { - if (_arrayIndexPreviousPane > _previousPane.Items.Count) - _arrayIndexPreviousPane = _previousPane.Items.Count; - - DockableContent currentContent = HostedPane.Items[0] as DockableContent; - _previousPane.Items.Insert(_arrayIndexPreviousPane, HostedPane.RemoveContent(0)); - _previousPane.SelectedIndex = _arrayIndexPreviousPane; - currentContent.SetStateToDock(); - - } - this.Close(); - } - - base.Redock(); - } - - - } -} diff --git a/src/Libraries/AvalonDock/DockablePane.cs b/src/Libraries/AvalonDock/DockablePane.cs deleted file mode 100644 index d0188c7d57..0000000000 --- a/src/Libraries/AvalonDock/DockablePane.cs +++ /dev/null @@ -1,501 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.Diagnostics; -using System.ComponentModel; -using System.Collections; - - -namespace AvalonDock -{ - /// - /// Anchor types - /// - public enum AnchorStyle - { - /// - /// No anchor style, while content is hosted in a or a - /// - None, - /// - /// Top border anchor - /// - Top, - /// - /// Left border anchor - /// - Left, - /// - /// Bottom border anchor - /// - Bottom, - /// - /// Right border anchor - /// - Right - } - - - public class DockablePane : Pane - { - static DockablePane() - { - //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. - //This style is defined in themes\generic.xaml - DefaultStyleKeyProperty.OverrideMetadata(typeof(DockablePane), new FrameworkPropertyMetadata(typeof(DockablePane))); - } - - protected override void OnInitialized(EventArgs e) - { - base.OnInitialized(e); - - this.CommandBindings.Add( - new CommandBinding(ShowOptionsCommand, this.OnExecuteCommand, this.OnCanExecuteCommand)); - this.CommandBindings.Add( - new CommandBinding(ToggleAutoHideCommand, this.OnExecuteCommand, this.OnCanExecuteCommand)); - this.CommandBindings.Add( - new CommandBinding(CloseCommand, this.OnExecuteCommand, this.OnCanExecuteCommand)); - } - - public DockablePane() - { - this.Loaded += new RoutedEventHandler(DockablePane_Loaded); - this.Unloaded += new RoutedEventHandler(DockablePane_Unloaded); - } - - void DockablePane_Loaded(object sender, RoutedEventArgs e) - { - - } - void DockablePane_Unloaded(object sender, RoutedEventArgs e) - { - UnloadOptionsContextMenu(); - } - - - #region Dependency properties - - public bool ShowHeader - { - get { return (bool)GetValue(ShowHeaderProperty); } - set { SetValue(ShowHeaderProperty, value); } - } - - // Using a DependencyProperty as the backing store for ActiveContent. This enables animation, styling, binding, etc... - public static readonly DependencyProperty ShowHeaderProperty = - DependencyProperty.Register("ShowHeader", typeof(bool), typeof(DockablePane), new UIPropertyMetadata(true)); - - - public bool ShowTabs - { - get { return (bool)GetValue(ShowTabsProperty); } - set { SetValue(ShowTabsProperty, value); } - } - - // Using a DependencyProperty as the backing store for ShowTabs. This enables animation, styling, binding, etc... - public static readonly DependencyProperty ShowTabsProperty = - DependencyProperty.Register("ShowTabs", typeof(bool), typeof(DockablePane), new UIPropertyMetadata(true)); - - - public AnchorStyle Anchor - { - get { return (AnchorStyle)GetValue(AnchorPropertyKey.DependencyProperty); } - internal set { SetValue(AnchorPropertyKey, value); } - } - - // Using a DependencyProperty as the backing store for Anchor. This enables animation, styling, binding, etc... - public static readonly DependencyPropertyKey AnchorPropertyKey = - DependencyProperty.RegisterAttachedReadOnly("Anchor", typeof(AnchorStyle), typeof(DockablePane), new UIPropertyMetadata(AnchorStyle.None)); - - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - if (_partHeader != null) - { - _partHeader.MouseDown += new MouseButtonEventHandler(OnHeaderMouseDown); - _partHeader.MouseMove += new MouseEventHandler(OnHeaderMouseMove); - _partHeader.MouseUp += new MouseButtonEventHandler(OnHeaderMouseUp); - _partHeader.MouseEnter += new MouseEventHandler(OnHeaderMouseEnter); - _partHeader.MouseLeave += new MouseEventHandler(OnHeaderMouseLeave); - } - - _optionsContextMenuPlacementTarget = GetTemplateChild("PART_ShowContextMenuButton") as UIElement; - } - - - - - #endregion - - - public override bool IsSurfaceVisible - { - get - { - foreach (ManagedContent managedContent in Items) - { - if (managedContent is DocumentContent) - continue; - - if (((DockableContent)managedContent).State == DockableContentState.Docked) - return true; - } - - return false; - } - } - - - #region OptionsContextMenu - ContextMenu cxOptions = null; - - UIElement _optionsContextMenuPlacementTarget = null; - - void LoadOptionsContextMenu() - { - Debug.Assert(cxOptions == null); - cxOptions = FindResource(new ComponentResourceKey(typeof(DockingManager), ContextMenuElement.DockablePane)) as ContextMenu; - cxOptions.Opened += new RoutedEventHandler(cxOptions_RefreshOpenState); - cxOptions.Closed += new RoutedEventHandler(cxOptions_RefreshOpenState); - } - - void UnloadOptionsContextMenu() - { - if (cxOptions != null) - { - cxOptions.Opened -= new RoutedEventHandler(cxOptions_RefreshOpenState); - cxOptions.Closed -= new RoutedEventHandler(cxOptions_RefreshOpenState); - cxOptions = null; - } - } - - - protected virtual void OpenOptionsContextMenu() - { - if (cxOptions == null) - { - LoadOptionsContextMenu(); - } - - if (cxOptions != null) - { - cxOptions.DataContext = this.SelectedItem as DockableContent; - - foreach (MenuItem menuItem in cxOptions.Items) - menuItem.CommandTarget = this.SelectedItem as DockableContent; - - if (_optionsContextMenuPlacementTarget != null) - { - cxOptions.Placement = PlacementMode.Bottom; - cxOptions.PlacementTarget = _optionsContextMenuPlacementTarget; - } - else - { - cxOptions.Placement = PlacementMode.MousePoint; - cxOptions.PlacementTarget = this; - } - - cxOptions.IsOpen = true; - } - } - - void cxOptions_RefreshOpenState(object sender, RoutedEventArgs e) - { - NotifyPropertyChanged("IsOptionsMenuOpened"); - } - - public bool IsOptionsMenuOpened - { - get - { - return cxOptions != null && cxOptions.IsOpen && ( - _optionsContextMenuPlacementTarget != null ? - cxOptions.PlacementTarget == _optionsContextMenuPlacementTarget : - cxOptions.PlacementTarget == this); - } - } - - #endregion - - #region Mouse management - - void FocusContent() - { - ManagedContent selectedContent = SelectedItem as ManagedContent; - if (selectedContent != null && selectedContent.Content is UIElement) - { - //UIElement internalContent = selectedContent.Content as UIElement; - //bool res = internalContent.Focus(); - selectedContent.SetAsActive(); - } - } - - Point ptStartDrag; - bool isMouseDown = false; - protected virtual void OnHeaderMouseDown(object sender, MouseButtonEventArgs e) - { - if (!e.Handled) - { - FocusContent(); - - if (((DockableContent)SelectedItem).State != DockableContentState.AutoHide) - { - ptStartDrag = e.MouseDevice.GetPosition(this); - isMouseDown = true; - } - } - } - - protected virtual void OnHeaderMouseMove(object sender, MouseEventArgs e) - { - Point ptMouseMove = e.GetPosition(this); - - if (!e.Handled && isMouseDown) - { - if (_partHeader != null && - _partHeader.IsMouseOver) - { - if (!IsMouseCaptured) - { - if (Math.Abs(ptMouseMove.X - ptStartDrag.X) > SystemParameters.MinimumHorizontalDragDistance || - Math.Abs(ptMouseMove.Y - ptStartDrag.Y) > SystemParameters.MinimumVerticalDragDistance) - { - isMouseDown = false; - ReleaseMouseCapture(); - DockingManager manager = GetManager(); - manager.Drag(this, this.PointToScreenDPI(e.GetPosition(this)), e.GetPosition(this)); - e.Handled = true; - } - } - } - } - - } - - protected virtual void OnHeaderMouseUp(object sender, MouseButtonEventArgs e) - { - isMouseDown = false; - ReleaseMouseCapture(); - } - - protected virtual void OnHeaderMouseEnter(object sender, MouseEventArgs e) - { - isMouseDown = false; - - } - protected virtual void OnHeaderMouseLeave(object sender, MouseEventArgs e) - { - isMouseDown = false; - - } - #endregion - - #region Commands - private static object syncRoot = new object(); - - - private static RoutedUICommand optionsCommand = null; - public static RoutedUICommand ShowOptionsCommand - { - get - { - lock (syncRoot) - { - if (null == optionsCommand) - { - optionsCommand = new RoutedUICommand("S_how options", "Options", typeof(DockablePane)); - } - } - return optionsCommand; - } - } - - private static RoutedUICommand autoHideCommand = null; - public static RoutedUICommand ToggleAutoHideCommand - { - get - { - lock (syncRoot) - { - if (null == autoHideCommand) - { - autoHideCommand = new RoutedUICommand("A_utohide", "AutoHide", typeof(DockablePane)); - } - } - return autoHideCommand; - } - } - - private static RoutedUICommand closeCommand = null; - public static RoutedUICommand CloseCommand - { - get - { - lock (syncRoot) - { - if (null == closeCommand) - { - closeCommand = new RoutedUICommand("C_lose", "Close", typeof(DockablePane)); - } - } - return closeCommand; - } - } - - - internal virtual void OnExecuteCommand(object sender, ExecutedRoutedEventArgs e) - { - if (e.Command == ToggleAutoHideCommand) - { - ToggleAutoHide(); - e.Handled = true; - } - else if (e.Command == CloseCommand) - { - CloseOrHide(); - e.Handled = true; - } - else if (e.Command == ShowOptionsCommand) - { - OpenOptionsContextMenu(); - e.Handled = true; - } - - } - - protected virtual void OnCanExecuteCommand(object sender, CanExecuteRoutedEventArgs e) - { - e.CanExecute = true; - } - - #endregion - - - public override bool IsDocked - { - get { return IsSurfaceVisible; } - } - - - public DockableStyle GetCumulativeDockableStyle() - { - DockableStyle style = DockableStyle.Dockable; - - if (Items.Count == 1 && - Items[0] is DocumentContent) - style = DockableStyle.Document; - else - { - foreach (DockableContent content in this.Items) - { - style &= content.DockableStyle; - } - } - - return style; - } - - public override ManagedContent RemoveContent(int index) - { - ManagedContent content = base.RemoveContent(index); - - if (Items.Count == 0) - { - ResizingPanel containerPanel = Parent as ResizingPanel; - if (containerPanel != null) - containerPanel.RemoveChild(this); - } - - return content; - } - - protected virtual void CheckItems(IList newItems) - { - foreach (object newItem in newItems) - { - if (!(newItem is DockableContent)) - throw new InvalidOperationException("DockablePane can contain only DockableContents!"); - } - } - - protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) - { - if (e.NewItems != null) - CheckItems(e.NewItems); - - base.OnItemsChanged(e); - } - - - - #region Dockable Pane operations - /// - /// Show/Hide a flyout window containing this pane - /// - internal virtual void ToggleAutoHide() - { - bool flag = true; - foreach (DockableContent cnt in this.Items) - { - if ((cnt.DockableStyle & DockableStyle.AutoHide) == 0) - { - flag = false; - break; - } - } - if (flag && GetManager() != null) - GetManager().ToggleAutoHide(this); - } - - - /// - /// Closes or hides current content depending on HideOnClose property - /// - internal void CloseOrHide() - { - CloseOrHide(SelectedItem as DockableContent, false); - } - - - - - #endregion - - } -} diff --git a/src/Libraries/AvalonDock/DockablePaneAnchorTab.cs b/src/Libraries/AvalonDock/DockablePaneAnchorTab.cs deleted file mode 100644 index 50362b6a13..0000000000 --- a/src/Libraries/AvalonDock/DockablePaneAnchorTab.cs +++ /dev/null @@ -1,117 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.ComponentModel; -using System.Diagnostics; - -namespace AvalonDock -{ - [EditorBrowsable(EditorBrowsableState.Never)] - public class DockablePaneAnchorTab : System.Windows.Controls.Control, INotifyPropertyChanged - { - static DockablePaneAnchorTab() - { - //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. - //This style is defined in themes\generic.xaml - DefaultStyleKeyProperty.OverrideMetadata(typeof(DockablePaneAnchorTab), new FrameworkPropertyMetadata(typeof(DockablePaneAnchorTab))); - } - - public DockableContent ReferencedContent - { - get { return (DockableContent)GetValue(ReferencedContentPropertyKey.DependencyProperty); } - set { SetValue(ReferencedContentPropertyKey, value); } - } - - // Using a DependencyProperty as the backing store for DockableContent. This enables animation, styling, binding, etc... - public static readonly DependencyPropertyKey ReferencedContentPropertyKey = - DependencyProperty.RegisterReadOnly("ReferencedContent", typeof(DockableContent), typeof(DockablePaneAnchorTab), new UIPropertyMetadata(null, new PropertyChangedCallback(OnPaneAttached))); - - - static void OnPaneAttached(DependencyObject depObj, DependencyPropertyChangedEventArgs e) - { - if (e.Property == ReferencedContentPropertyKey.DependencyProperty) - { - DockablePaneAnchorTab _this = depObj as DockablePaneAnchorTab; - if (_this.PropertyChanged != null) - { - _this.PropertyChanged(depObj, new PropertyChangedEventArgs("Anchor")); - _this.PropertyChanged(depObj, new PropertyChangedEventArgs("Icon")); - _this.PropertyChanged(depObj, new PropertyChangedEventArgs("ReferencedContent")); - } - } - - } - - public AnchorStyle Anchor - { - get { return (AnchorStyle)GetValue(AnchorPropertyKey.DependencyProperty); } - internal set { SetValue(AnchorPropertyKey, value); } - } - - // Using a DependencyProperty as the backing store for IsSelected. This enables animation, styling, binding, etc... - public static readonly DependencyPropertyKey AnchorPropertyKey = - DependencyProperty.RegisterAttachedReadOnly("Anchor", typeof(AnchorStyle), typeof(DockablePaneAnchorTab), new PropertyMetadata(AnchorStyle.Left)); - - protected override void OnMouseMove(MouseEventArgs e) - { - if (ReferencedContent != null) - ReferencedContent.Manager.ShowFlyoutWindow(ReferencedContent); - - base.OnMouseMove(e); - } - - - - public object Icon - { - get { return (object)GetValue(IconProperty); } - set { SetValue(IconProperty, value); } - } - - // Using a DependencyProperty as the backing store for Icon. This enables animation, styling, binding, etc... - public static readonly DependencyProperty IconProperty = - DependencyProperty.Register("Icon", typeof(object), typeof(DockablePaneAnchorTab)); - - #region INotifyPropertyChanged Members - - public event PropertyChangedEventHandler PropertyChanged; - - #endregion - - - } -} diff --git a/src/Libraries/AvalonDock/DockablePaneAnchorTabGroup.cs b/src/Libraries/AvalonDock/DockablePaneAnchorTabGroup.cs deleted file mode 100644 index 31bec6929b..0000000000 --- a/src/Libraries/AvalonDock/DockablePaneAnchorTabGroup.cs +++ /dev/null @@ -1,64 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; - -namespace AvalonDock -{ - public class DockablePaneAnchorTabGroup : System.Windows.Controls.StackPanel - { - static DockablePaneAnchorTabGroup() - { - //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. - //This style is defined in themes\generic.xaml - DefaultStyleKeyProperty.OverrideMetadata(typeof(DockablePaneAnchorTabGroup), new FrameworkPropertyMetadata(typeof(DockablePaneAnchorTabGroup))); - } - - DockablePane _pane = null; - - internal DockablePane ReferencedPane - { - get - { return _pane; } - set { _pane = value; } - } - - protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved) - { - base.OnVisualChildrenChanged(visualAdded, visualRemoved); - } - } -} diff --git a/src/Libraries/AvalonDock/DockableTabPanel.cs b/src/Libraries/AvalonDock/DockableTabPanel.cs deleted file mode 100644 index 5c684a74d3..0000000000 --- a/src/Libraries/AvalonDock/DockableTabPanel.cs +++ /dev/null @@ -1,113 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; - -namespace AvalonDock -{ - public class DockableTabPanel : PaneTabPanel - { - protected override Size MeasureOverride(Size availableSize) - { - double totWidth = 0; - //double maxHeight = 0; - - if (Children.Count == 0) - return base.MeasureOverride(availableSize); - - - List childsOrderedByWidth = new List(); - - foreach (FrameworkElement child in Children) - { - child.Width = double.NaN; - child.Height = double.NaN; - - child.Measure(new Size(double.PositiveInfinity, availableSize.Height)); - totWidth += child.DesiredSize.Width; - childsOrderedByWidth.Add(child); - } - - if (totWidth > availableSize.Width) - { - childsOrderedByWidth.Sort(delegate(UIElement elem1, UIElement elem2) { return elem2.DesiredSize.Width.CompareTo(elem1.DesiredSize.Width); }); - - - int i = childsOrderedByWidth.Count - 1; - double sumWidth = 0; - - while (childsOrderedByWidth[i].DesiredSize.Width * (i + 1) + sumWidth < availableSize.Width) - { - sumWidth += childsOrderedByWidth[i].DesiredSize.Width; - - i--; - - if (i < 0) - break; - - } - - double shWidth = (availableSize.Width - sumWidth) / (i + 1); - - - foreach (UIElement child in Children) - { - if (shWidth < child.DesiredSize.Width) - child.Measure(new Size(shWidth, availableSize.Height)); - } - - } - - return base.MeasureOverride(availableSize); - } - - protected override Size ArrangeOverride(Size finalSize) - { - double offsetX = 0; - - foreach (FrameworkElement child in Children) - { - double childFinalWidth = child.DesiredSize.Width; - child.Arrange(new Rect(offsetX, 0, childFinalWidth, finalSize.Height)); - - offsetX += childFinalWidth; - } - - return base.ArrangeOverride(finalSize); - } - - } -} diff --git a/src/Libraries/AvalonDock/DockingManager.cs b/src/Libraries/AvalonDock/DockingManager.cs deleted file mode 100644 index 30e4a7807e..0000000000 --- a/src/Libraries/AvalonDock/DockingManager.cs +++ /dev/null @@ -1,3243 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.Diagnostics; -using System.Windows.Interop; -using System.ComponentModel; -using System.IO; -using System.Xml; -using System.Linq; -using System.Collections; -using System.Collections.Specialized; -using System.Collections.ObjectModel; - -namespace AvalonDock -{ - - /// - /// Represents a control which manages a dockable layout for its children - /// - public class DockingManager : System.Windows.Controls.ContentControl, IDropSurface, INotifyPropertyChanged, IDisposable - { - static DockingManager() - { - //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. - //This style is defined in themes\generic.xaml - DefaultStyleKeyProperty.OverrideMetadata(typeof(DockingManager), new FrameworkPropertyMetadata(typeof(DockingManager))); - } - - - public DockingManager() - { - DragPaneServices.Register(this); - this.Unloaded += new RoutedEventHandler(DockingManager_Unloaded); - this.Loaded += new RoutedEventHandler(DockingManager_Loaded); - } - - - #region Control lifetime management - ~DockingManager() - { - Dispose(false); - } - - bool _isControlLoaded = false; - - void DockingManager_Loaded(object sender, RoutedEventArgs e) - { - foreach (FloatingWindow floatingWindow in _floatingWindows) - { - floatingWindow.Owner = Window.GetWindow(this); - - floatingWindow.Show(); - } - - DragPaneServices.Register(this); - - _isControlLoaded = true; - } - - void DockingManager_Unloaded(object sender, RoutedEventArgs e) - { - //cleanup pending resources - HideAutoHideWindow(); - - - if (_wndInteropWrapper != null) - { - _wndInteropWrapper.OnWindowPosChanging -= new EventHandler(_wndInteropWrapper_OnWindowPosChanging); - _wndInteropWrapper.Dispose(); - _wndInteropWrapper = null; - } - - if (_overlayWindow != null) - { - _overlayWindow.Close(); - _overlayWindow = null; - } - - foreach (FloatingWindow floatingWindow in _floatingWindows) - floatingWindow.Hide(); - - //navigator windows are now automatically disposed when - //no longer used. In this way we avoid WPF bug: - //http://social.msdn.microsoft.com/forums/en/wpf/thread/f3fc5b7e-e035-4821-908c-b6c07e5c7042/ - //if (navigatorWindow != null) - //{ - // navigatorWindow.Close(); - // navigatorWindow = null; - //} - - //if (documentNavigatorWindow != null) - //{ - // documentNavigatorWindow.Close(); - // documentNavigatorWindow = null; - //} - - DragPaneServices.Unregister(this); - - _isControlLoaded = false; - } - - /// - /// Call this function if you want to deallocate external floating windows, that otherwise are closed when main window is closed. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - bool _disposed = false; - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - while (_floatingWindows.Count > 0) - { - _floatingWindows[0].Owner = null; - _floatingWindows[0].Close(); - } - } - - _disposed = true; - } - - #endregion - - Panel _leftAnchorTabPanel; - Panel _rightAnchorTabPanel; - Panel _topAnchorTabPanel; - Panel _bottomAnchorTabPanel; - - List _anchorTabPanels = new List(); - - bool _OnApplyTemplateFlag = false; - - - Panel ReplaceAnchorTabPanel(Panel oldPanel, Panel newPanel) - { - if (oldPanel == null) - { - _anchorTabPanels.Add(newPanel); - return newPanel; - } - else - { - _anchorTabPanels.Remove(oldPanel); - while (oldPanel.Children.Count > 0) - { - UIElement tabToTransfer = oldPanel.Children[0]; - oldPanel.Children.RemoveAt(0); - - newPanel.Children.Add(tabToTransfer); - } - _anchorTabPanels.Add(newPanel); - - return newPanel; - } - } - - /// - /// Overriden to get a reference to underlying template elements - /// - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - Panel leftPanel = GetTemplateChild("PART_LeftAnchorTabPanel") as Panel; - if (leftPanel == null) - throw new ArgumentException("PART_LeftAnchorTabPanel template child element not fount!"); - - Panel rightPanel = GetTemplateChild("PART_RightAnchorTabPanel") as Panel; - if (rightPanel == null) - throw new ArgumentException("PART_RightAnchorTabPanel template child element not fount!"); - - Panel topPanel = GetTemplateChild("PART_TopAnchorTabPanel") as Panel; - if (topPanel == null) - throw new ArgumentException("PART_TopAnchorTabPanel template child element not fount!"); - - Panel bottomPanel = GetTemplateChild("PART_BottomAnchorTabPanel") as Panel; - if (bottomPanel == null) - throw new ArgumentException("PART_BottomAnchorTabPanel template child element not fount!"); - - - _leftAnchorTabPanel = ReplaceAnchorTabPanel(_leftAnchorTabPanel, leftPanel); - _rightAnchorTabPanel = ReplaceAnchorTabPanel(_rightAnchorTabPanel, rightPanel); - _topAnchorTabPanel = ReplaceAnchorTabPanel(_topAnchorTabPanel, topPanel); - _bottomAnchorTabPanel = ReplaceAnchorTabPanel(_bottomAnchorTabPanel, bottomPanel); - - _OnApplyTemplateFlag = true; - } - - - #region Access to contents and pane - ManagedContent _activeDocument = null; - - /// - /// Get or set the active document - /// - /// The active document not neessary receive keyboard focus. To set keyboard focus on a content see - public ManagedContent ActiveDocument - { - get - { - return _activeDocument; - } - set - { - //Debug.WriteLine(string.Format("SetActiveDocument to '{0}'", value != null ? value.Name : "null")); - - if (_activeDocument != value/* && - value.ContainerPane is DocumentPane*/) - { - if (value != null && - (value.FindVisualAncestor(false) == null && - !(value is DocumentContent)) - ) - { - //value is not contained in a document pane/ documentfloatingwindow so cant be the active document! - return; - } - - - List listOfAllDocuments = FindContents(); - listOfAllDocuments.ForEach((ManagedContent cnt) => - { - cnt.IsActiveDocument = cnt == value; - }); - - _activeDocument = value; - NotifyPropertyChanged("ActiveDocument"); - - if (ActiveContent == null) - ActiveContent = value; - } - } - } - - ManagedContent _activeContent = null; - - /// - /// Get or set the active content - /// - /// An activated content is automatically selected in its container pane and receive logical as well keyboard focus. - public ManagedContent ActiveContent - { - get - { - return _activeContent; - } - internal set - { - //Debug.WriteLine(string.Format("SetActiveContent to '{0}'", value != null ? value.Name : "null")); - ActiveDocument = value; - - if (_activeContent != value) - { - List listOfAllContents = FindContents(); - listOfAllContents.ForEach((ManagedContent cnt) => - { - cnt.IsActiveContent = (value == cnt); - }); - - _floatingWindows.ForEach((DockableFloatingWindow fw) => - { - foreach (DockableContent cnt in fw.HostedPane.Items) - { - cnt.IsActiveContent = (value == cnt); - } - }); - if (_flyoutWindow != null) - { - foreach (DockableContent cnt in _flyoutWindow.ReferencedPane.Items) - { - cnt.IsActiveContent = (value == cnt); - } - } - - - _activeContent = value; - NotifyPropertyChanged("ActiveContent"); - } - - } - } - - /// - /// Gets the active dockable content - /// - /// If no dockbale content us active at the moment returns null. - public DockableContent ActiveDockableContent - { - get - { - IInputElement focusedElement = FocusManager.GetFocusedElement(this); - - return focusedElement as DockableContent; - } - } - - /// - /// Gets an array of all dockable contents currenty managed - /// - public DockableContent[] DockableContents - { - get - { - List contents = FindContents(); - - //FindContents already returns contents from FloatingWindows (sg #68987) - //foreach (FloatingWindow flWindow in _floatingWindows) - //{ - // foreach (DockableContent content in flWindow.HostedPane.Items) - // contents.Add(content); - //} - - foreach (DockableContent content in _hiddenContents) - contents.Add(content); - - return contents.ToArray(); - } - } - - /// - /// Gets an array of all document contents - /// - public DocumentContent[] Documents - { - get - { - return FindContents().ToArray(); - } - } - - - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Bindable(true)] - public IEnumerable DocumentsSource - { - get { return (IEnumerable)GetValue(DocumentsSourceProperty); } - set { SetValue(DocumentsSourceProperty, value); } - } - - // Using a DependencyProperty as the backing store for DocumentsSource. This enables animation, styling, binding, etc... - public static readonly DependencyProperty DocumentsSourceProperty = - DependencyProperty.Register("DocumentsSource", typeof(IEnumerable), typeof(DockingManager), new UIPropertyMetadata(null, new PropertyChangedCallback((s, e) => ((DockingManager)s).OnDocumentsSourceChanged(e.OldValue as IEnumerable, e.NewValue as IEnumerable)))); - - - void OnDocumentsSourceChanged(IEnumerable oldSource, IEnumerable newSource) - { - if (oldSource != null) - { - INotifyCollectionChanged oldSourceNotityIntf = oldSource as INotifyCollectionChanged; - if (oldSourceNotityIntf != null) - oldSourceNotityIntf.CollectionChanged -= new NotifyCollectionChangedEventHandler(DocumentsSourceCollectionChanged); - } - - if (newSource != null) - { - INotifyCollectionChanged newSourceNotityIntf = newSource as INotifyCollectionChanged; - if (newSourceNotityIntf != null) - newSourceNotityIntf.CollectionChanged += new NotifyCollectionChangedEventHandler(DocumentsSourceCollectionChanged); - } - } - - void DocumentsSourceCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - if (e.Action == NotifyCollectionChangedAction.Reset) - { - DocumentContent[] docs = this.Documents; - ObservableCollection documentsToClose = new ObservableCollection(); - - foreach (DocumentContent doc in docs) - { - if (doc.Parent is DocumentPane) - { - if ((doc.Parent as DocumentPane).IsMainDocumentPane == false) - { - documentsToClose.Add(doc); - } - } - } - - foreach (DocumentContent doc in documentsToClose) - { - doc.InternalClose(); - } - - foreach (DocumentContent doc in docs) - doc.InternalClose(); - } - - if (MainDocumentPane == null) - return; - - if (e.Action == NotifyCollectionChangedAction.Remove || - e.Action == NotifyCollectionChangedAction.Replace) - { - foreach (object newDoc in e.OldItems) - { - if (newDoc is DocumentContent) - (newDoc as DocumentContent).InternalClose(); - else if (newDoc is FrameworkElement) - { - DocumentContent docContainer = ((FrameworkElement)newDoc).Parent as DocumentContent; - if (docContainer != null) - docContainer.InternalClose(); - } - } - } - - if (e.Action == NotifyCollectionChangedAction.Add || - e.Action == NotifyCollectionChangedAction.Replace) - { - foreach (object newDoc in e.NewItems) - { - if (newDoc is DocumentContent) - MainDocumentPane.Items.Add(newDoc); - else if (newDoc is FrameworkElement) //limit objects to be at least framework elements - { - DocumentContent docContainer = new DocumentContent(); - docContainer.Content = newDoc; - - MainDocumentPane.Items.Add(docContainer); - } - } - } - } - - - - /// - /// Returns the main document pane - /// - /// - /// - internal static DocumentPane GetMainDocumentPane(ResizingPanel parentPanel) - { - foreach (UIElement child in parentPanel.Children) - { - if (child is DocumentPane) - return child as DocumentPane; - //if (child is DockablePane) - //{ - // DocumentPane doc = new DocumentPane(); - // DockablePane dockablePane = child as DockablePane; - // while (dockablePane.Items.Count > 0) - // { - // doc.Items.Add((dockablePane.Items[0] as DockableContent).DetachFromContainerPane()); - // } - // return doc; - //} - if (child is ResizingPanel) - { - DocumentPane foundDocPane = GetMainDocumentPane(child as ResizingPanel); - if (foundDocPane != null) - return foundDocPane; - } - } - - return null; - } - - internal static bool IsPanelContainingDocumentPane(ResizingPanel parentPanel) - { - foreach (UIElement child in parentPanel.Children) - { - if (child is DocumentPane) - return true; - if (child is ResizingPanel) - { - bool foundDocPane = IsPanelContainingDocumentPane(child as ResizingPanel); - if (foundDocPane) - return foundDocPane; - } - } - - return false; - } - - internal void EnsurePanePositionIsValid(DocumentPane pane) - { - if (pane == MainDocumentPane) - return; - - //A document pane must be at maindocument pane level or deeper - if (MainDocumentPane.Parent == this) - { - throw new InvalidOperationException("A document pane can't be positioned at this level!"); - } - } - - bool? FindPaneInPanel(ResizingPanel panel, Pane paneToFind) - { - foreach (UIElement child in panel.Children) - { - if (child == paneToFind) - return true; - else if (child is DockablePane) - return null; - else if (child is ResizingPanel) - { - bool? found = FindPaneInPanel(child as ResizingPanel, paneToFind); - if (found.HasValue && found.Value) - return true; - } - } - - return false; - } - - DocumentPane _mainDocumentPane; - - /// - /// Gets the main that can be used to add new document - /// - public DocumentPane MainDocumentPane - { - get { return _mainDocumentPane; } - internal set - { - if (_mainDocumentPane == null) - { - _mainDocumentPane = value; - - if (DocumentsSource != null) - { - foreach (object newDoc in DocumentsSource) - { - if (newDoc is DocumentContent) - MainDocumentPane.Items.Add(newDoc); - else if (newDoc is FrameworkElement) //limit objects to be at least framework elements - { - DocumentContent docContainer = new DocumentContent(); - docContainer.Content = newDoc; - - MainDocumentPane.Items.Add(docContainer); - } - } - } - } - else - { - _mainDocumentPane = value; - } - - } - } - - internal List FindContents() where T : ManagedContent - { - List resList = new List(); - - - if (Content is Pane) - { - foreach (ManagedContent c in ((Pane)Content).Items) - { - if (c is T) - { - resList.Add((T)c); - } - } - } - else if (Content is ResizingPanel) - { - FindContents(resList, Content as ResizingPanel); - } - - foreach (FloatingWindow flWindow in _floatingWindows) - { - foreach (ManagedContent c in flWindow.HostedPane.Items) - { - if (c is T) - resList.Add(c as T); - } - } - - if (_flyoutWindow != null && _flyoutWindow.ReferencedPane != null) - { - foreach (ManagedContent c in _flyoutWindow.ReferencedPane.Items) - { - if (c is T) - resList.Add(c as T); - } - } - - - return resList; - } - - - void FindContents(List listOfFoundContents, ResizingPanel parentPanel) where T : ManagedContent - { - foreach (UIElement child in parentPanel.Children) - { - if (child is Pane) - { - foreach (ManagedContent c in ((Pane)child).Items) - { - if (c is T) - { - listOfFoundContents.Add((T)c); - } - } - } - else if (child is ResizingPanel) - { - FindContents(listOfFoundContents, child as ResizingPanel); - } - } - } - - #endregion - - #region Floating windows management - List _floatingWindows = new List(); - - public DockableFloatingWindow[] FloatingWindows - { - get - { - if (_floatingWindows == null || - _floatingWindows.Count == 0) - return new DockableFloatingWindow[0]; - - return _floatingWindows.ToArray(); - } - } - - internal void RegisterFloatingWindow(DockableFloatingWindow floatingWindow) - { - if (_floatingWindows != null) - { - floatingWindow.FlowDirection = this.FlowDirection; - _floatingWindows.Add(floatingWindow); - } - } - - internal void UnregisterFloatingWindow(DockableFloatingWindow floatingWindow) - { - if (_floatingWindows != null) - _floatingWindows.Remove(floatingWindow); - } - - - - - protected override void OnInitialized(EventArgs e) - { - base.OnInitialized(e); - - this.CommandBindings.Clear(); - //this.CommandBindings.Add(new CommandBinding(ShowNavigatorWindowCommand, OnExecuteCommand, OnCanExecuteCommand)); - //this.CommandBindings.Add(new CommandBinding(ShowDocumentNavigatorWindowCommand, OnExecuteCommand, OnCanExecuteCommand)); - } - - protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) - { - if (e.Property == FlowDirectionProperty) - { - _floatingWindows.ForEach((DockableFloatingWindow fl) => - { - fl.FlowDirection = FlowDirection; - }); - - if (_flyoutWindow != null) - { - _flyoutWindow.FlowDirection = FlowDirection; - } - } - - base.OnPropertyChanged(e); - } - #endregion - - #region Commands - - private static object syncRoot = new object(); - - - private static RoutedUICommand showNavigatorCommand = null; - - /// - /// Get the command to show navigator window - /// - public static RoutedUICommand ShowNavigatorWindowCommand - { - get - { - lock (syncRoot) - { - if (null == showNavigatorCommand) - { - showNavigatorCommand = new RoutedUICommand("S_how navigator window", "Navigator", typeof(DockingManager)); - showNavigatorCommand.InputGestures.Add(new KeyGesture(Key.Tab, ModifierKeys.Control)); - } - - } - return showNavigatorCommand; - } - } - - NavigatorWindow navigatorWindow = null; - - void ShowNavigatorWindow() - { - HideNavigatorWindow(); - - if (navigatorWindow == null) - { - navigatorWindow = new NavigatorWindow(this); - navigatorWindow.Owner = Window.GetWindow(this); - } - - Point locDockingManager = this.PointToScreenDPI(new Point()); - navigatorWindow.Left = locDockingManager.X; - navigatorWindow.Top = locDockingManager.Y; - navigatorWindow.Width = this.ActualWidth; - navigatorWindow.Height = this.ActualHeight; - navigatorWindow.Show(); - navigatorWindow.Focus(); - } - - void HideNavigatorWindow() - { - if (navigatorWindow != null) - { - navigatorWindow.Close(); - navigatorWindow = null; - } - } - - - void OnExecuteCommand(object sender, ExecutedRoutedEventArgs e) - { - if (e.Command == ShowNavigatorWindowCommand && ((Keyboard.Modifiers & ModifierKeys.Control)>0) ) - { - ShowNavigatorWindow(); - e.Handled = true; - } - else if (e.Command == ShowDocumentNavigatorWindowCommand && ((Keyboard.Modifiers & ModifierKeys.Shift) > 0)) - { - ShowDocumentNavigatorWindow(); - e.Handled = true; - } - - } - - void OnCanExecuteCommand(object sender, CanExecuteRoutedEventArgs e) - { - e.CanExecute = true; - } - - - private static RoutedUICommand showDocumentNavigatorCommand = null; - - /// - /// Get the command to show document navigator window - /// - public static RoutedUICommand ShowDocumentNavigatorWindowCommand - { - get - { - lock (syncRoot) - { - if (null == showDocumentNavigatorCommand) - { - showDocumentNavigatorCommand = new RoutedUICommand("S_how document navigator window", "DocumentNavigator", typeof(DockingManager)); - showDocumentNavigatorCommand.InputGestures.Add(new KeyGesture(Key.Tab, ModifierKeys.Shift)); - } - - } - return showDocumentNavigatorCommand; - } - } - - DocumentNavigatorWindow documentNavigatorWindow = null; - - void ShowDocumentNavigatorWindow() - { - HideDocumentNavigatorWindow(); - - //if (documentNavigatorWindow == null) - { - documentNavigatorWindow = new DocumentNavigatorWindow(this); - documentNavigatorWindow.Owner = Window.GetWindow(this); - } - - if (MainDocumentPane == null) - return; - - Point locMainDocumentPane = MainDocumentPane.PointToScreenDPI(new Point()); - documentNavigatorWindow.Left = locMainDocumentPane.X; - documentNavigatorWindow.Top = locMainDocumentPane.Y; - documentNavigatorWindow.Width = MainDocumentPane.ActualWidth; - documentNavigatorWindow.Height = MainDocumentPane.ActualHeight; - documentNavigatorWindow.Show(); - documentNavigatorWindow.Focus(); - } - - void HideDocumentNavigatorWindow() - { - //if (documentNavigatorWindow != null) - //{ - // documentNavigatorWindow.Hide(); - - // //don't close this window to be more responsive - // documentNavigatorWindow.Close(); - // documentNavigatorWindow = null; - //} - } - - - #endregion - - - #region DockablePane operations - /// - /// Anchor a dockable pane to a border - /// - /// - /// - public void Anchor(Pane paneToAnchor, AnchorStyle anchor) - { - //remove the pane from its original children collection - FrameworkElement parentElement = paneToAnchor.Parent as FrameworkElement; - - if (anchor == AnchorStyle.None) - anchor = AnchorStyle.Right; - - //Change anchor border according to FlowDirection - if (FlowDirection == FlowDirection.RightToLeft) - { - if (anchor == AnchorStyle.Right) - anchor = AnchorStyle.Left; - else if (anchor == AnchorStyle.Left) - anchor = AnchorStyle.Right; - } - - //parentElement should be a DockingManager or a ResizingPanel - if (parentElement is ContentControl) - { - ((ContentControl)parentElement).Content = null; - } - - //and insert in the top level panel if exist - ResizingPanel toplevelPanel = Content as ResizingPanel; - - Orientation requestedOrientation = - (anchor == AnchorStyle.Bottom || anchor == AnchorStyle.Top) ? Orientation.Vertical : Orientation.Horizontal; - - //if toplevel panel contains only one child then just override the orientation - //as requested - if (toplevelPanel != null && toplevelPanel.Children.Count == 1) - toplevelPanel.Orientation = requestedOrientation; - - if (toplevelPanel == null || - toplevelPanel.Orientation != requestedOrientation) - { - //if toplevel panel doesn't exist or it has not the correct orientation - //we have to create a new one and set it as content of docking manager - toplevelPanel = new ResizingPanel(); - toplevelPanel.Orientation = requestedOrientation; - - FrameworkElement contentElement = Content as FrameworkElement; - Content = toplevelPanel; - - if (anchor == AnchorStyle.Left || - anchor == AnchorStyle.Top) - { - toplevelPanel.Children.Add(paneToAnchor); - toplevelPanel.InsertChildRelativeTo(contentElement, paneToAnchor, true); - } - else - { - toplevelPanel.Children.Add(paneToAnchor); - toplevelPanel.InsertChildRelativeTo(contentElement, paneToAnchor, false); - } - } - else - { - - //here we have a docking manager content with the right orientation - //so we have only to insert new child at correct position - if (anchor == AnchorStyle.Left || - anchor == AnchorStyle.Top) - { - //add new child before first one (prepend) - toplevelPanel.InsertChildRelativeTo(paneToAnchor, toplevelPanel.Children[0] as FrameworkElement, false); - } - else - { - //add new child after last one (append) - toplevelPanel.InsertChildRelativeTo(paneToAnchor, toplevelPanel.Children[toplevelPanel.Children.Count - 1] as FrameworkElement, true); - } - } - - //Refresh anchor style - DockablePane paneToAnchorAsDockablePane = paneToAnchor as DockablePane; - - if (paneToAnchorAsDockablePane != null) - { - paneToAnchorAsDockablePane.Anchor = anchor; - } - - - - if (anchor == AnchorStyle.Left || - anchor == AnchorStyle.Right) - { - double w = Math.Min( - ActualWidth / 2.0, - ResizingPanel.GetEffectiveSize(paneToAnchor).Width); - ResizingPanel.SetResizeWidth(paneToAnchor, new GridLength(w, GridUnitType.Pixel)); - ResizingPanel.SetResizeHeight(paneToAnchor, new GridLength(1.0, GridUnitType.Star)); - } - else - { - double h = Math.Min( - ActualHeight / 2.0, - ResizingPanel.GetEffectiveSize(paneToAnchor).Height); - ResizingPanel.SetResizeWidth(paneToAnchor, new GridLength(1.0, GridUnitType.Star)); - ResizingPanel.SetResizeHeight(paneToAnchor, new GridLength(h, GridUnitType.Pixel)); - } - - //refresh contents state - foreach (ManagedContent content in paneToAnchor.Items) - { - if (content is DockableContent) - { - ((DockableContent)content).SetStateToDock(); - } - } - - - paneToAnchor.Focus(); - } - - /// - /// Anchor a dockable pane () to a border of a docked pane - /// - /// Pane to anchor - /// Pane relative - /// - public void Anchor(Pane paneToAnchor, Pane relativePane, AnchorStyle anchor) - { - if (anchor == AnchorStyle.None) - anchor = AnchorStyle.Right; - - //Change anchor border according to FlowDirection - if (FlowDirection == FlowDirection.RightToLeft) - { - if (anchor == AnchorStyle.Right) - anchor = AnchorStyle.Left; - else if (anchor == AnchorStyle.Left) - anchor = AnchorStyle.Right; - } - - if (paneToAnchor is DockablePane && - relativePane is DockablePane) - Anchor(paneToAnchor as DockablePane, relativePane as DockablePane, anchor); - else if (paneToAnchor is DockablePane && - relativePane is DocumentPane) - Anchor(paneToAnchor as DockablePane, relativePane as DocumentPane, anchor); - else if (paneToAnchor is DocumentPane && - relativePane is DocumentPane) - Anchor(paneToAnchor as DocumentPane, relativePane as DocumentPane, anchor); - else - Debug.Assert(false); - } - - - /// - /// Anchor a dockable pane () to a border of a document pane - /// - /// Pane to anchor - /// Pane relative - /// - public void Anchor(DockablePane paneToAnchor, DocumentPane relativePane, AnchorStyle anchor) - { - if (anchor == AnchorStyle.None) - anchor = AnchorStyle.Right; - - //get a reference to the resizingpanel container of relativePane - ResizingPanel relativePaneContainer = LogicalTreeHelper.GetParent(relativePane) as ResizingPanel; - DocumentPaneResizingPanel relativeDocumentPaneContainer = relativePane.GetParentDocumentPaneResizingPanel(); - Orientation requestedOrientation = - (anchor == AnchorStyle.Bottom || anchor == AnchorStyle.Top) ? Orientation.Vertical : Orientation.Horizontal; - - if (relativePaneContainer == null) - { - Debug.Assert(relativePane.Parent == this); - - this.Content = null; - - relativeDocumentPaneContainer = new DocumentPaneResizingPanel(); - relativeDocumentPaneContainer.Children.Add(relativePane); - - relativePaneContainer = new ResizingPanel(); - relativePaneContainer.Orientation = requestedOrientation; - - this.Content = relativePaneContainer; - - relativePaneContainer.Children.Add(relativeDocumentPaneContainer); - } - - if (relativeDocumentPaneContainer == null) - { - relativeDocumentPaneContainer = new DocumentPaneResizingPanel(); - relativeDocumentPaneContainer.Orientation = requestedOrientation; - - - int indexOfPaneToReplace = relativePaneContainer.Children.IndexOf(relativePane); - relativePaneContainer.Children.RemoveAt(indexOfPaneToReplace); - - relativeDocumentPaneContainer.Children.Add(relativePane); - - relativePaneContainer.Children.Insert(indexOfPaneToReplace, relativeDocumentPaneContainer); - } - - relativePaneContainer = LogicalTreeHelper.GetParent(relativeDocumentPaneContainer) as ResizingPanel; - - //Debug.Assert(relativePaneContainer is DocumentPaneResizingPanel, "By now we can't have a pane without a resizing panel containing it"); - if (relativePaneContainer == null) - { - Debug.Assert(relativeDocumentPaneContainer.Parent == this); - - this.Content = null; - - relativePaneContainer = new ResizingPanel(); - relativePaneContainer.Orientation = requestedOrientation; - - this.Content = relativePaneContainer; - - relativePaneContainer.Children.Add(relativeDocumentPaneContainer); - } - - #region Create and setup container panel - if (relativePaneContainer != null) - { - //check if orientation is right - if (relativePaneContainer.Orientation != requestedOrientation) - { - //if the existing panel is not oriented as we want - //create a new one - ResizingPanel newPanel = new ResizingPanel(); - newPanel.Orientation = requestedOrientation; - - - if (newPanel.Orientation == Orientation.Horizontal) - ResizingPanel.SetResizeHeight(newPanel, ResizingPanel.GetResizeHeight(relativePane)); - else - ResizingPanel.SetResizeWidth(newPanel, ResizingPanel.GetResizeWidth(relativePane)); - - - //replace relative pane in its' container panel - //with this new panel - int indexofRelativePane = relativePaneContainer.Children.IndexOf(relativeDocumentPaneContainer); - relativePaneContainer.Children.Remove(relativeDocumentPaneContainer); - relativePaneContainer.Children.Insert(indexofRelativePane, newPanel); - - //now we have a panel correctly placed in the tree - newPanel.Children.Add(relativeDocumentPaneContainer); - - //use InsertChildRelativeTo function to add a resizingsplitter between - //the two children - newPanel.InsertChildRelativeTo( - paneToAnchor, relativeDocumentPaneContainer, anchor == AnchorStyle.Right || anchor == AnchorStyle.Bottom); - } - else - { - - if (anchor == AnchorStyle.Left || - anchor == AnchorStyle.Top) - { - //add new child before first (prepend) - relativePaneContainer.InsertChildRelativeTo(paneToAnchor, - relativeDocumentPaneContainer, false); - } - else - { - //add new child after last (append) - relativePaneContainer.InsertChildRelativeTo(paneToAnchor, - relativeDocumentPaneContainer, true); - } - } - - } - #endregion - - - - if (anchor == AnchorStyle.Left || - anchor == AnchorStyle.Right) - { - double w = Math.Min( - ResizingPanel.GetEffectiveSize(relativePane).Width / 2.0, - ResizingPanel.GetEffectiveSize(paneToAnchor).Width); - ResizingPanel.SetResizeWidth(paneToAnchor, new GridLength(w, GridUnitType.Pixel)); - ResizingPanel.SetResizeHeight(paneToAnchor, new GridLength(1.0, GridUnitType.Star)); - } - else - { - double h = Math.Min( - ResizingPanel.GetEffectiveSize(relativePane).Height / 2.0, - ResizingPanel.GetEffectiveSize(paneToAnchor).Height); - ResizingPanel.SetResizeWidth(paneToAnchor, new GridLength(1.0, GridUnitType.Star)); - ResizingPanel.SetResizeHeight(paneToAnchor, new GridLength(h, GridUnitType.Pixel)); - } - - //refresh contents state - foreach (DockableContent draggedContent in paneToAnchor.Items) - { - draggedContent.SetStateToDock(); - } - - - //than set the new anchor style for the pane - paneToAnchor.Anchor = anchor; - paneToAnchor.Focus(); - } - - - - /// - /// Anchor a document pane () to a border of an other document pane - /// - /// Pane to anchor - /// Pane relative - /// - public void Anchor(DocumentPane paneToAnchor, DocumentPane relativePane, AnchorStyle anchor) - { - if (anchor == AnchorStyle.None) - anchor = AnchorStyle.Right; - - //get a reference to the resizingpanel container of relativePane - ResizingPanel relativePaneContainer = LogicalTreeHelper.GetParent(relativePane) as ResizingPanel; - DocumentPaneResizingPanel relativeDocumentPaneContainer = relativePane.GetParentDocumentPaneResizingPanel(); - Orientation requestedOrientation = - (anchor == AnchorStyle.Bottom || anchor == AnchorStyle.Top) ? Orientation.Vertical : Orientation.Horizontal; - - if (relativePaneContainer == null) - { - Debug.Assert(relativePane.Parent == this); - - - relativeDocumentPaneContainer = new DocumentPaneResizingPanel(); - relativePaneContainer = relativeDocumentPaneContainer; - - relativeDocumentPaneContainer.Orientation = requestedOrientation; - this.Content = relativePaneContainer; - - relativePaneContainer.Children.Add(relativePane); - - } - - if (relativeDocumentPaneContainer == null) - { - relativeDocumentPaneContainer = new DocumentPaneResizingPanel(); - relativeDocumentPaneContainer.Orientation = requestedOrientation; - - - int indexOfPaneToReplace = relativePaneContainer.Children.IndexOf(relativePane); - relativePaneContainer.Children.RemoveAt(indexOfPaneToReplace); - - relativeDocumentPaneContainer.Children.Add(relativePane); - - relativePaneContainer.Children.Insert(indexOfPaneToReplace, relativeDocumentPaneContainer); - - relativePaneContainer = relativeDocumentPaneContainer; - } - - Debug.Assert(relativePaneContainer != null, "By now we can't have a pane without a resizing panel containing it"); - - #region Create and setup container panel - if (relativePaneContainer != null) - { - //check if orientation is right - if (relativePaneContainer.Orientation != requestedOrientation) - { - //if the existing panel is not oriented as we want - //create a new one - DocumentPaneResizingPanel newPanel = new DocumentPaneResizingPanel(); - newPanel.Orientation = requestedOrientation; - - //replace relative pane in its' container panel - //with this new panel - int indexofRelativePane = relativePaneContainer.Children.IndexOf(relativePane); - relativePaneContainer.Children.Remove(relativePane); - relativePaneContainer.Children.Insert(indexofRelativePane, newPanel); - - //now we have a panel correctly placed in the tree - newPanel.Children.Add(relativePane); - - //use InsertChildRelativeTo function to add a resizingsplitter between - //the two children - newPanel.InsertChildRelativeTo( - paneToAnchor, relativePane, anchor == AnchorStyle.Right || anchor == AnchorStyle.Bottom); - - relativePaneContainer = newPanel; - } - else - { - if (anchor == AnchorStyle.Left || - anchor == AnchorStyle.Top) - { - //add new child before first (prepend) - relativePaneContainer.InsertChildRelativeTo(paneToAnchor, - relativePane, false); - } - else - { - //add new child after last (append) - relativePaneContainer.InsertChildRelativeTo(paneToAnchor, - relativePane, true); - } - } - - } - #endregion - - paneToAnchor.Focus(); - - (paneToAnchor.SelectedItem as ManagedContent).SetAsActive(); - if (paneToAnchor.SelectedItem is DocumentContent) - ActiveDocument = paneToAnchor.SelectedItem as DocumentContent; - - } - - /// - /// Anchor a dockable pane () to a border of an other dockable pane - /// - /// Pane to anchor - /// Pane relative - /// - public void Anchor(DockablePane paneToAnchor, DockablePane relativePane, AnchorStyle anchor) - { - if (anchor == AnchorStyle.None) - anchor = AnchorStyle.Right; - - //get a refernce to the resizingpanel container of relativePane - ResizingPanel relativePaneContainer = LogicalTreeHelper.GetParent(relativePane) as ResizingPanel; - Orientation requestedOrientation = - (anchor == AnchorStyle.Bottom || anchor == AnchorStyle.Top) ? Orientation.Vertical : Orientation.Horizontal; - - if (relativePaneContainer == null) - { - Debug.Assert(relativePane.Parent == this); - - relativePaneContainer = new ResizingPanel(); - relativePaneContainer.Orientation = requestedOrientation; - this.Content = relativePaneContainer; - relativePaneContainer.Children.Add(relativePane); - } - - Debug.Assert(relativePaneContainer != null, "By now we can't have a pane without a resizing panel containing it"); - - #region Create and setup container panel - if (relativePaneContainer != null) - { - //check if orientation is right - if (relativePaneContainer.Orientation != requestedOrientation) - { - //if the existing panel is not oriented as we want - //create a new one - ResizingPanel newPanel = new ResizingPanel(); - newPanel.Orientation = requestedOrientation; - - if (newPanel.Orientation == Orientation.Horizontal) - ResizingPanel.SetResizeHeight(newPanel, ResizingPanel.GetResizeHeight(relativePane)); - else - ResizingPanel.SetResizeWidth(newPanel, ResizingPanel.GetResizeWidth(relativePane)); - - //replace relative pane in its' container panel - //with this new panel - int indexofRelativePane = relativePaneContainer.Children.IndexOf(relativePane); - relativePaneContainer.Children.Remove(relativePane); - relativePaneContainer.Children.Insert(indexofRelativePane, newPanel); - - //now we have a panel correctly placed in the tree - newPanel.Children.Add(relativePane); - newPanel.InsertChildRelativeTo( - paneToAnchor, relativePane, anchor == AnchorStyle.Right || anchor == AnchorStyle.Bottom); - - relativePaneContainer = newPanel; - } - else - { - if (anchor == AnchorStyle.Left || - anchor == AnchorStyle.Top) - { - //add new child before first (prepend) - relativePaneContainer.InsertChildRelativeTo(paneToAnchor, - relativePane, false); - } - else - { - //add new child after last (append) - relativePaneContainer.InsertChildRelativeTo(paneToAnchor, - relativePane, true); - } - } - - } - #endregion - - //than set the new anchor style for the pane - paneToAnchor.Anchor = relativePane.Anchor; - - if (anchor == AnchorStyle.Left || - anchor == AnchorStyle.Right) - { - double w = Math.Min( - ResizingPanel.GetEffectiveSize(relativePane).Width / 2.0, - ResizingPanel.GetEffectiveSize(paneToAnchor).Width); - ResizingPanel.SetResizeWidth(paneToAnchor, new GridLength(w, GridUnitType.Pixel)); - ResizingPanel.SetResizeHeight(paneToAnchor, new GridLength(1.0, GridUnitType.Star)); - } - else - { - double h = Math.Min( - ResizingPanel.GetEffectiveSize(relativePane).Height / 2.0, - ResizingPanel.GetEffectiveSize(paneToAnchor).Height); - ResizingPanel.SetResizeWidth(paneToAnchor, new GridLength(1.0, GridUnitType.Star)); - ResizingPanel.SetResizeHeight(paneToAnchor, new GridLength(h, GridUnitType.Pixel)); - } - - //refresh contents state - foreach (DockableContent draggedContent in paneToAnchor.Items) - { - draggedContent.SetStateToDock(); - } - - if (relativePaneContainer != null) - relativePaneContainer.AdjustPanelSizes(); - - paneToAnchor.Focus(); - } - - - public void DropInto(Pane paneDragged, Pane paneToDropInto) - { - if (paneDragged is DockablePane && - paneToDropInto is DockablePane) - DropInto(paneDragged as DockablePane, paneToDropInto as DockablePane); - else if (paneDragged is DockablePane && - paneToDropInto is DocumentPane) - DropInto(paneDragged as DockablePane, paneToDropInto as DocumentPane); - else if (paneDragged is DocumentPane && - paneToDropInto is DocumentPane) - DropInto(paneDragged as DocumentPane, paneToDropInto as DocumentPane); - else - Debug.Assert(false); - } - - - public void DropInto(DocumentPane paneDragged, DocumentPane paneToDropInto) - { - //transfer tha contents of dragged pane (conatined in a FloatingWindow) - //to the pane which user select - ManagedContent contentToFocus = null; - while (paneDragged.Items.Count > 0) - { - ManagedContent contentToTransfer = paneDragged.RemoveContent(0); - paneToDropInto.Items.Insert(0, contentToTransfer); - contentToFocus = contentToTransfer; - } - - - paneToDropInto.SelectedIndex = 0; - paneToDropInto.Focus(); - if (contentToFocus != null) - contentToFocus.SetAsActive(); - } - - public void DropInto(DockablePane paneDragged, DocumentPane paneToDropInto) - { - if (paneToDropInto != MainDocumentPane) - paneToDropInto = MainDocumentPane; - - //transfer contents of dragged pane (contained in a FloatingWindow) - //to the pane which user select, taking care of setting contents state - //to Dock (using Dock() method of class DockablePane). - while (paneDragged.Items.Count > 0) - { - ManagedContent contentToTransfer = paneDragged.RemoveContent(0); - paneToDropInto.Items.Add(contentToTransfer); - - - DockableContent dockContentToTransfer = contentToTransfer as DockableContent; - - if (dockContentToTransfer != null) - dockContentToTransfer.SetStateToDocument(); - } - - paneToDropInto.SelectedIndex = paneToDropInto.Items.Count - 1; - paneToDropInto.Focus(); - } - - public void DropInto(DockablePane paneDragged, DockablePane paneToDropInto) - { - //transfer tha contents of dragged pane (conatined in a FloatingWindow) - //to the pane which user select, taking care of setting contents state - //to Dock (using Dock() method of class DockablePane). - while (paneDragged.Items.Count > 0) - { - ManagedContent contentToTransfer = paneDragged.RemoveContent(0); - paneToDropInto.Items.Add(contentToTransfer); - - - DockableContent dockContentToTransfer = contentToTransfer as DockableContent; - - if (dockContentToTransfer != null) - dockContentToTransfer.SetStateToDock(); - } - - - paneToDropInto.SelectedIndex = paneToDropInto.Items.Count - 1; - paneToDropInto.Focus(); - } - - bool RemoveContentFromTabGroup(DockableContent contentToRemove) - { - foreach (Panel anchorTabPanel in _anchorTabPanels) - { - foreach (DockablePaneAnchorTabGroup group in anchorTabPanel.Children) - { - foreach (DockablePaneAnchorTab tab in group.Children) - { - if (tab.ReferencedContent == contentToRemove) - { - group.Children.Remove(tab); - if (group.Children.Count == 0) - anchorTabPanel.Children.Remove(group); - - return true; - } - } - } - } - - return false; - } - - /// - /// Remove a pane from border tab groups - /// - /// Pane to remove - /// True if pane was removed, false otherwise - bool RemovePaneFromTabGroups(DockablePane paneToRemove) - { - foreach (Panel anchorTabPanel in _anchorTabPanels) - { - foreach (DockablePaneAnchorTabGroup group in anchorTabPanel.Children) - { - if (group.ReferencedPane == paneToRemove) - { - //foreach (DockablePaneAnchorTab tab in group.Children) - //{ - // tab.ReferencedContent.Icon = tab.Icon; - // tab.Icon = null; - //} - - anchorTabPanel.Children.Remove(group); - return true; - } - } - } - - - return false; - } - - /// - /// Autohides/redock a dockable pane - /// - /// Pane to auto hide/redock - public void ToggleAutoHide(DockablePane pane) - { - if (!_OnApplyTemplateFlag) - { - Debug.WriteLine("Layout has been restored before creating DockingManager object: force WPF to apply the template..."); - ApplyTemplate(); - } - - - //if pane is in auto hide state then is found - //referenced by a DockablePaneAnchorTabGroup - //if so redock it in its original position - if (RemovePaneFromTabGroups(pane)) - { - #region Pane is present in tab anchor panels - DockableContent selectedContent = - _flyoutWindow != null && - _flyoutWindow.ReferencedPane != null && - _flyoutWindow.ReferencedPane.Items.Count > 0 ? _flyoutWindow.ReferencedPane.Items[0] as DockableContent : - pane.Items[0] as DockableContent; - - HideAutoHideWindow(); - - ResizingPanel parentPanel = pane.Parent as ResizingPanel; - if (parentPanel != null && parentPanel.Children.Count >= 3) - { - parentPanel.AdjustPanelSizes(); - } - - //reset content state to docked - foreach (DockableContent content in pane.Items) - { - content.SetStateToDock(); - } - - pane.Focus(); - pane.SelectedItem = selectedContent; - ActiveContent = selectedContent; - #endregion - } - else - { - #region Pane is not auto hidden - //Create e new group - DockablePaneAnchorTabGroup group = new DockablePaneAnchorTabGroup(); - - //associate it to the pane - group.ReferencedPane = pane; - - DockableContent selectedContent = pane.SelectedItem as DockableContent; - - //add contents to it - foreach (DockableContent content in pane.Items) - { - DockablePaneAnchorTab tab = new DockablePaneAnchorTab(); - tab.ReferencedContent = content; - tab.Anchor = pane.Anchor; - tab.Icon = content.Icon; - - - group.Children.Add(tab); - content.SetStateToAutoHide(); - } - - //place group under correct anchor tabpanel - switch (pane.Anchor) - { - case AnchorStyle.Left: - if (_leftAnchorTabPanel != null) - _leftAnchorTabPanel.Children.Add(group); - break; - case AnchorStyle.Top: - if (_topAnchorTabPanel != null) - _topAnchorTabPanel.Children.Add(group); - break; - case AnchorStyle.Right: - if (_rightAnchorTabPanel != null) - _rightAnchorTabPanel.Children.Add(group); - break; - case AnchorStyle.Bottom: - if (_bottomAnchorTabPanel != null) - _bottomAnchorTabPanel.Children.Add(group); - break; - } - - #endregion - } - - //refresh arrangements traversing bottom-up visual tree - FrameworkElement parentElement = pane.Parent as FrameworkElement; - - while (parentElement != null) - { - parentElement.InvalidateMeasure(); - parentElement = parentElement.Parent as FrameworkElement; - } - - - } - - #endregion - - - #region Hide/Show contents - - List _hiddenContents = new List(); - -#if DEBUG - internal void CheckHiddenState(DockableContent contentToCheck) - { - if (contentToCheck.State == DockableContentState.Hidden) - Debug.Assert(_hiddenContents.Contains(contentToCheck)); - else - Debug.Assert(!_hiddenContents.Contains(contentToCheck)); - } -#endif - /// - /// Hide a dockable content removing it from its container - /// - /// Content to hide - /// Note that if you simply remove a content from its container without calling this method, the - /// layout serializer component can't managed correctly the removed content. - public void Hide(DockableContent content) - { - if (content.State == DockableContentState.Hidden) - return; - - if (!content.IsCloseable) - return; - - content.SaveCurrentStateAndPosition(); - - if (content.State == DockableContentState.AutoHide) - { - HideAutoHideWindow(); - RemoveContentFromTabGroup(content); - } - - if (content.State == DockableContentState.FloatingWindow || - content.State == DockableContentState.DockableWindow) - { - DockableFloatingWindow floatingWindow = Window.GetWindow(content) as DockableFloatingWindow; - - if (floatingWindow != null && - floatingWindow.HostedPane.HasSingleItem) - { - floatingWindow.Close(); - } - - content.DetachFromContainerPane(); - } - else - { - content.DetachFromContainerPane(); - } - - - if (content.State != DockableContentState.Hidden) - { - content.SetStateToHidden(); - - Debug.Assert(!_hiddenContents.Contains(content)); - _hiddenContents.Add(content); - } - - if (ActiveDocument == content) - ActiveDocument = null; - - if (ActiveContent == content) - ActiveContent = null; - } - - /// - /// Show or add a document in AvalonDock - /// - /// Document to show/add. - /// If document provided is not present in the list, this method inserts it in first position of collection. - /// In both cases select it in the container . - public void Show(DocumentContent document) - { - bool found = false; - foreach (DocumentContent doc in Documents) - { - if (doc == document) - { - found = true; - break; - } - } - - if (!found && MainDocumentPane != null) - { - if (document.Parent is DocumentPane) - { - ((DocumentPane)document.Parent).Items.Clear(); - } - //if (document.Parent != null) - //{ - // throw new InvalidProgramException( - // string.Format("Disconnnect first the document from its logical parent ({0})", - // document.Parent.GetType())); - //} - - MainDocumentPane.Items.Insert(0, document); - } - - //DocumentPane docPane = document.ContainerPane as DocumentPane; - - //if (docPane != null) - //{ - // docPane.SelectedItem = document; - // if (document.Content is IInputElement) - // Keyboard.Focus(document.Content as IInputElement); - //} - document.SetAsActive(); - } - - /// - /// Show a dockable content in its container - /// - /// Content to show - public void Show(DockableContent content) - { - if (content.SavedStateAndPosition != null) - Show(content, content.SavedStateAndPosition.State); - else - Show(content, DockableContentState.Docked); - } - - /// - /// Show a dockable content in its container with a desidered state - /// - /// Content to show - /// State desidered - public void Show(DockableContent content, DockableContentState desideredState) - { - Show(content, desideredState, AnchorStyle.None); - } - - /// - /// Show a dockable content in its container with a desidered state - /// - /// Content to show - /// State desidered - /// Border to which anchor the newly created container pane - /// - public void Show(DockableContent content, DockableContentState desideredState, AnchorStyle desideredAnchor) - { - #region Dockable content - - if (desideredState == DockableContentState.Hidden)//??!!show hidden? - Hide(content); - - if (content.State == DockableContentState.AutoHide) - { - ShowFlyoutWindow(content); - } - else if (content.State == DockableContentState.Docked || - content.State == DockableContentState.Document) - { - if (content.ContainerPane == null) - { - //Problem!? try to rescue - if (content.State == DockableContentState.Docked) - { - //find the the pane which the desidered anchor style - DockablePane foundPane = this.FindChildDockablePane(desideredAnchor); - if (foundPane != null) - foundPane.Items.Add(content); - else - { - //if no suitable pane was found create e new one on the fly - DockablePane pane = new DockablePane(); - pane.Items.Add(content); - Anchor(pane, desideredAnchor); - } - } - else - { - //add to main document pane - MainDocumentPane.Items.Add(content); - } - - } - - if (content.ContainerPane.GetManager() == null) - { - //disconnect the parent pane from previous panel - //((Panel)content.ContainerPane.Parent).Children.Remove(content.ContainerPane); - if (content.ContainerPane.Parent != null) - { - ((Panel)content.ContainerPane.Parent).Children.Remove(content.ContainerPane); - } - Anchor(content.ContainerPane, desideredAnchor); - } - - if (desideredState == DockableContentState.DockableWindow || - desideredState == DockableContentState.FloatingWindow) - { - DockableFloatingWindow floatingWindow = new DockableFloatingWindow(this, content); - floatingWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; - floatingWindow.Owner = Window.GetWindow(this); - //if (content.Content != null) - //{ - // floatingWindow.Width = Math.Min(((FrameworkElement)content.Content).ActualWidth, ResizingPanel.GetResizeWidth(content.ContainerPane)); - // floatingWindow.Height = Math.Min(((FrameworkElement)content.Content).ActualHeight, ResizingPanel.GetResizeHeight(content.ContainerPane)); - //} - //else - //{ - floatingWindow.Width = 400; - floatingWindow.Height = 400; - //} - RegisterFloatingWindow(floatingWindow); - floatingWindow.Show(); - - } - else if (desideredState == DockableContentState.AutoHide) - { - if (content.ContainerPane != null) - content.ContainerPane.SelectedItem = this; - //content.FocusContent(); - //if (content.Content is IInputElement) - // Keyboard.Focus(content.Content as IInputElement); - content.SetAsActive(); - - DockablePane.ToggleAutoHideCommand.Execute(null, content.ContainerPane); - } - else if (desideredState == DockableContentState.Document) - { - DocumentPane docPane = MainDocumentPane; - if (docPane != null) - { - docPane.Items.Add(content.DetachFromContainerPane()); - docPane.SelectedItem = content; - content.SetStateToDocument(); - } - } - else - { - content.ContainerPane.SelectedItem = content; - content.SetAsActive(); - - DockablePane dockParent = content.ContainerPane as DockablePane; - if (content.ActualWidth == 0.0 && ( - dockParent.Anchor == AnchorStyle.Left || dockParent.Anchor == AnchorStyle.Right)) - { - ResizingPanel.SetResizeWidth(dockParent, new GridLength(200)); - ResizingPanel.SetEffectiveSize(dockParent, new Size(200, 0.0)); - } - else if (content.ActualWidth == 0.0 && ( - dockParent.Anchor == AnchorStyle.Left || dockParent.Anchor == AnchorStyle.Right)) - { - ResizingPanel.SetResizeWidth(dockParent, new GridLength(200)); - ResizingPanel.SetEffectiveSize(dockParent, new Size(200, 0.0)); - } - - - - //ActiveContent = content; - ////content.FocusContent(); - //if (content.Content is IInputElement) - // Keyboard.Focus(content.Content as IInputElement); - } - } - else if ( - content.State == DockableContentState.DockableWindow || - content.State == DockableContentState.FloatingWindow) - { - FloatingDockablePane containerPane = content.ContainerPane as FloatingDockablePane; - - if (containerPane != null) - { - //check if visible on the primary screen - if (containerPane.FloatingWindow.Left > System.Windows.SystemParameters.PrimaryScreenWidth) - containerPane.FloatingWindow.Left = System.Windows.SystemParameters.PrimaryScreenWidth - containerPane.FloatingWindow.Width; - if (containerPane.FloatingWindow.Top > System.Windows.SystemParameters.PrimaryScreenHeight) - containerPane.FloatingWindow.Top = System.Windows.SystemParameters.PrimaryScreenHeight - containerPane.FloatingWindow.Height; - - - containerPane.FloatingWindow.Activate(); - } - - } - else if (content.State == DockableContentState.Document) - { - if (content.ContainerPane != null) - content.ContainerPane.SelectedItem = this; - //content.FocusContent(); - //if (content.Content is IInputElement) - // Keyboard.Focus(content.Content as IInputElement); - content.SetAsActive(); - } - else if (content.State == DockableContentState.Hidden) - { - Debug.Assert(_hiddenContents.Contains(content)); - - _hiddenContents.Remove(content); - - if (desideredState == DockableContentState.Docked || - desideredState == DockableContentState.AutoHide) - { - - if (content.SavedStateAndPosition != null && - content.SavedStateAndPosition.ContainerPane != null && - content.SavedStateAndPosition.ChildIndex >= 0 && - content.SavedStateAndPosition.ContainerPane.GetManager() == this && - desideredState == DockableContentState.Docked) - { - //ok previous container pane is here.. - Pane prevPane = content.SavedStateAndPosition.ContainerPane; - if (content.SavedStateAndPosition.ChildIndex < prevPane.Items.Count) - { - prevPane.Items.Insert(content.SavedStateAndPosition.ChildIndex, content); - } - else - { - prevPane.Items.Add(content); - } - - prevPane.SelectedItem = content; - content.SetStateToDock(); - } - else - { - DockablePane newHostpane = new DockablePane(); - newHostpane.Items.Add(content); - - if (desideredAnchor == AnchorStyle.None && - content.SavedStateAndPosition != null && - content.SavedStateAndPosition.Anchor != AnchorStyle.None) - desideredAnchor = content.SavedStateAndPosition.Anchor; - - if (desideredAnchor == AnchorStyle.None) - desideredAnchor = AnchorStyle.Right; - - if (desideredAnchor == AnchorStyle.Left || - desideredAnchor == AnchorStyle.Right) - { - double w = 200; - if (content.SavedStateAndPosition != null && - !double.IsInfinity(content.SavedStateAndPosition.Width) && - !double.IsNaN(content.SavedStateAndPosition.Width)) - w = content.SavedStateAndPosition.Width; - - ResizingPanel.SetResizeWidth(newHostpane, new GridLength(w)); - ResizingPanel.SetEffectiveSize(newHostpane, new Size(w, 0.0)); - } - else - { - double h = 200; - if (content.SavedStateAndPosition != null && - !double.IsInfinity(content.SavedStateAndPosition.Height) && - !double.IsNaN(content.SavedStateAndPosition.Height)) - h = content.SavedStateAndPosition.Height; - - ResizingPanel.SetResizeHeight(newHostpane, new GridLength(h)); - ResizingPanel.SetEffectiveSize(newHostpane, new Size(0.0, h)); - } - - Anchor(newHostpane, desideredAnchor); - - if (desideredState == DockableContentState.AutoHide) - { - DockablePane.ToggleAutoHideCommand.Execute(null, newHostpane); - } - - } - - ActiveContent = content; - } - else if (desideredState == DockableContentState.DockableWindow || - desideredState == DockableContentState.FloatingWindow) - { - DockablePane newHostpane = null; - FloatingDockablePane prevHostpane = null; - if (content.SavedStateAndPosition != null && content.SavedStateAndPosition.ContainerPane != null && content.SavedStateAndPosition.ContainerPane is FloatingDockablePane) - { - prevHostpane = content.SavedStateAndPosition.ContainerPane as FloatingDockablePane; - if (!prevHostpane.Items.Contains(content)) - prevHostpane.Items.Add(content); - } - else - { - newHostpane = new DockablePane(); - newHostpane.Items.Add(content); - } - - content.SetStateToDock(); - - if (prevHostpane != null) - { - DockableFloatingWindow floatingWindow = new DockableFloatingWindow(this, content); - floatingWindow.WindowStartupLocation = WindowStartupLocation.Manual; - floatingWindow.Top = prevHostpane.FloatingWindow.Top; - floatingWindow.Left = prevHostpane.FloatingWindow.Left; - floatingWindow.Width = prevHostpane.FloatingWindow.Width; - floatingWindow.Height = prevHostpane.FloatingWindow.Height; - floatingWindow.Owner = Window.GetWindow(this); - RegisterFloatingWindow(floatingWindow); - floatingWindow.Show(); - } - else if (newHostpane != null) - { - DockableFloatingWindow floatingWindow = new DockableFloatingWindow(this, newHostpane); - floatingWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; - floatingWindow.Width = 200; - floatingWindow.Height = 500; - floatingWindow.Owner = Window.GetWindow(this); - RegisterFloatingWindow(floatingWindow); - floatingWindow.Show(); - } - - } - else if (desideredState == DockableContentState.Document) - { - DocumentPane docPane = MainDocumentPane; - if (docPane != null) - { - docPane.Items.Add(content); - docPane.SelectedItem = content; - content.SetStateToDocument(); - } - } - } - - #endregion - -#if DEBUG - CheckHiddenState(content); -#endif - } - #endregion - - - #region Anchor Style Update routines - protected override Size ArrangeOverride(Size arrangeBounds) - { - //at the moment this is the easy way to get anchor properties always updated - if (this.Content as ResizingPanel != null) - UpdateAnchorStyle(); - - return base.ArrangeOverride(arrangeBounds); - } - - internal void UpdateAnchorStyle() - { - ResizingPanel mainPanel = this.Content as ResizingPanel; - Debug.Assert(mainPanel != null); - - - UpdateAnchorStyle(mainPanel); - } - - /// - /// Update the property relative to the object - /// - /// - /// - /// Traverse the logical tree starting from root and set property of dockable pane found. - void UpdateAnchorStyle(ResizingPanel panel) - { - AnchorStyle currentAnchor = panel.Orientation == Orientation.Horizontal ? AnchorStyle.Left : AnchorStyle.Top; - bool foundDocumentContent = false; - - foreach (FrameworkElement child in panel.Children) - { - if (child is ResizingPanel) - { - if (!foundDocumentContent && - GetMainDocumentPane(child as ResizingPanel) != null) - { - foundDocumentContent = true; - currentAnchor = panel.Orientation == Orientation.Horizontal ? AnchorStyle.Right : AnchorStyle.Bottom; - UpdateAnchorStyle(child as ResizingPanel); - } - else - ForceAnchorStyle(child as ResizingPanel, currentAnchor); - } - else if (child is DocumentPane) - { - foundDocumentContent = true; - currentAnchor = panel.Orientation == Orientation.Horizontal ? AnchorStyle.Right : AnchorStyle.Bottom; - } - else if (child is DockablePane) - { - (child as DockablePane).Anchor = currentAnchor; - } - } - } - - /// - /// Called by whene a object has been found - /// - /// - /// - void ForceAnchorStyle(ResizingPanel panel, AnchorStyle forcedAnchor) - { - foreach (FrameworkElement child in panel.Children) - { - if (child is ResizingPanel) - { - ForceAnchorStyle((child as ResizingPanel), forcedAnchor); - } - else if ((child is DockablePane)) - { - ((DockablePane)child).Anchor = forcedAnchor; - } - } - } - - #endregion - - - #region Flyout window - FlyoutPaneWindow _flyoutWindow = null; - WindowInteropWrapper _wndInteropWrapper = null; - - void HideAutoHideWindow() - { - if (_flyoutWindow != null) - { - _flyoutWindow.Height = 0.0; - _flyoutWindow.Width = 0.0; - _flyoutWindow.Close(); - _flyoutWindow = null; - } - } - - - internal void ShowFlyoutWindow(DockableContent content) - { - //check if parent window is Active - Window parentWindow = Window.GetWindow(this); - if (parentWindow == null) - return; - - if (!parentWindow.IsActive && (_flyoutWindow == null || !_flyoutWindow.IsActive)) - return; - - - //check if content is already visible in a flyout window - if (_flyoutWindow != null && - _flyoutWindow.ReferencedPane.Items.Contains(content)) - return; - - //hide previous create window - HideAutoHideWindow(); - - //select this content in the referenced pane - content.ContainerPane.SelectedItem = content; - - - if (_wndInteropWrapper == null) - { - _wndInteropWrapper = new WindowInteropWrapper(); - _wndInteropWrapper.OnWindowPosChanging+=new EventHandler(_wndInteropWrapper_OnWindowPosChanging); - } - _wndInteropWrapper.AttachedObject = parentWindow; - - //create e new window - _flyoutWindow = new FlyoutPaneWindow(this, content); - _flyoutWindow.Owner = parentWindow; - _flyoutWindow.FlowDirection = this.FlowDirection; - - UpdateFlyoutWindowPosition(true); - - _flyoutWindow.Closing += new System.ComponentModel.CancelEventHandler(_flyoutWindow_Closing); - _flyoutWindow.Show(); - - //this.Focus(); - } - - protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo) - { - UpdateFlyoutWindowPosition(); - base.OnRenderSizeChanged(sizeInfo); - } - - - void _flyoutWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) - { - _flyoutWindow.Closing -= new System.ComponentModel.CancelEventHandler(_flyoutWindow_Closing); - _flyoutWindow.Owner = null; - _wndInteropWrapper.AttachedObject = null; - } - - void UpdateFlyoutWindowPosition() - { - UpdateFlyoutWindowPosition(false); - } - - void UpdateFlyoutWindowPosition(bool initialSetup) - { - if (_flyoutWindow == null) - return; - - Debug.WriteLine("_leftAnchorTabPanel " + _leftAnchorTabPanel.ActualWidth + " - " + _leftAnchorTabPanel.Children.Count); - - double leftTabsWidth = FlowDirection == FlowDirection.LeftToRight ? _leftAnchorTabPanel.ActualWidth : _rightAnchorTabPanel.ActualWidth; - double rightTabsWidth = FlowDirection == FlowDirection.LeftToRight ? _rightAnchorTabPanel.ActualWidth : _leftAnchorTabPanel.ActualWidth; - double topTabsHeight = _topAnchorTabPanel.ActualHeight; - double bottomTabsHeight = _bottomAnchorTabPanel.ActualHeight; - - Point locDockingManager = HelperFunc.PointToScreenWithoutFlowDirection(this, new Point()); - double resWidth = initialSetup ? ResizingPanel.GetResizeWidth(_flyoutWindow.ReferencedPane).Value : _flyoutWindow.Width; - double resHeight = initialSetup ? ResizingPanel.GetResizeHeight(_flyoutWindow.ReferencedPane).Value : _flyoutWindow.Height; - //double resWidth = initialSetup ? ResizingPanel.GetEffectiveSize(_flyoutWindow.ReferencedPane).Width : _flyoutWindow.Width; - //double resHeight = initialSetup ? ResizingPanel.GetEffectiveSize(_flyoutWindow.ReferencedPane).Height : _flyoutWindow.Height; - - _flyoutWindow.MinLeft = locDockingManager.X; - _flyoutWindow.MinTop = locDockingManager.Y; - - if (_flyoutWindow.ReferencedPane.Anchor == AnchorStyle.Right) - { - _flyoutWindow.Top = locDockingManager.Y + topTabsHeight; - _flyoutWindow.Height = this.ActualHeight - topTabsHeight - bottomTabsHeight; - - _flyoutWindow.MaxWidth = ActualWidth - rightTabsWidth; - _flyoutWindow.MaxHeight = ActualHeight; - - if (initialSetup) - { - _flyoutWindow.Left = FlowDirection == FlowDirection.LeftToRight ? locDockingManager.X + this.ActualWidth - rightTabsWidth : locDockingManager.X + leftTabsWidth; - _flyoutWindow.Width = 0.0; - _flyoutWindow.TargetWidth = resWidth; - } - else - { - if (!_flyoutWindow.IsOpening && !_flyoutWindow.IsClosing) - _flyoutWindow.Left = FlowDirection == FlowDirection.LeftToRight ? locDockingManager.X + this.ActualWidth - rightTabsWidth - _flyoutWindow.Width : locDockingManager.X + leftTabsWidth; - } - } - if (_flyoutWindow.ReferencedPane.Anchor == AnchorStyle.Left) - { - _flyoutWindow.Top = locDockingManager.Y + topTabsHeight; - _flyoutWindow.Height = this.ActualHeight - topTabsHeight - bottomTabsHeight; - - _flyoutWindow.MaxWidth = ActualWidth - leftTabsWidth; - _flyoutWindow.MaxHeight = ActualHeight; - - if (initialSetup) - { - _flyoutWindow.Left = FlowDirection == FlowDirection.RightToLeft ? locDockingManager.X + this.ActualWidth - rightTabsWidth : locDockingManager.X + leftTabsWidth; - _flyoutWindow.Width = 0.0; - _flyoutWindow.TargetWidth = resWidth; - } - else - { - if (!_flyoutWindow.IsOpening && !_flyoutWindow.IsClosing) - _flyoutWindow.Left = FlowDirection == FlowDirection.RightToLeft ? locDockingManager.X + this.ActualWidth - rightTabsWidth - _flyoutWindow.Width : locDockingManager.X + leftTabsWidth; - } - } - if (_flyoutWindow.ReferencedPane.Anchor == AnchorStyle.Top) - { - _flyoutWindow.Left = locDockingManager.X + leftTabsWidth; - _flyoutWindow.Width = this.ActualWidth - rightTabsWidth -leftTabsWidth; - - _flyoutWindow.MaxWidth = ActualWidth; - _flyoutWindow.MaxHeight = ActualHeight - topTabsHeight; - - if (initialSetup) - { - _flyoutWindow.Height = 0.0; - _flyoutWindow.TargetHeight = resHeight; - } - else - { - if (!_flyoutWindow.IsOpening && !_flyoutWindow.IsClosing) - _flyoutWindow.Top = locDockingManager.Y + topTabsHeight; - } - } - if (_flyoutWindow.ReferencedPane.Anchor == AnchorStyle.Bottom) - { - _flyoutWindow.Left = locDockingManager.X + leftTabsWidth; - _flyoutWindow.Width = this.ActualWidth - rightTabsWidth - leftTabsWidth; - - _flyoutWindow.MaxWidth = ActualWidth; - _flyoutWindow.MaxHeight = ActualHeight - bottomTabsHeight; - - if (initialSetup) - { - _flyoutWindow.Top = locDockingManager.Y + this.ActualHeight - bottomTabsHeight; - _flyoutWindow.Height = 0.0; - _flyoutWindow.TargetHeight = resHeight; - } - else - { - if (!_flyoutWindow.IsOpening && !_flyoutWindow.IsClosing) - _flyoutWindow.Top = locDockingManager.Y + this.ActualHeight - bottomTabsHeight - _flyoutWindow.Height; - if (_flyoutWindow.IsClosing) - _flyoutWindow.Top = locDockingManager.Y + this.ActualHeight - bottomTabsHeight - _flyoutWindow.Height; - } - } - - if (_flyoutWindow != null && !_flyoutWindow.IsClosing) - _flyoutWindow.UpdateClipRegion(); - } - - void _wndInteropWrapper_OnWindowPosChanging(object sender, EventArgs e) - { - UpdateFlyoutWindowPosition(); - } - - #endregion - - - #region DragDrop Operations - /// - /// Begins dragging operations - /// - /// Floating window containing pane which is dragged by user - /// Current mouse position - /// Offset to be use to set floating window screen position - /// Retruns True is drag is completed, false otherwise - internal bool Drag(FloatingWindow floatingWindow, Point point, Point offset) - { - bool mouseCaptured = IsMouseCaptured; - - if (!mouseCaptured) - mouseCaptured = CaptureMouse(); - - if (mouseCaptured) - { - floatingWindow.Owner = Window.GetWindow(this); - - DragPaneServices.StartDrag(floatingWindow, point, offset); - return true; - } - - return false; - } - - internal void Drag(DocumentContent documentContent, Point point, Point offset) - { - if (CaptureMouse()) - { - DocumentFloatingWindow floatingWindow = new DocumentFloatingWindow(this, documentContent); - Drag(floatingWindow, point, offset); - } - - } - - - internal void Drag(DockableContent dockableContent, Point point, Point offset) - { - if (CaptureMouse()) - { - DockableFloatingWindow floatingWindow = new DockableFloatingWindow(this, dockableContent); - floatingWindow.Owner = Window.GetWindow(this); - RegisterFloatingWindow(floatingWindow); - Drag(floatingWindow, point, offset); - } - } - - - internal void Drag(DockablePane dockablePane, Point point, Point offset) - { - if (CaptureMouse()) - { - DockableFloatingWindow floatingWindow = new DockableFloatingWindow(this, dockablePane); - floatingWindow.Owner = Window.GetWindow(this); - RegisterFloatingWindow(floatingWindow); - Drag(floatingWindow, point, offset); - } - } - - - protected override void OnMouseMove(MouseEventArgs e) - { - if (IsMouseCaptured) - { - DragPaneServices.MoveDrag(this.PointToScreenDPI(e.GetPosition(this))); - - if (_flyoutWindow != null) - _flyoutWindow.UpdateClipRegion(); - } - - base.OnMouseMove(e); - } - - - protected override void OnMouseUp(MouseButtonEventArgs e) - { - CompleteDragging(e.GetPosition(this)); - base.OnMouseUp(e); - } - - protected override void OnMouseLeave(MouseEventArgs e) - { - CompleteDragging(e.GetPosition(this)); - base.OnMouseLeave(e); - } - - /// - /// Ends all previously initiated dragging operations - /// - /// - void CompleteDragging(Point ptEndDrag) - { - if (IsMouseCaptured) - { - DragPaneServices.EndDrag(this.PointToScreenDPI(ptEndDrag)); - ReleaseMouseCapture(); - } - } - - DragPaneServices _dragPaneServices; - - internal DragPaneServices DragPaneServices - { - get - { - if (_dragPaneServices == null) - _dragPaneServices = new DragPaneServices(this); - - return _dragPaneServices; - } - } - #endregion - - - #region IDropSurface - public bool IsSurfaceVisible - { - get - { - //a DockingManager is always visible for drop a pane - return true; - } - } - - /// - /// Returns a rectangle where this surface is active - /// - public Rect SurfaceRectangle - { - get - { - if (PresentationSource.FromVisual(this) != null) - return new Rect(HelperFunc.PointToScreenWithoutFlowDirection(this, new Point(0, 0)), new Size(ActualWidth, ActualHeight)); - return Rect.Empty; - } - } - - /// - /// Overlay window which shows docking placeholders - /// - OverlayWindow _overlayWindow; - - /// - /// Returns current overlay window - /// - internal OverlayWindow OverlayWindow - { - get - { - if (_overlayWindow == null) - _overlayWindow = new OverlayWindow(this); - - return _overlayWindow; - } - } - - /// - /// Handles this sourface mouse entering (show current overlay window) - /// - /// Current mouse position - public void OnDragEnter(Point point) - { - if (OverlayWindow.IsVisible) - return; - - OverlayWindow.Owner = DragPaneServices.FloatingWindow; - //OverlayWindow.Left = PointToScreen(new Point(0, 0)).X; - //OverlayWindow.Top = PointToScreen(new Point(0, 0)).Y; - Point origPoint = HelperFunc.PointToScreenWithoutFlowDirection(this, new Point()); - OverlayWindow.Left = origPoint.X; - OverlayWindow.Top = origPoint.Y; - OverlayWindow.Width = ActualWidth; - OverlayWindow.Height = ActualHeight; - - OverlayWindow.Show(); - } - - /// - /// Handles mouse overing this surface - /// - /// - public void OnDragOver(Point point) - { - - } - - /// - /// Handles mouse leave event during drag (hide overlay window) - /// - /// - public void OnDragLeave(Point point) - { - OverlayWindow.Owner = null; - OverlayWindow.Hide(); - Window mainWindow = Window.GetWindow(this); - if (mainWindow != null) - mainWindow.Activate(); - } - - /// - /// Handler drop events - /// - /// Current mouse position - /// Returns alwasy false because this surface doesn't support direct drop - public bool OnDrop(Point point) - { - return false; - } - - #endregion - - - #region INotifyPropertyChanged Members - - public event PropertyChangedEventHandler PropertyChanged; - - void NotifyPropertyChanged(string propertyName) - { - if (PropertyChanged != null) - PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - #endregion - - - #region Persistence - - void SaveLayout(XmlWriter xmlWriter, DockablePane pane) - { - if (pane.Items.Count > 0) - { - xmlWriter.WriteStartElement("DockablePane"); - - //if (!double.IsInfinity(ResizingPanel.GetResizeWidth(pane))) - // xmlWriter.WriteAttributeString("ResizeWidth", XmlConvert.ToString(ResizingPanel.GetResizeWidth(pane))); - ////if (!double.IsInfinity(ResizingPanel.GetResizeHeight(pane))) - // xmlWriter.WriteAttributeString("ResizeHeight", XmlConvert.ToString(ResizingPanel.GetResizeHeight(pane))); - xmlWriter.WriteAttributeString("ResizeWidth", ResizingPanel.GetResizeWidth(pane).ToString()); - xmlWriter.WriteAttributeString("ResizeHeight", ResizingPanel.GetResizeHeight(pane).ToString()); - xmlWriter.WriteAttributeString("EffectiveSize", new SizeConverter().ConvertToInvariantString(ResizingPanel.GetEffectiveSize(pane))); - - xmlWriter.WriteAttributeString("Anchor", pane.Anchor.ToString()); - - Debug.Assert(pane.Items.Count > 0); - - foreach (DockableContent content in pane.Items) - { - SaveLayout(xmlWriter, content); - } - - - xmlWriter.WriteEndElement(); - } - } - - void SaveLayout(XmlWriter xmlWriter, DockableFloatingWindow flWindow) - { - xmlWriter.WriteStartElement("FloatingWindow"); - xmlWriter.WriteAttributeString("IsDockableWindow", XmlConvert.ToString(flWindow.IsDockableWindow)); - - xmlWriter.WriteAttributeString("Top", XmlConvert.ToString(flWindow.Top)); - xmlWriter.WriteAttributeString("Left", XmlConvert.ToString(flWindow.Left)); - xmlWriter.WriteAttributeString("Width", XmlConvert.ToString(flWindow.Width)); - xmlWriter.WriteAttributeString("Height", XmlConvert.ToString(flWindow.Height)); - - - SaveLayout(xmlWriter, flWindow.HostedPane); - - xmlWriter.WriteEndElement(); - } - - void SaveLayout(XmlWriter xmlWriter, DockableContent content) - { - Debug.Assert(!string.IsNullOrEmpty(content.Name), - "DockableContent must have a Name to save its content.\n" + - "Click Ignore to skip this element and continue with save." - ); - - if (!string.IsNullOrEmpty(content.Name)) - { - xmlWriter.WriteStartElement("DockableContent"); - - xmlWriter.WriteAttributeString("Name", content.Name); - xmlWriter.WriteAttributeString("AutoHide", XmlConvert.ToString(content.State == DockableContentState.AutoHide)); - - content.SaveLayout(xmlWriter); - - xmlWriter.WriteEndElement(); - } - } - - void SaveLayout(XmlWriter xmlWriter, DocumentPane pane) - { - xmlWriter.WriteStartElement("DocumentPanePlaceHolder"); - - foreach (ManagedContent content in pane.Items) - { - if (content is DockableContent) - { - DockableContent dockableContent = content as DockableContent; - SaveLayout(xmlWriter, dockableContent); - } - } - - xmlWriter.WriteEndElement(); - } - - void SaveLayout(XmlWriter xmlWriter, DocumentPaneResizingPanel panelToSerialize) - { - xmlWriter.WriteStartElement("DocumentPanePlaceHolder"); - - List listOfFoundContents = new List(); - FindContents(listOfFoundContents, panelToSerialize); - - foreach (DockableContent content in listOfFoundContents) - { - SaveLayout(xmlWriter, content); - } - - - xmlWriter.WriteEndElement(); - } - - void SaveLayout(XmlWriter xmlWriter, ResizingPanel panelToSerialize) - { - xmlWriter.WriteStartElement("ResizingPanel"); - - //if (!double.IsInfinity(ResizingPanel.GetResizeWidth(panelToSerialize))) - // xmlWriter.WriteAttributeString("ResizeWidth", XmlConvert.ToString(ResizingPanel.GetResizeWidth(panelToSerialize))); - //if (!double.IsInfinity(ResizingPanel.GetResizeHeight(panelToSerialize))) - // xmlWriter.WriteAttributeString("ResizeHeight", XmlConvert.ToString(ResizingPanel.GetResizeHeight(panelToSerialize))); - - xmlWriter.WriteAttributeString("ResizeWidth", ResizingPanel.GetResizeWidth(panelToSerialize).ToString()); - xmlWriter.WriteAttributeString("ResizeHeight", ResizingPanel.GetResizeHeight(panelToSerialize).ToString()); - xmlWriter.WriteAttributeString("EffectiveSize", new SizeConverter().ConvertToInvariantString(ResizingPanel.GetEffectiveSize(panelToSerialize))); - - xmlWriter.WriteAttributeString("Orientation", Convert.ToString(panelToSerialize.Orientation)); - - - foreach (UIElement child in panelToSerialize.Children) - { - if (child is DockablePane) - SaveLayout(xmlWriter, child as DockablePane); - else if (child is DocumentPane) - SaveLayout(xmlWriter, child as DocumentPane); - else if (child is DocumentPaneResizingPanel) - SaveLayout(xmlWriter, child as DocumentPaneResizingPanel); - else if (child is ResizingPanel) - SaveLayout(xmlWriter, child as ResizingPanel); - } - - xmlWriter.WriteEndElement(); - } - - /// - /// Save layout as xml to a - /// - /// Text writter object which receive the xml text - /// The writer is not closed. - public void SaveLayout(TextWriter textWriter) - { - XmlTextWriter sw = new XmlTextWriter(textWriter); - - sw.Formatting = Formatting.Indented; - sw.Indentation = 4; - - SaveLayout(sw); - - } - - /// - /// Save layout as xml to generic stream - /// - /// Stream receiving the xml string - /// The stream is not closed - public void SaveLayout(Stream backendStream) - { - XmlTextWriter sw = new XmlTextWriter(backendStream, Encoding.Default); - - sw.Formatting = Formatting.Indented; - sw.Indentation = 4; - - SaveLayout(sw); - } - - /// - /// Save layout as xml text into a file - /// - /// Path to the file - /// The file is created as new or overwritten is already exist a file with same name. - public void SaveLayout(string filename) - { - using (FileStream stream = new FileStream(filename, FileMode.Create, FileAccess.ReadWrite)) - SaveLayout(stream); - } - - const string layoutFileVersion = "1.2.1"; - - /// - /// Send layout configuration to a object - /// - /// Object which stores the xml - /// The writer is not closed. - public void SaveLayout(XmlWriter sw) - { - if (!_isControlLoaded) - throw new InvalidOperationException("Unable to serialize docking layout while DockingManager control is unloaded"); - - sw.WriteStartElement("DockingManager"); - sw.WriteAttributeString("version", layoutFileVersion); - - if (Content is ResizingPanel) - SaveLayout(sw, Content as ResizingPanel); - else if (Content is DocumentPane) - SaveLayout(sw, Content as DocumentPane); - else if (Content is DocumentPaneResizingPanel) - SaveLayout(sw, Content as DocumentPaneResizingPanel); - - sw.WriteStartElement("Hidden"); - foreach (DockableContent content in _hiddenContents) - { - SaveLayout(sw, content); - } - sw.WriteEndElement(); - - sw.WriteStartElement("Windows"); - foreach (DockableFloatingWindow flWindow in _floatingWindows) - { - SaveLayout(sw, flWindow); - } - sw.WriteEndElement(); - - sw.WriteEndElement();//dockingmanager - - sw.Flush(); - } - - - void DetachContentFromDockingManager(DockableContent content) - { - if (content.State == DockableContentState.AutoHide) - { - DockablePane parentContainer = content.Parent as DockablePane; - if (parentContainer != null && - parentContainer.Items.Count == 1) - ToggleAutoHide(content.Parent as DockablePane); - } - if (content.State == DockableContentState.DockableWindow || - content.State == DockableContentState.FloatingWindow) - { - DockablePane parentContainer = content.Parent as DockablePane; - - if (parentContainer != null && - parentContainer.Items.Count == 1) - { - FloatingWindow floatingWindow = Window.GetWindow(content) as FloatingWindow; - floatingWindow.Close(true); - } - } - //this content can be hidden also if was contained in closed floating window - if (content.State == DockableContentState.Hidden) - Show(content); - - content.DetachFromContainerPane(); - } - - - public delegate void DeserializationCallbackHandler(object sender, DeserializationCallbackEventArgs e); - public DeserializationCallbackHandler DeserializationCallback { get; set; } - - - void ShowAllHiddenContents() - { - while (_hiddenContents.Count > 0) - { - Debug.Assert(_hiddenContents[0].State == DockableContentState.Hidden); - Show(_hiddenContents[0]); - } - } - - void RestoreDocumentPaneLayout(XmlElement childElement, out DocumentPane mainExistingDocumentPane, out DocumentPaneResizingPanel existingDocumentPanel, DockableContent[] dockableContents) - { - mainExistingDocumentPane = (Content is DocumentPane) ? Content as DocumentPane : GetMainDocumentPane(Content as ResizingPanel); - if (mainExistingDocumentPane != null) - { - existingDocumentPanel = mainExistingDocumentPane.GetParentDocumentPaneResizingPanel(); - } - else - { - existingDocumentPanel = null; - } - - if (existingDocumentPanel != null) - { - if (existingDocumentPanel.Parent is ResizingPanel) - { - ((ResizingPanel)existingDocumentPanel.Parent).RemoveChild(existingDocumentPanel); - } - else if (existingDocumentPanel.Parent is DockingManager) - { - ((DockingManager)existingDocumentPanel.Parent).Content = null; - } - } - else if (mainExistingDocumentPane != null) - { - if (mainExistingDocumentPane.Parent is ResizingPanel) - { - ((ResizingPanel)mainExistingDocumentPane.Parent).RemoveChild(mainExistingDocumentPane); - } - else if (mainExistingDocumentPane.Parent is DockingManager) - { - ((DockingManager)mainExistingDocumentPane.Parent).Content = null; - } - } - - foreach (XmlElement contentElement in childElement.ChildNodes) - { - if (contentElement.HasAttribute("Name")) - { - DockableContent foundContent = null; - string contentName = contentElement.GetAttribute("Name"); - foreach (DockableContent content in dockableContents) - { - if (content.Name == contentName) - { - foundContent = content; - break; - } - } - - if (foundContent == null && - DeserializationCallback != null) - { - DeserializationCallbackEventArgs e = new DeserializationCallbackEventArgs(contentName); - DeserializationCallback(this, e); - - foundContent = e.Content; - } - - - if (foundContent != null) - { - DetachContentFromDockingManager(foundContent); - mainExistingDocumentPane.Items.Add(foundContent); - foundContent.SetStateToDocument(); - - //call custom layout persistence method - foundContent.RestoreLayout(contentElement); - } - } - } - } - - ResizingPanel RestoreLayout(XmlElement panelElement, DockableContent[] dockableContents) - { - ResizingPanel panel = new ResizingPanel(); - - if (panelElement.HasAttribute("Orientation")) - panel.Orientation = (Orientation)Enum.Parse(typeof(Orientation), panelElement.GetAttribute("Orientation")); - - - foreach (XmlElement childElement in panelElement.ChildNodes) - { - if (childElement.Name == "ResizingPanel") - { - ResizingPanel childPanel = RestoreLayout(childElement, dockableContents); - if (childElement.HasAttribute("ResizeWidth")) - ResizingPanel.SetResizeWidth(childPanel, (GridLength)GLConverter.ConvertFromInvariantString(childElement.GetAttribute("ResizeWidth"))); - if (childElement.HasAttribute("ResizeHeight")) - ResizingPanel.SetResizeHeight(childPanel, (GridLength)GLConverter.ConvertFromInvariantString(childElement.GetAttribute("ResizeHeight"))); - if (childElement.HasAttribute("EffectiveSize")) - ResizingPanel.SetEffectiveSize(childPanel, (Size)(new SizeConverter()).ConvertFromInvariantString(childElement.GetAttribute("EffectiveSize"))); - - panel.Children.Add(childPanel); - } - #region Restore DockablePane - else if (childElement.Name == "DockablePane") - { - DockablePane pane = new DockablePane(); - - if (childElement.HasAttribute("Anchor")) - pane.Anchor = (AnchorStyle)Enum.Parse(typeof(AnchorStyle), childElement.GetAttribute("Anchor")); - if (childElement.HasAttribute("ResizeWidth")) - ResizingPanel.SetResizeWidth(pane, (GridLength)GLConverter.ConvertFromInvariantString(childElement.GetAttribute("ResizeWidth"))); - if (childElement.HasAttribute("ResizeHeight")) - ResizingPanel.SetResizeHeight(pane, (GridLength)GLConverter.ConvertFromInvariantString(childElement.GetAttribute("ResizeHeight"))); - if (childElement.HasAttribute("EffectiveSize")) - ResizingPanel.SetEffectiveSize(pane, (Size)(new SizeConverter()).ConvertFromInvariantString(childElement.GetAttribute("EffectiveSize"))); - - //storeWriter.WriteAttributeString( - // "EffectiveSize", new SizeConverter().ConvertToInvariantString(ResizingPanel.GetEffectiveSize(ContainerPane))); - - bool toggleAutoHide = false; - foreach (XmlElement contentElement in childElement.ChildNodes) - { - if (contentElement.HasAttribute("Name")) - { - DockableContent foundContent = null; - string contentName = contentElement.GetAttribute("Name"); - foreach (DockableContent content in dockableContents) - { - if (content.Name == contentName) - { - foundContent = content; - break; - } - } - - if (foundContent == null && - DeserializationCallback != null) - { - DeserializationCallbackEventArgs e = new DeserializationCallbackEventArgs(contentName); - DeserializationCallback(this, e); - - foundContent = e.Content; - } - - - if (foundContent != null) - { - DetachContentFromDockingManager(foundContent); - pane.Items.Add(foundContent); - foundContent.SetStateToDock(); - if (contentElement.HasAttribute("AutoHide") && - XmlConvert.ToBoolean(contentElement.GetAttribute("AutoHide")) && - pane.Items.Count == 1) - toggleAutoHide = true; - - //call custom layout persistence method - foundContent.RestoreLayout(contentElement); - } - } - } - if (pane.Items.Count > 0) - { - if (toggleAutoHide) - ToggleAutoHide(pane); - - if (pane.Items.Count > 0) - panel.Children.Add(pane); - } - } - #endregion - #region Restore Contents inside a DocumentPane - else if (childElement.Name == "DocumentPanePlaceHolder") - { - DocumentPaneResizingPanel existingDocumentPanel = null; - DocumentPane mainExistingDocumentPane = null; - - RestoreDocumentPaneLayout(childElement, out mainExistingDocumentPane, out existingDocumentPanel, dockableContents); - - if (existingDocumentPanel != null) - { - panel.Children.Add(existingDocumentPanel); - } - else if (mainExistingDocumentPane != null) - { - panel.Children.Add(mainExistingDocumentPane); - } - } - - #endregion - } - - return panel; - } - - - public void RestoreLayout(Stream backendStream) - { - XmlDocument doc = new XmlDocument(); - - doc.Load(backendStream); - - RestoreLayout(doc); - } - - public void RestoreLayout(XmlReader reader) - { - XmlDocument doc = new XmlDocument(); - - doc.Load(reader); - - RestoreLayout(doc); - } - - public void RestoreLayout(string filename) - { - XmlDocument doc = new XmlDocument(); - - doc.Load(filename); - - RestoreLayout(doc); - } - - public void RestoreLayout(TextReader reader) - { - XmlDocument doc = new XmlDocument(); - - doc.Load(reader); - - RestoreLayout(doc); - } - - - - void RestoreLayout(XmlDocument doc) - { - if (!_isControlLoaded) - throw new InvalidOperationException("Unable to deserialize a docking layout while DockingManager control is unloaded"); - - if (doc.DocumentElement == null || - doc.DocumentElement.Name != "DockingManager") - { - Debug.Assert(false, "Layout file hasn't a valid structure!"); - throw new InvalidOperationException("Layout file had not a valid structure!"); - } - - if (doc.DocumentElement.GetAttribute("version") != layoutFileVersion) - throw new FileFormatException("Unsupported layout file version"); - - if (doc.DocumentElement.ChildNodes.Count != 3 || - (doc.DocumentElement.ChildNodes[0].Name != "ResizingPanel" && doc.DocumentElement.ChildNodes[0].Name != "DocumentPanePlaceHolder") || - doc.DocumentElement.ChildNodes[1].Name != "Hidden" || - doc.DocumentElement.ChildNodes[2].Name != "Windows") - { - Debug.Assert(false, "Layout file hasn't a valid structure!"); - throw new InvalidOperationException("Layout file hasn't a valid structure!"); - } - - //Hide temp windows - HideAutoHideWindow(); - HideNavigatorWindow(); - HideDocumentNavigatorWindow(); - - DockableContent[] actualContents = DockableContents; - - - //show all hidden contents - ShowAllHiddenContents(); - - //restore main panel - XmlElement rootElement = doc.DocumentElement.ChildNodes[0] as XmlElement; - if (rootElement.Name == "ResizingPanel") - { - this.Content = RestoreLayout(rootElement, actualContents); - } - else if (rootElement.Name == "DocumentPanePlaceHolder") - { - DocumentPaneResizingPanel existingDocumentPanel = null; - DocumentPane mainExistingDocumentPane = null; - - RestoreDocumentPaneLayout(rootElement, out mainExistingDocumentPane, out existingDocumentPanel, actualContents); - - if (existingDocumentPanel != null) - { - this.Content = existingDocumentPanel; - } - else if (mainExistingDocumentPane != null) - { - this.Content = mainExistingDocumentPane; - } - } - - //restore hidden contents - foreach (XmlElement hiddenContentElement in doc.DocumentElement.ChildNodes[1].ChildNodes) - { - foreach (DockableContent hiddenContent in actualContents) - { - if (hiddenContentElement.GetAttribute("Name") == hiddenContent.Name - && hiddenContent.State != DockableContentState.Hidden) - { - Hide(hiddenContent); - hiddenContent.RestoreLayout(hiddenContentElement); - } - } - } - - //restore floating windows - foreach (XmlElement flWindowElement in doc.DocumentElement.ChildNodes[2].ChildNodes) - { - if (flWindowElement.ChildNodes.Count != 1) - continue;//handles invalid layouts structures - - bool isDockableWindow = XmlConvert.ToBoolean(flWindowElement.GetAttribute("IsDockableWindow")); - Point location = new Point(XmlConvert.ToDouble(flWindowElement.GetAttribute("Left")), XmlConvert.ToDouble(flWindowElement.GetAttribute("Top"))); - Size size = new Size(XmlConvert.ToDouble(flWindowElement.GetAttribute("Width")), XmlConvert.ToDouble(flWindowElement.GetAttribute("Height"))); - - DockableFloatingWindow flWindow = new DockableFloatingWindow(this); - flWindow.Left = location.X; - flWindow.Top = location.Y; - flWindow.Width = size.Width; - flWindow.Height = size.Height; - flWindow.Owner = Window.GetWindow(this); - - XmlElement paneElement = flWindowElement.ChildNodes[0] as XmlElement; - - FloatingDockablePane paneForFloatingWindow = new FloatingDockablePane(flWindow); - if (paneElement.HasAttribute("ResizingWidth")) - ResizingPanel.SetResizeWidth(paneForFloatingWindow, (GridLength)GLConverter.ConvertFromInvariantString(paneElement.GetAttribute("ResizeWidth"))); - if (paneElement.HasAttribute("ResizingHeight")) - ResizingPanel.SetResizeHeight(paneForFloatingWindow, (GridLength)GLConverter.ConvertFromInvariantString(paneElement.GetAttribute("ResizeHeight"))); - paneForFloatingWindow.Anchor = (AnchorStyle)Enum.Parse(typeof(AnchorStyle), paneElement.GetAttribute("Anchor")); - - - DockableContent contentToTransfer = null; - foreach (XmlElement contentElement in paneElement.ChildNodes) - { - #region Find the content to transfer - string contentToFindName = contentElement.GetAttribute("Name"); - foreach (DockableContent content in actualContents) - { - if (contentToFindName == content.Name) - { - contentToTransfer = content; - break; - } - } - - if (contentToTransfer == null && - DeserializationCallback != null) - { - DeserializationCallbackEventArgs e = new DeserializationCallbackEventArgs(contentToFindName); - DeserializationCallback(this, e); - - contentToTransfer = e.Content; - } - #endregion - - - if (contentToTransfer != null) - { - DetachContentFromDockingManager(contentToTransfer); - paneForFloatingWindow.Items.Add(contentToTransfer); - contentToTransfer.RestoreLayout(contentElement); - } - } - - flWindow.HostedPane = paneForFloatingWindow; - flWindow.IsDockableWindow = isDockableWindow; - - RegisterFloatingWindow(flWindow); - - flWindow.ApplyTemplate(); - flWindow.Show(); - - } - } - - /// - /// Static converter used to convert GridLength from/to string - /// - static GridLengthConverter GLConverter = new GridLengthConverter(); - - #endregion - - - #region OnClosing/OnClosedDocument events - - /// - /// Event fired when the document is about to be closed - /// - public event EventHandler DocumentClosing; - - /// - /// Event fired when a document has been closed - /// - /// Note that when a document is closed, property like or returns null. - public event EventHandler DocumentClosed; - - /// - /// Ovveride this method to handle event. - /// - protected virtual void OnDocumentClosing(CancelEventArgs e) - { - if (DocumentClosing != null && !e.Cancel) - { - DocumentClosing(this, e); - } - } - - /// - /// Ovveride this method to handle event. - /// - protected virtual void OnDocumentClosed() - { - if (DocumentClosed != null) - DocumentClosed(this, EventArgs.Empty); - } - - internal void FireDocumentClosingEvent(CancelEventArgs e) - { - OnDocumentClosing(e); - } - - internal void FireDocumentClosedEvent() - { - OnDocumentClosed(); - } - - - public event EventHandler RequestDocumentClose; - - internal bool FireRequestDocumentCloseEvent(DocumentContent doc) - { - bool res = false; - - if (RequestDocumentClose != null) - { - RequestDocumentCloseEventArgs args = new RequestDocumentCloseEventArgs(doc); - RequestDocumentClose(this, args); - res = !args.Cancel; - } - - return res; - } - - - #endregion - - - } -} diff --git a/src/Libraries/AvalonDock/DocumentContent.cs b/src/Libraries/AvalonDock/DocumentContent.cs deleted file mode 100644 index 8b143cae7e..0000000000 --- a/src/Libraries/AvalonDock/DocumentContent.cs +++ /dev/null @@ -1,298 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.ComponentModel; -using System.Diagnostics; - - -namespace AvalonDock -{ - /// - /// Represent a document which can be host by a . - /// - /// A document is always hosted by a usually in the central area of . - /// It has limited dragging features becaus it can be only moved to an other and can't float as a separate window. - /// You can access all documents within with property . - public class DocumentContent : ManagedContent - { - - static DocumentContent() - { - //DefaultStyleKeyProperty.OverrideMetadata(typeof(DocumentContent), new FrameworkPropertyMetadata(typeof(DocumentContent))); - - //Control.WidthProperty.OverrideMetadata(typeof(DocumentContent), - // new FrameworkPropertyMetadata(new PropertyChangedCallback(OnSizePropertyChanged), new CoerceValueCallback(CourceSizeToNaN))); - //Control.HeightProperty.OverrideMetadata(typeof(DocumentContent), - // new FrameworkPropertyMetadata(new PropertyChangedCallback(OnSizePropertyChanged), new CoerceValueCallback(CourceSizeToNaN))); - } - - public DocumentContent() - { - base.PropertyChanged += new PropertyChangedEventHandler(DocumentContent_PropertyChanged); - } - - - - DateTime _lastActivation = DateTime.MinValue; - - internal DateTime LastActivation - { - get { return _lastActivation; } - } - - void DocumentContent_PropertyChanged(object sender, PropertyChangedEventArgs e) - { - if (e.PropertyName == "IsActiveContent") - { - if (IsActiveContent) - _lastActivation = DateTime.Now; - } - } - - static void OnSizePropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) - { } - - static object CourceSizeToNaN(DependencyObject sender, object value) - { - //return double.NaN; - return value; - } - - string _infoTip; - - /// - /// Gets or sets the information text attached to the document content. - /// - /// This text is usually displayed when users switch between documents and helps them to choose the right one. - public string InfoTip - { - get { return _infoTip; } - set - { - _infoTip = value; - NotifyPropertyChanged("InfoTip"); - } - } - - string _contentTypeDescription; - - /// - /// Gets or sets a text which describes the type of content contained in this document. - /// - public string ContentTypeDescription - { - get { return _contentTypeDescription; } - set - { - _contentTypeDescription = value; - NotifyPropertyChanged("ContentTypeDescription"); - } - } - - bool _isFloatingAllowed; - - /// - /// Gets or sets a value indicating if this document can float over main window (VS2010 Feature). - /// - public bool IsFloatingAllowed - { - get { return _isFloatingAllowed; } - set - { - _isFloatingAllowed = value; - NotifyPropertyChanged("IsFloatingAllowed"); - } - } - - protected override void OnDragStart(Point ptMouse, Point ptRelativeMouse) - { - //Manager.Drag(this, this.PointToScreenDPI(ptMouse), ptRelativeMouse); - Manager.Drag(this, HelperFunc.PointToScreenWithoutFlowDirection(this, ptMouse), ptRelativeMouse); - - - base.OnDragStart(ptMouse, ptRelativeMouse); - } - - protected override void OnDragMouseMove(object sender, MouseEventArgs e) - { - base.OnDragMouseMove(sender, e); - } - - protected override void OnDragMouseLeave(object sender, MouseEventArgs e) - { - - base.OnDragMouseLeave(sender, e); - } - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - if (DragEnabledArea != null) - { - DragEnabledArea.InputBindings.Add(new InputBinding(ApplicationCommands.Close, new MouseGesture(MouseAction.MiddleClick))); - } - } - - /// - /// Event fired when the document is about to be closed - /// - public event EventHandler Closing; - - /// - /// Event fired when the document has been closed - /// - /// Note that when a document is closed property like or returns null. - public event EventHandler Closed; - - /// - /// Ovveride this method to handle event. - /// - protected virtual void OnClosing(CancelEventArgs e) - { - if (Closing != null && !e.Cancel) - { - Closing(this, e); - } - } - - /// - /// Ovveride this method to handle event. - /// - protected virtual void OnClosed() - { - if (Closed != null) - Closed(this, EventArgs.Empty); - } - - /// - /// Close this content without notifications - /// - internal void InternalClose() - { - - - DocumentPane parentPane = ContainerPane as DocumentPane; - DockingManager manager = Manager; - - if (manager != null) - { - if (manager.ActiveContent == this) - manager.ActiveContent = null; - - if (manager.ActiveDocument == this) - manager.ActiveDocument = null; - } - - if (parentPane != null) - { - parentPane.Items.Remove(this); - - parentPane.CheckContentsEmpty(); - } - else - { - FloatingDockablePane floatingParentPane = ContainerPane as FloatingDockablePane; - if (floatingParentPane != null) - { - floatingParentPane.RemoveContent(0); - if (floatingParentPane.FloatingWindow != null && - !floatingParentPane.FloatingWindow.IsClosing) - floatingParentPane.FloatingWindow.Close(); - } - } - - - - - } - - /// - /// Close this document removing it from its parent container - /// - /// Use this function to close a document and remove it from its parent container. Please note - /// that if you simply remove it from its parent without call this method, events like - /// / are not called. - /// - /// Note: cannot be closed: AvalonDock simply hide a removing all the reference to it. - /// - /// - public bool Close() - { - if (!IsCloseable) - return false; - - //if documents are attached to an external source via DockingManager.DocumentsSource - //let application host handle the document closing by itself - if (Manager.DocumentsSource != null) - { - return Manager.FireRequestDocumentCloseEvent(this); - } - - - CancelEventArgs e = new CancelEventArgs(false); - OnClosing(e); - - if (e.Cancel) - return false; - - DockingManager oldManager = Manager; - - if (Manager != null) - Manager.FireDocumentClosingEvent(e); - - if (e.Cancel) - return false; - - InternalClose(); - - OnClosed(); - - if (oldManager != null) - oldManager.FireDocumentClosedEvent(); - - - //if (Parent != null) - // throw new InvalidOperationException(); - Debug.Assert(Parent == null, "Parent MUST bu null after Doc is closed"); - return true; - } - - - - } -} diff --git a/src/Libraries/AvalonDock/DocumentFloatingWindow.cs b/src/Libraries/AvalonDock/DocumentFloatingWindow.cs deleted file mode 100644 index da060daa99..0000000000 --- a/src/Libraries/AvalonDock/DocumentFloatingWindow.cs +++ /dev/null @@ -1,357 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.ComponentModel; -using System.Windows.Markup; -using System.Diagnostics; -using System.Windows.Threading; -using System.Windows.Media.Animation; -using System.Windows.Interop; - -namespace AvalonDock -{ - public class DocumentFloatingWindow : FloatingWindow - { - static DocumentFloatingWindow() - { - //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. - //This style is defined in themes\generic.xaml - DefaultStyleKeyProperty.OverrideMetadata(typeof(DocumentFloatingWindow), new FrameworkPropertyMetadata(typeof(DocumentFloatingWindow))); - - Window.AllowsTransparencyProperty.OverrideMetadata(typeof(DocumentFloatingWindow), new FrameworkPropertyMetadata(true)); - Window.WindowStyleProperty.OverrideMetadata(typeof(DocumentFloatingWindow), new FrameworkPropertyMetadata(WindowStyle.None)); - Window.ShowInTaskbarProperty.OverrideMetadata(typeof(DocumentFloatingWindow), new FrameworkPropertyMetadata(false)); - } - - - public DocumentFloatingWindow(DockingManager manager) - :base(manager) - { - } - - Pane _previousPane = null; - - int _arrayIndexPreviousPane = -1; - - public DocumentFloatingWindow(DockingManager manager, DocumentContent content) - : this(manager) - { - //create a new temporary pane - FloatingDockablePane pane = new FloatingDockablePane(this); - - //setup window size - Width = content.ContainerPane.ActualWidth; - Height = content.ContainerPane.ActualHeight; - - //save current content position in container pane - _previousPane = content.ContainerPane; - _arrayIndexPreviousPane = _previousPane.Items.IndexOf(content); - pane.SetValue(ResizingPanel.ResizeWidthProperty, _previousPane.GetValue(ResizingPanel.ResizeWidthProperty)); - pane.SetValue(ResizingPanel.ResizeHeightProperty, _previousPane.GetValue(ResizingPanel.ResizeHeightProperty)); - - //remove content from container pane - content.ContainerPane.RemoveContent(_arrayIndexPreviousPane); - - //add content to my temporary pane - pane.Items.Add(content); - - //let templates access this pane - HostedPane = pane; - - if (IsDocumentFloatingAllowed) - { - AllowsTransparency = false; - WindowStyle = WindowStyle.ToolWindow; - NotifyPropertyChanged("IsDocumentFloatingAllowed"); - } - } - - public bool IsDocumentFloatingAllowed - { - get - { - if (HostedPane != null && - HostedPane.Items.Count > 0) - return ((DocumentContent)HostedPane.Items[0]).IsFloatingAllowed; - - return false; - } - } - - - internal override void OnEndDrag() - { - if (HostedPane.Items.Count > 0) - { - DocumentContent content = HostedPane.Items[0] as DocumentContent; - if (!content.IsFloatingAllowed) - { - HostedPane.Items.RemoveAt(0); - _previousPane.Items.Insert(_arrayIndexPreviousPane, content); - _previousPane.SelectedItem = content; - Close(); - } - else - { - DocumentPane originalDocumentPane = _previousPane as DocumentPane; - originalDocumentPane.CheckContentsEmpty(); - } - } - else - { - DocumentPane originalDocumentPane = _previousPane as DocumentPane; - originalDocumentPane.CheckContentsEmpty(); - Close(); - } - - - base.OnEndDrag(); - } - - - public override Pane ClonePane() - { - DocumentPane paneToAnchor = new DocumentPane(); - - ////transfer the resizing panel sizes - //paneToAnchor.SetValue(ResizingPanel.ResizeWidthProperty, - // HostedPane.GetValue(ResizingPanel.ResizeWidthProperty)); - //paneToAnchor.SetValue(ResizingPanel.ResizeHeightProperty, - // HostedPane.GetValue(ResizingPanel.ResizeHeightProperty)); - - ResizingPanel.SetEffectiveSize(paneToAnchor, new Size(Width, Height)); - - //transfer contents from hosted pane in the floating window and - //the new created dockable pane - while (HostedPane.Items.Count > 0) - { - paneToAnchor.Items.Add( - HostedPane.RemoveContent(0)); - } - - return paneToAnchor; - } - - - protected override void OnInitialized(EventArgs e) - { - - if (IsDocumentFloatingAllowed) - { - if (HostedPane != null) - { - Content = HostedPane; - } - } - - base.OnInitialized(e); - } - - internal override void OnShowSelectionBox() - { - this.Visibility = Visibility.Hidden; - base.OnShowSelectionBox(); - } - - internal override void OnHideSelectionBox() - { - this.Visibility = Visibility.Visible; - base.OnHideSelectionBox(); - } - #region Commands - - protected override void OnExecuteCommand(object sender, ExecutedRoutedEventArgs e) - { - if (e.Command == TabbedDocumentCommand) - { - DocumentContent currentContent = HostedPane.SelectedItem as DocumentContent; - - _previousPane.Items.Insert(0, HostedPane.RemoveContent(HostedPane.SelectedIndex)); - _previousPane.SelectedIndex = 0; - - if (HostedPane.Items.Count == 0) - this.Close(); - e.Handled = true; - } - else if (e.Command == CloseCommand) - { - DocumentContent docContent = this.HostedPane.Items[0] as DocumentContent; - e.Handled = docContent.Close(); - } - - base.OnExecuteCommand(sender, e); - } - - - #endregion - //#region Drag - //protected override IntPtr FilterMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) - //{ - // handled = false; - - // if (!IsDocumentFloatingAllowed) - // return IntPtr.Zero; - - // switch (msg) - // { - // case WM_SIZE: - // case WM_MOVE: - // //HostedPane.ReferencedPane.SaveFloatingWindowSizeAndPosition(this); - // break; - // case WM_NCLBUTTONDOWN: - // if (IsDockableWindow && wParam.ToInt32() == HTCAPTION) - // { - // short x = (short)((lParam.ToInt32() & 0xFFFF)); - // short y = (short)((lParam.ToInt32() >> 16)); - - // Point clickPoint = this.TransformToDeviceDPI(new Point(x, y)); - // Manager.Drag(this, clickPoint, new Point(clickPoint.X - Left, clickPoint.Y - Top)); - - // handled = true; - // } - // break; - // case WM_NCLBUTTONDBLCLK: - // if (IsDockableWindow && wParam.ToInt32() == HTCAPTION) - // { - // if (IsDockableWindow) - // { - // if (_previousPane != null) - // { - // if (_previousPane.GetManager() == null) - // { - // DockablePane newContainerPane = new DockablePane(); - // newContainerPane.Items.Add(HostedPane.RemoveContent(0)); - // newContainerPane.SetValue(ResizingPanel.ResizeWidthProperty, _previousPane.GetValue(ResizingPanel.ResizeWidthProperty)); - // newContainerPane.SetValue(ResizingPanel.ResizeHeightProperty, _previousPane.GetValue(ResizingPanel.ResizeHeightProperty)); - // Manager.Anchor(newContainerPane, ((DockablePane)_previousPane).Anchor); - // } - // else - // { - // if (_arrayIndexPreviousPane > _previousPane.Items.Count) - // _arrayIndexPreviousPane = _previousPane.Items.Count; - - // DockableContent currentContent = HostedPane.Items[0] as DockableContent; - // _previousPane.Items.Insert(_arrayIndexPreviousPane, HostedPane.RemoveContent(0)); - // _previousPane.SelectedIndex = _arrayIndexPreviousPane; - // currentContent.SetStateToDock(); - - // } - // this.Close(); - // } - - // handled = true; - // } - // } - // break; - // case WM_NCRBUTTONDOWN: - // if (wParam.ToInt32() == HTCAPTION) - // { - // short x = (short)((lParam.ToInt32() & 0xFFFF)); - // short y = (short)((lParam.ToInt32() >> 16)); - - // ContextMenu cxMenu = FindResource(new ComponentResourceKey(typeof(DockingManager), ContextMenuElement.FloatingWindow)) as ContextMenu; - // if (cxMenu != null) - // { - // foreach (MenuItem menuItem in cxMenu.Items) - // menuItem.CommandTarget = this; - - // cxMenu.Placement = PlacementMode.AbsolutePoint; - // cxMenu.PlacementRectangle = new Rect(new Point(x, y), new Size(0, 0)); - // cxMenu.PlacementTarget = this; - // cxMenu.IsOpen = true; - // } - - // handled = true; - // } - // break; - // case WM_NCRBUTTONUP: - // if (wParam.ToInt32() == HTCAPTION) - // { - - // handled = true; - // } - // break; - - // } - - - // return IntPtr.Zero; - //} - //#endregion - - protected override void Redock() - { - if (_previousPane != null) - { - if (_previousPane.GetManager() == null) - { - Manager.MainDocumentPane.Items.Insert(0, HostedPane.RemoveContent(0)); - } - else - { - if (_arrayIndexPreviousPane > _previousPane.Items.Count) - _arrayIndexPreviousPane = _previousPane.Items.Count; - - _previousPane.Items.Insert(_arrayIndexPreviousPane, HostedPane.RemoveContent(0)); - _previousPane.SelectedIndex = _arrayIndexPreviousPane; - } - this.Close(); - } - - base.Redock(); - } - - - protected override void OnClosing(CancelEventArgs e) - { - base.OnClosing(e); - - if (e.Cancel) - return; - - if (this.HostedPane.Items.Count > 0) - { - DocumentContent docContent = this.HostedPane.Items[0] as DocumentContent; - if (!docContent.Close()) - e.Cancel = true; - else - this.HostedPane.Items.Remove(docContent); - } - - } - } -} diff --git a/src/Libraries/AvalonDock/DocumentNavigator.cs b/src/Libraries/AvalonDock/DocumentNavigator.cs deleted file mode 100644 index 5150241baf..0000000000 --- a/src/Libraries/AvalonDock/DocumentNavigator.cs +++ /dev/null @@ -1,252 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.ComponentModel; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Media; -using System.Windows.Input; -using System.Windows.Controls.Primitives; - -namespace AvalonDock -{ - public class DocumentNavigatorWindow : Window, INotifyPropertyChanged - { - static DocumentNavigatorWindow() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(DocumentNavigatorWindow), new FrameworkPropertyMetadata(typeof(DocumentNavigatorWindow))); - - - Window.AllowsTransparencyProperty.OverrideMetadata(typeof(DocumentNavigatorWindow), new FrameworkPropertyMetadata(true)); - Window.WindowStyleProperty.OverrideMetadata(typeof(DocumentNavigatorWindow), new FrameworkPropertyMetadata(WindowStyle.None)); - Window.ShowInTaskbarProperty.OverrideMetadata(typeof(DocumentNavigatorWindow), new FrameworkPropertyMetadata(false)); - Control.BackgroundProperty.OverrideMetadata(typeof(DocumentNavigatorWindow), new FrameworkPropertyMetadata(Brushes.Transparent)); - } - - public DocumentNavigatorWindow() - { - } - - void OnKeyUp(object sender, KeyEventArgs e) - { - if (e.Key != Key.Tab) - CloseThisWindow();//Hide(); - else - { - e.Handled = true; - MoveNextSelectedContent(); - } - } - - void OnKeyDown(object sender, KeyEventArgs e) - { - if (e.Key != Key.Tab) - CloseThisWindow();//Hide(); - else - { - e.Handled = true; - } - } - - void CloseThisWindow() - { - Window wndParent = this.Owner; - Close(); - wndParent.Activate(); - } - - DockingManager _manager; - public DocumentNavigatorWindow(DockingManager manager) - :this() - { - _manager = manager; - Keyboard.AddKeyUpHandler(this, new KeyEventHandler(this.OnKeyUp)); - Keyboard.AddKeyDownHandler(this, new KeyEventHandler(this.OnKeyDown)); - } - - - protected override void OnActivated(EventArgs e) - { - base.OnActivated(e); - - List listOfDocuments = _manager.FindContents(); - List docs = new List(); - listOfDocuments.ForEach((DocumentContent doc) => - { - docs.Add(new NavigatorWindowDocumentItem(doc)); - }); - - //docs.Sort((NavigatorWindowDocumentItem item1, NavigatorWindowDocumentItem item2) => - //{ - // if (item1 == item2 || - // item1.LastActivation == item2.LastActivation) - // return 0; - // return (item1.LastActivation < item2.LastActivation) ? 1 : -1; - //}); - - Documents = docs; - - _internalSelect = true; - - SelectedContent = Documents.Find((NavigatorWindowDocumentItem docItem) => - { - return docItem.ItemContent == _manager.ActiveDocument; - }); - - _internalSelect = false; - } - - protected override void OnDeactivated(EventArgs e) - { - if (_manager != null) - { - Window mainWindow = Window.GetWindow(_manager); - if (mainWindow != null) - { - mainWindow.Activate(); - if (SelectedContent != null) - { - _manager.Show(SelectedContent.ItemContent as DocumentContent); - SelectedContent.ItemContent.SetAsActive(); - } - } - } - - if (!_isClosing) - CloseThisWindow();// Hide(); - - base.OnDeactivated(e); - } - - - - ListBox _itemsControl; - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - _itemsControl = GetTemplateChild("PART_ScrollingPanel") as ListBox; - } - - List _documents = new List(); - - public List Documents - { - get { return _documents; } - private - set - { - _documents = value; - NotifyPropertyChanged("Documents"); - } - } - - NavigatorWindowDocumentItem _selectedContent; - - bool _internalSelect = false; - - public NavigatorWindowDocumentItem SelectedContent - { - get - { - return _selectedContent; - } - set - { - if (_selectedContent != value) - { - _selectedContent = value; - NotifyPropertyChanged("SelectedContent"); - - if (!_internalSelect && _selectedContent != null) - CloseThisWindow();//Hide(); - - if (_internalSelect && _itemsControl != null) - _itemsControl.ScrollIntoView(_selectedContent); - } - } - } - - - public void MoveNextSelectedContent() - { - if (_selectedContent == null) - return; - - if (Documents.Contains(SelectedContent)) - { - int indexOfSelecteContent = Documents.IndexOf(_selectedContent); - - if (indexOfSelecteContent == Documents.Count - 1) - { - indexOfSelecteContent = 0; - } - else - indexOfSelecteContent++; - - _internalSelect = true; - SelectedContent = Documents[indexOfSelecteContent]; - _internalSelect = false; - } - } - - bool _isClosing = false; - protected override void OnClosing(CancelEventArgs e) - { - _isClosing = true; - - base.OnClosing(e); - } - - protected override void OnClosed(EventArgs e) - { - //reset documents list to avoid WPF Bug: - //http://social.msdn.microsoft.com/forums/en/wpf/thread/f3fc5b7e-e035-4821-908c-b6c07e5c7042/ - //http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=321955 - Documents = new List(); - - base.OnClosed(e); - } - - - #region INotifyPropertyChanged Members - - public event PropertyChangedEventHandler PropertyChanged; - - void NotifyPropertyChanged(string propertyName) - { - if (PropertyChanged != null) - PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - #endregion - } - -} diff --git a/src/Libraries/AvalonDock/DocumentPane.cs b/src/Libraries/AvalonDock/DocumentPane.cs deleted file mode 100644 index 47379a056a..0000000000 --- a/src/Libraries/AvalonDock/DocumentPane.cs +++ /dev/null @@ -1,520 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.Diagnostics; - -namespace AvalonDock -{ - public class DocumentPane : Pane - { - static DocumentPane() - { - //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. - //This style is defined in themes\generic.xaml - DefaultStyleKeyProperty.OverrideMetadata(typeof(DocumentPane), new FrameworkPropertyMetadata(typeof(DocumentPane))); - } - - public DocumentPane() - { - this.Loaded += new RoutedEventHandler(DocumentPane_Loaded); - } - - void DocumentPane_Loaded(object sender, RoutedEventArgs e) - { - if (Parent == null) - return; - - if (GetManager() == null) - throw new InvalidOperationException("DocumentPane must be put under a DockingManager!"); - - //try to set this as main document pane - if (GetManager().MainDocumentPane == null) - { - GetManager().MainDocumentPane = this; - NotifyPropertyChanged("IsMainDocumentPane"); - } - else - { - //or ensure that this document pane is under or at the same level of the MainDocumentPane - GetManager().EnsurePanePositionIsValid(this); - } - } - - public bool? IsMainDocumentPane - { - get - { - if (GetManager() == null) - return null; - - return GetManager().MainDocumentPane == this; - } - } - - protected override void OnInitialized(EventArgs e) - { - this.CommandBindings.Add( - new CommandBinding(ShowDocumentsListMenuCommand, ExecutedShowDocumentsListMenuCommand, CanExecuteShowDocumentsListMenuCommand)); - this.CommandBindings.Add( - new CommandBinding(ApplicationCommands.Close, ExecutedCloseCommand, CanExecuteCloseCommand)); - this.CommandBindings.Add( - new CommandBinding(CloseCommand, ExecutedCloseCommand, CanExecuteCloseCommand)); - - this.CommandBindings.Add( - new CommandBinding(CloseAllButThisCommand, this.OnExecuteCommand, this.OnCanExecuteCommand)); - this.CommandBindings.Add( - new CommandBinding(NewHorizontalTabGroupCommand, this.OnExecuteCommand, this.OnCanExecuteCommand)); - this.CommandBindings.Add( - new CommandBinding(NewVerticalTabGroupCommand, this.OnExecuteCommand, this.OnCanExecuteCommand)); - - - base.OnInitialized(e); - } - - #region DocumentPane Commands - - - #region Show Document Window List Command - - public static RoutedCommand ShowDocumentsListMenuCommand = new RoutedCommand(); - - public void ExecutedShowDocumentsListMenuCommand(object sender, - ExecutedRoutedEventArgs e) - { - //MessageBox.Show("ShowOptionsMenu"); - ShowDocumentsListMenu(this, null); - } - - - public void CanExecuteShowDocumentsListMenuCommand(object sender, - CanExecuteRoutedEventArgs e) - { - e.CanExecute = true; - } - - #endregion - - - #region Close Command - - //ApplicationCommands.Close command.... - - public void ExecutedCloseCommand(object sender, - ExecutedRoutedEventArgs e) - { - if (GetManager() == null) - return; - - ManagedContent contentToClose = SelectedItem as ManagedContent; - - if (e.Parameter is ManagedContent) - contentToClose = e.Parameter as ManagedContent; - - DockableContent dockableContent = contentToClose as DockableContent; - - if (dockableContent != null) - CloseOrHide(dockableContent); - else - { - DocumentContent documentContent = contentToClose as DocumentContent; - documentContent.Close(); - - //if (documentContent != null) - // Items.Remove(documentContent); - - //CheckContentsEmpty(); - } - - } - - - public void CanExecuteCloseCommand(object sender, - CanExecuteRoutedEventArgs e) - { - e.CanExecute = true; - } - - #endregion - - #region Activate Document Command - public static RoutedCommand ActivateDocumentCommand = new RoutedCommand(); - - public void ExecutedActivateDocumentCommand(object sender, - ExecutedRoutedEventArgs e) - { - ManagedContent doc = e.Parameter as ManagedContent; - if (doc != null) - { - if (!DocumentTabPanel.GetIsHeaderVisible(doc)) - { - DocumentPane parentPane = doc.ContainerPane as DocumentPane; - parentPane.Items.Remove(doc); - parentPane.Items.Insert(0, doc); - } - ////doc.IsSelected = true; - ////Selector.SetIsSelected(doc, true); - //if (this.GetManager() != null) - // this.GetManager().ActiveContent = doc; - doc.SetAsActive(); - } - } - - public void CanExecuteActivateDocumentCommand(object sender, - CanExecuteRoutedEventArgs e) - { - //ManagedContent doc = e.Parameter as ManagedContent; - //if (doc != null && !doc.IsSelected) - e.CanExecute = true; - } - - #endregion - - - #region Commands - private static object syncRoot = new object(); - - - private static RoutedUICommand closeAllButThisCommand = null; - public static RoutedUICommand CloseAllButThisCommand - { - get - { - lock (syncRoot) - { - if (null == closeAllButThisCommand) - { - closeAllButThisCommand = new RoutedUICommand("Close All But This", "CloseAllButThis", typeof(DocumentPane)); - } - } - return closeAllButThisCommand; - } - } - - private static RoutedUICommand closeCommand = null; - public static RoutedUICommand CloseCommand - { - get - { - lock (syncRoot) - { - if (null == closeCommand) - { - closeCommand = new RoutedUICommand("C_lose", "Close", typeof(DocumentPane)); - } - } - return closeCommand; - } - } - - private static RoutedUICommand newHTabGroupCommand = null; - public static RoutedUICommand NewHorizontalTabGroupCommand - { - get - { - lock (syncRoot) - { - if (null == newHTabGroupCommand) - { - newHTabGroupCommand = new RoutedUICommand("New Horizontal Tab Group", "NewHorizontalTabGroup", typeof(DocumentPane)); - } - } - return newHTabGroupCommand; - } - } - - private static RoutedUICommand newVTabGroupCommand = null; - public static RoutedUICommand NewVerticalTabGroupCommand - { - get - { - lock (syncRoot) - { - if (null == newVTabGroupCommand) - { - newVTabGroupCommand = new RoutedUICommand("New Vertical Tab Group", "NewVerticalTabGroup", typeof(DocumentPane)); - } - } - return newVTabGroupCommand; - } - } - - - - internal virtual void OnExecuteCommand(object sender, ExecutedRoutedEventArgs e) - { - if (e.Command == CloseAllButThisCommand) - { - CloseAllButThis(); - e.Handled = true; - } - else if (e.Command == NewHorizontalTabGroupCommand) - { - NewHorizontalTabGroup(); - e.Handled = true; - } - else if (e.Command == NewVerticalTabGroupCommand) - { - NewVerticalTabGroup(); - e.Handled = true; - } - - } - - protected virtual void OnCanExecuteCommand(object sender, CanExecuteRoutedEventArgs e) - { - e.CanExecute = this.GetManager() != null; - - if (e.CanExecute) - { - if (e.Command == NewHorizontalTabGroupCommand || - e.Command == NewVerticalTabGroupCommand) - { - if (this.Items.Count <= 1) - e.CanExecute = false; - } - } - } - - void CloseAllButThis() - { - DocumentContent activeContent = GetManager().ActiveDocument as DocumentContent; - foreach (DocumentContent cnt in this.GetManager().Documents) - { - if (cnt != activeContent) - cnt.Close(); - } - } - void NewHorizontalTabGroup() - { - ManagedContent activeContent = SelectedItem as ManagedContent; - DocumentPane newContainerPane = new DocumentPane(); - - int indexOfDocumentInItsContainer = activeContent.ContainerPane.Items.IndexOf(activeContent); - activeContent.ContainerPane.RemoveContent(indexOfDocumentInItsContainer); - newContainerPane.Items.Add(activeContent); - - GetManager().Anchor(newContainerPane, this, AnchorStyle.Bottom); - - } - void NewVerticalTabGroup() - { - ManagedContent activeContent = SelectedItem as ManagedContent; - DocumentPane newContainerPane = new DocumentPane(); - - int indexOfDocumentInItsContainer = activeContent.ContainerPane.Items.IndexOf(activeContent); - activeContent.ContainerPane.RemoveContent(indexOfDocumentInItsContainer); - newContainerPane.Items.Add(activeContent); - - GetManager().Anchor(newContainerPane, this, AnchorStyle.Right); - } - - #endregion - - #endregion - - UIElement _optionsContextMenuPlacementTarget; - - public override void OnApplyTemplate() - { - _optionsContextMenuPlacementTarget = GetTemplateChild("PART_ShowContextMenuButton") as UIElement; - - - - base.OnApplyTemplate(); - } - - void ShowDocumentsListMenu(object sender, RoutedEventArgs e) - { - if (Items.Count == 0) - return; //nothings to show - - ContextMenu cxMenuDocuments = (ContextMenu)FindResource("DocumentsListMenu"); - if (cxMenuDocuments != null) - { - cxMenuDocuments.ItemsSource = Items; - cxMenuDocuments.CommandBindings.Add(new CommandBinding(ActivateDocumentCommand, new ExecutedRoutedEventHandler(this.ExecutedActivateDocumentCommand), new CanExecuteRoutedEventHandler(CanExecuteActivateDocumentCommand))); - - if (_optionsContextMenuPlacementTarget != null) - { - cxMenuDocuments.Placement = PlacementMode.Bottom; - cxMenuDocuments.PlacementTarget = _optionsContextMenuPlacementTarget; - } - else - { - cxMenuDocuments.Placement = PlacementMode.MousePoint; - cxMenuDocuments.PlacementTarget = this; - } - - cxMenuDocuments.IsOpen = true; - } - } - - public override bool IsSurfaceVisible - { - get - { - if (IsMainDocumentPane.HasValue && - !IsMainDocumentPane.Value && - Items.Count == 0) - return false; - - return true; - } - } - - protected override void OnMouseDown(MouseButtonEventArgs e) - { - base.OnMouseDown(e); - - if (!e.Handled) - { - if (_partHeader != null && - !_partHeader.IsMouseOver) - { - //prevent document content to start dragging when it is clicked outside of the header area - e.Handled = true; - } - } - } - - internal void CheckContentsEmpty() - { - if (Items.Count == 0) - { - bool isMainDocPaneToBeClose = IsMainDocumentPane.HasValue && - IsMainDocumentPane.Value; - - if (isMainDocPaneToBeClose) - { - DockingManager manager = GetManager(); - DocumentPane candidateNewMainDocPane = manager.FindAnotherLogicalChildContained(this); - if (candidateNewMainDocPane != null) - { - ResizingPanel containerPanel = Parent as ResizingPanel; - if (containerPanel != null) - containerPanel.RemoveChild(this); - - manager.MainDocumentPane = candidateNewMainDocPane; - candidateNewMainDocPane.NotifyPropertyChanged("IsMainDocumentPane"); - } - } - else - { - ResizingPanel containerPanel = Parent as ResizingPanel; - if (containerPanel != null) - containerPanel.RemoveChild(this); - } - } - - } - - - internal override ResizingPanel GetContainerPanel() - { - return GetParentDocumentPaneResizingPanel(); - } - - internal DocumentPaneResizingPanel GetParentDocumentPaneResizingPanel() - { - ResizingPanel parentPanel = LogicalTreeHelper.GetParent(this) as ResizingPanel; - - if (parentPanel == null) - return null; - - while (!(parentPanel is DocumentPaneResizingPanel)) - { - parentPanel = LogicalTreeHelper.GetParent(parentPanel) as ResizingPanel; - - if (parentPanel == null) - return null; - } - - return parentPanel as DocumentPaneResizingPanel; - } - - public override Rect SurfaceRectangle - { - get - { - //it is dragging a document let drop in this document pane - if (GetManager().DragPaneServices.FloatingWindow is DocumentFloatingWindow) - return base.SurfaceRectangle; - - //otherwise we should provide a drop surface for all the DocumentPaneResizingPanel - DocumentPaneResizingPanel parentPanel = GetParentDocumentPaneResizingPanel(); - - if (parentPanel == null) - return base.SurfaceRectangle; - - return new Rect(HelperFunc.PointToScreenWithoutFlowDirection(parentPanel, new Point(0, 0)), new Size(parentPanel.ActualWidth, parentPanel.ActualHeight)); - //return new Rect(parentPanel.PointToScreen(new Point(0, 0)), new Size(parentPanel.ActualWidth, parentPanel.ActualHeight)); - } - } - - protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) - { - if (e.NewItems != null) - { - foreach (object newItem in e.NewItems) - { - if (!(newItem is DockableContent) && - !(newItem is DocumentContent)) - throw new InvalidOperationException("DocumentPane can contain only DockableContents or DocumentContents!"); - - if (newItem is DockableContent && - (((DockableContent)newItem).DockableStyle & DockableStyle.Document) == 0) - { - ((DockableContent)newItem).DockableStyle |= DockableStyle.Document; - } - - } - } - - base.OnItemsChanged(e); - } - - protected override void OnSelectionChanged(SelectionChangedEventArgs e) - { - ManagedContent selectedContent = this.SelectedItem as ManagedContent; - if (selectedContent != null && GetManager() != null) - GetManager().ActiveDocument = selectedContent; - - base.OnSelectionChanged(e); - } - - } -} diff --git a/src/Libraries/AvalonDock/DocumentPaneResizingPanel.cs b/src/Libraries/AvalonDock/DocumentPaneResizingPanel.cs deleted file mode 100644 index 2eeb3c6988..0000000000 --- a/src/Libraries/AvalonDock/DocumentPaneResizingPanel.cs +++ /dev/null @@ -1,55 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.Windows.Markup; -using System.Diagnostics; - -namespace AvalonDock -{ - public class DocumentPaneResizingPanel : ResizingPanel - { - -//#if DEBUG -// static int inst = 0; -// public DocumentPaneResizingPanel() -// { -// inst++; -// Debug.Assert(inst < 2); -// } -//#endif - } -} diff --git a/src/Libraries/AvalonDock/DocumentTabPanel.cs b/src/Libraries/AvalonDock/DocumentTabPanel.cs deleted file mode 100644 index 036691b0f2..0000000000 --- a/src/Libraries/AvalonDock/DocumentTabPanel.cs +++ /dev/null @@ -1,105 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.Diagnostics; -using System.ComponentModel; - -namespace AvalonDock -{ - [EditorBrowsable(EditorBrowsableState.Never)] - public class DocumentTabPanel : PaneTabPanel - { - public static bool GetIsHeaderVisible(DependencyObject obj) - { - return (bool)obj.GetValue(IsHeaderVisibleProperty); - } - - public static void SetIsHeaderVisible(DependencyObject obj, bool value) - { - obj.SetValue(IsHeaderVisibleProperty, value); - } - - // Using a DependencyProperty as the backing store for IsHeaderVisible. This enables animation, styling, binding, etc... - public static readonly DependencyProperty IsHeaderVisibleProperty = - DependencyProperty.RegisterAttached("IsHeaderVisible", typeof(bool), typeof(DocumentTabPanel), new UIPropertyMetadata(false)); - - - protected override Size MeasureOverride(Size availableSize) - { - Size desideredSize = new Size(0, availableSize.Height); - int i = 1; - - foreach (ManagedContent child in Children) - { - Panel.SetZIndex(child, Selector.GetIsSelected(child)?1:-i); - i++; - child.Width = double.NaN; - child.Height = double.NaN; - child.Measure(new Size(double.PositiveInfinity, availableSize.Height)); - desideredSize.Width += child.DesiredSize.Width; - } - - return base.MeasureOverride(availableSize); - //return desideredSize; - } - - protected override Size ArrangeOverride(Size finalSize) - { - double offset = 0.0; - bool skipAllOthers = false; - foreach (ManagedContent doc in Children) - { - if (skipAllOthers || offset + doc.DesiredSize.Width > finalSize.Width) - { - SetIsHeaderVisible(doc, false); - doc.Arrange(new Rect()); - skipAllOthers = true; - } - else - { - SetIsHeaderVisible(doc, true); - doc.Arrange(new Rect(offset, 0.0, doc.DesiredSize.Width, finalSize.Height)); - offset += doc.ActualWidth; - } - } - - return finalSize; - - } - } -} diff --git a/src/Libraries/AvalonDock/DrWPF/ConceptualPanel.cs b/src/Libraries/AvalonDock/DrWPF/ConceptualPanel.cs deleted file mode 100644 index 05684dfa86..0000000000 --- a/src/Libraries/AvalonDock/DrWPF/ConceptualPanel.cs +++ /dev/null @@ -1,120 +0,0 @@ -/* Copyright (c) 2008, Dr. WPF - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * The name Dr. WPF may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY Dr. WPF ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Dr. WPF BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows.Controls; -using System.Windows; -using System.Collections.Specialized; -using System.Windows.Media; - -namespace DrWPF.Windows.Controls -{ - /// - /// This panel maintains a collection of conceptual children that are neither logical - /// children nor visual children of the panel. This allows those visuals to be connected - /// to other parts of the UI, if necessary, or even to remain disconnected. - /// - public abstract class ConceptualPanel : Panel - { - public ConceptualPanel() - { - Loaded += OnLoaded; - } - - void OnLoaded(object sender, RoutedEventArgs e) - { - Loaded -= OnLoaded; - (Children as DisconnectedUIElementCollection).Initialize(); - } - - protected override sealed UIElementCollection CreateUIElementCollection(FrameworkElement logicalParent) - { - DisconnectedUIElementCollection children = new DisconnectedUIElementCollection(this); - children.CollectionChanged += new NotifyCollectionChangedEventHandler(OnChildrenCollectionChanged); - return children; - } - - protected virtual void OnChildAdded(UIElement child) - { - } - - protected virtual void OnChildRemoved(UIElement child) - { - } - - /// - /// For simplicity, this class will listen to change notifications on the DisconnectedUIElementCollection - /// and provide them to descendants through the OnChildAdded and OnChildRemoved members. - /// - private void OnChildrenCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - switch (e.Action) - { - case NotifyCollectionChangedAction.Add: - OnChildAdded(e.NewItems[0] as UIElement); - break; - - case NotifyCollectionChangedAction.Remove: - OnChildRemoved(e.OldItems[0] as UIElement); - break; - } - } - - protected override int VisualChildrenCount - { - get { return VisualChildren.Count; } - } - - protected override Visual GetVisualChild(int index) - { - if (index < 0 || index >= VisualChildren.Count) - throw new ArgumentOutOfRangeException(); - return VisualChildren[index]; - } - - protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved) - { - if (visualAdded is Visual) - { - VisualChildren.Add(visualAdded as Visual); - } - - if (visualRemoved is Visual) - { - VisualChildren.Remove(visualRemoved as Visual); - } - - base.OnVisualChildrenChanged(visualAdded, visualRemoved); - } - - protected readonly List VisualChildren = new List(); - } -} diff --git a/src/Libraries/AvalonDock/DrWPF/DisconnectedUIElementCollection.cs b/src/Libraries/AvalonDock/DrWPF/DisconnectedUIElementCollection.cs deleted file mode 100644 index 840fb45e7a..0000000000 --- a/src/Libraries/AvalonDock/DrWPF/DisconnectedUIElementCollection.cs +++ /dev/null @@ -1,367 +0,0 @@ -/* Copyright (c) 2008, Dr. WPF - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * The name Dr. WPF may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY Dr. WPF ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Dr. WPF BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows.Controls; -using System.Windows; -using System.Collections.ObjectModel; -using System.Collections; -using System.Windows.Media; -using System.Diagnostics; -using System.Collections.Specialized; - -namespace DrWPF.Windows.Controls -{ - public class DisconnectedUIElementCollection : UIElementCollection, INotifyCollectionChanged - { - #region constructors - - /// - /// This collection can be used by a panel to maintain a collection of child elements - /// that are *not* connected to their owner as visual children or logical children. - /// - public DisconnectedUIElementCollection(UIElement owner) - : this(owner, new SurrogateVisualParent()) - { - } - - private DisconnectedUIElementCollection(UIElement owner, SurrogateVisualParent surrogateVisualParent) - : base(surrogateVisualParent, null) - { - _ownerPanel = owner as Panel; - _surrogateVisualParent = surrogateVisualParent; - _surrogateVisualParent.InitializeOwner(this); - _elements = new Collection(); - } - - #endregion - - #region UIElementCollection overrides - - /// - /// Adds the element to the DisconnectedUIElementCollection - /// - public override int Add(UIElement element) - { - VerifyWriteAccess(); - return base.Add(element); - } - - public override int Capacity - { - get { return base.Capacity; } - set - { - VerifyWriteAccess(); - base.Capacity = value; - } - } - - /// - /// Removes all elements from the DisconnectedUIElementCollection - /// - public override void Clear() - { - VerifyWriteAccess(); - base.Clear(); - } - - /// - /// Determines whether an element is in the DisconnectedUIElementCollection - /// - public override bool Contains(UIElement element) - { - return _elements.Contains(element); - } - - /// - /// Copies the collection into the Array - /// - public override void CopyTo(Array array, int index) - { - ((ICollection)_elements).CopyTo(array, index); - } - - /// - /// Strongly typed version of CopyTo - /// - public override void CopyTo(UIElement[] array, int index) - { - _elements.CopyTo(array, index); - } - - /// - /// Gets the number of elements in the collection. - /// - public override int Count - { - get { return _elements.Count; } - } - - /// - /// Returns an enumerator that can iterate through the collection. - /// - public override IEnumerator GetEnumerator() - { - return (_elements as ICollection).GetEnumerator(); - } - - /// - /// Returns the index of the element in the DisconnectedUIElementCollection - /// - public override int IndexOf(UIElement element) - { - return _elements.IndexOf(element); - } - - /// - /// Inserts an element into the DisconnectedUIElementCollection at the specified index - /// - public override void Insert(int index, UIElement element) - { - VerifyWriteAccess(); - base.Insert(index, element); - } - - /// - /// Removes the specified element from the DisconnectedUIElementCollection - /// - public override void Remove(UIElement element) - { - VerifyWriteAccess(); - base.Remove(_degenerateSiblings[element]); - } - - /// - /// Removes the element at the specified index from the DisconnectedUIElementCollection - /// - public override void RemoveAt(int index) - { - VerifyWriteAccess(); - base.RemoveAt(index); - } - - /// - /// Removes the specified number of elements starting at the specified index from the DisconnectedUIElementCollection - /// - public override void RemoveRange(int index, int count) - { - VerifyWriteAccess(); - base.RemoveRange(index, count); - } - - public override UIElement this[int index] - { - get { return _elements[index] as UIElement; } - set - { - VerifyWriteAccess(); - base[index] = value; - } - } - - #endregion - - #region public methods - - /// - /// The Initialize method is simply exposed as an accessible member that can - /// be called from the ConceptualPanel's Loaded event. Accessing this member - /// via the Children property will implicitly cause CreateUIElementCollection - /// to be called to create the disconnected collection. This method exists - /// because simple access of a property like Count might be optimized away by - /// an aggressive compiler. - /// - public void Initialize() - { - // do nothing - } - - #endregion - - #region private methods - - private int BaseIndexOf(UIElement element) - { - return base.IndexOf(element); - } - - private void BaseInsert(int index, UIElement element) - { - base.Insert(index, element); - } - - private void BaseRemoveAt(int index) - { - base.RemoveAt(index); - } - - private UIElement EnsureUIElement(object value) - { - if (value == null) - throw new ArgumentException("Cannot add a null value to a DisconnectedUIElementCollection"); - - if (!(value is UIElement)) - throw new ArgumentException("Only objects of type UIElement can be added to a DisconnectedUIElementCollection"); - - return value as UIElement; - } - - /// - /// If the owner is an items host, we need to enforce the rule that elements - /// cannot be explicitly added to the disconnected collection. However, it is still - /// possible to modify the visual or logical "connected" children of a ConceptualPanel - /// while it is an items host by simply calling the AddVisualChild, RemoveVisualChild, - /// AddLogicalChild, or RemoveLogicalChild methods. Logic within ConceptualPanel - /// ensures that any visual children added in this manner will be returned within - /// a GetVisualChild() enumeration. - /// - private void VerifyWriteAccess() - { - // if the owner is not a panel, just return - if (_ownerPanel == null) return; - - // check whether the owner is an items host for an ItemsControl - if (_ownerPanel.IsItemsHost && ItemsControl.GetItemsOwner(_ownerPanel) != null) - throw new InvalidOperationException("Disconnected children cannot be explicitly added to this " - + "collection while the panel is serving as an items host. However, visual children can " - + "be added by simply calling the AddVisualChild method."); - } - - #endregion - - #region INotifyCollectionChanged Members - - /// - /// Since the owner of the collection is not the parent of the elements, it needs - /// a mechanism by which to monitor its collection of child visuals. - /// This class provides such notifications via INotifyCollectionChanged. - /// - public event NotifyCollectionChangedEventHandler CollectionChanged; - private void RaiseCollectionChanged(NotifyCollectionChangedAction action, object changedItem, int index) - { - if (CollectionChanged != null) - CollectionChanged(this, new NotifyCollectionChangedEventArgs(action, changedItem, index)); - } - - #endregion - - #region private supporting classes - - #region DegenerateSibling - - private class DegenerateSibling : UIElement - { - public DegenerateSibling(UIElement element) - { - _element = element; - } - - public UIElement Element - { - get { return _element; } - } - - private UIElement _element; - } - - #endregion - - #region SurrogateVisualParent - - private class SurrogateVisualParent : UIElement - { - internal void InitializeOwner(DisconnectedUIElementCollection owner) - { - _owner = owner; - } - - protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved) - { - // avoid reentrancy during internal updates - if (_internalUpdate) return; - - _internalUpdate = true; - try - { - // when a UIElement is added, replace it with its degenerate sibling - if (visualAdded != null) - { - Debug.Assert(!(visualAdded is DegenerateSibling), - "Unexpected addition of degenerate... All degenerates should be added during internal updates."); - - UIElement element = visualAdded as UIElement; - DegenerateSibling sibling = new DegenerateSibling(element); - int index = _owner.BaseIndexOf(element); - _owner.BaseRemoveAt(index); - _owner.BaseInsert(index, sibling); - _owner._degenerateSiblings[element] = sibling; - _owner._elements.Insert(index, element); - _owner.RaiseCollectionChanged(NotifyCollectionChangedAction.Add, element, index); - } - - // when a degenerate sibling is removed, remove its corresponding element - if (visualRemoved != null) - { - Debug.Assert(visualRemoved is DegenerateSibling, - "Unexpected removal of UIElement... All non degenerates should be removed during internal updates."); - - DegenerateSibling sibling = visualRemoved as DegenerateSibling; - int index = _owner._elements.IndexOf(sibling.Element); - _owner._elements.RemoveAt(index); - _owner.RaiseCollectionChanged(NotifyCollectionChangedAction.Remove, sibling.Element, index); - _owner._degenerateSiblings.Remove(sibling.Element); - } - } - finally - { - _internalUpdate = false; - } - } - - private DisconnectedUIElementCollection _owner; - private bool _internalUpdate = false; - } - - #endregion - - #endregion - - #region fields - - private Dictionary _degenerateSiblings = new Dictionary(); - private Collection _elements = new Collection(); - private Panel _ownerPanel; - private SurrogateVisualParent _surrogateVisualParent; - - #endregion - } -} diff --git a/src/Libraries/AvalonDock/DrWPF/LogicalPanel.cs b/src/Libraries/AvalonDock/DrWPF/LogicalPanel.cs deleted file mode 100644 index fa90f0c5c0..0000000000 --- a/src/Libraries/AvalonDock/DrWPF/LogicalPanel.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (c) 2008, Dr. WPF - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * The name Dr. WPF may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY Dr. WPF ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL Dr. WPF BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Windows.Controls; -using System.Windows; -using System.Collections.Specialized; - -namespace DrWPF.Windows.Controls -{ - /// - /// This panel extends ConceptualPanel by ensuring that its conceptual children are also "logical" children. - /// Because certain things like property inheritance and resource resolution work through the logical - /// tree, this allows the disconnected visuals to be connected to the panel's ancestor tree - /// in a logical manner without being part of it's visual tree. - /// - public abstract class LogicalPanel : ConceptualPanel - { - protected sealed override void OnChildAdded(UIElement child) - { - // if the child does not have a logical parent, assume the role - if (LogicalTreeHelper.GetParent(child) == null) - { - AddLogicalChild(child); - } - OnLogicalChildrenChanged(child, null); - } - - protected sealed override void OnChildRemoved(UIElement child) - { - // if this panel is the logical parent, remove that relationship - if (LogicalTreeHelper.GetParent(child) == this) - { - RemoveLogicalChild(child); - } - OnLogicalChildrenChanged(null, child); - } - - /// - /// This class uses the OnLogicalChildrenChanged method to provide notification to descendants - /// when its logical children change. Note that this is intentionally - /// similar to the OnVisualChildrenChanged approach supported by all visuals. - /// - /// - /// - protected virtual void OnLogicalChildrenChanged(UIElement childAdded, UIElement childRemoved) - { - } - } -} diff --git a/src/Libraries/AvalonDock/DragPaneServices.cs b/src/Libraries/AvalonDock/DragPaneServices.cs deleted file mode 100644 index e9b936a3d4..0000000000 --- a/src/Libraries/AvalonDock/DragPaneServices.cs +++ /dev/null @@ -1,177 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Diagnostics; - -namespace AvalonDock -{ - /// - /// Provides drag-drop functionalities for dockable panes - /// - internal sealed class DragPaneServices - { - List Surfaces = new List(); - List SurfacesWithDragOver = new List(); - - DockingManager _owner; - - public DockingManager DockManager - { - get { return _owner; } - } - - public DragPaneServices(DockingManager owner) - { - _owner = owner; - } - - public void Register(IDropSurface surface) - { - if (!Surfaces.Contains(surface)) - Surfaces.Add(surface); - } - - public void Unregister(IDropSurface surface) - { - Surfaces.Remove(surface); - } - - Point Offset; - - - public void StartDrag(FloatingWindow wnd, Point point, Point offset) - { - Offset = offset; - - _wnd = wnd; - - if (Offset.X >= _wnd.Width) - Offset.X = _wnd.Width / 2; - - - _wnd.Left = point.X - Offset.X; - _wnd.Top = point.Y - Offset.Y; - _wnd.Show(); - - int surfaceCount = 0; - restart: - surfaceCount = Surfaces.Count; - foreach (IDropSurface surface in Surfaces) - { - if (surface.SurfaceRectangle.Contains(point)) - { - SurfacesWithDragOver.Add(surface); - surface.OnDragEnter(point); - Debug.WriteLine("Enter " + surface.ToString()); - if (surfaceCount != Surfaces.Count) - { - //Surfaces list has been changed restart cycle - SurfacesWithDragOver.Clear(); - goto restart; - } - } - } - - } - - public void MoveDrag(Point point) - { - if (_wnd == null) - return; - - _wnd.Left = point.X - Offset.X; - _wnd.Top = point.Y - Offset.Y; - - List enteringSurfaces = new List(); - foreach (IDropSurface surface in Surfaces) - { - if (surface.SurfaceRectangle.Contains(point)) - { - if (!SurfacesWithDragOver.Contains(surface)) - enteringSurfaces.Add(surface); - else - surface.OnDragOver(point); - } - else if (SurfacesWithDragOver.Contains(surface)) - { - SurfacesWithDragOver.Remove(surface); - surface.OnDragLeave(point); - } - } - - foreach (IDropSurface surface in enteringSurfaces) - { - SurfacesWithDragOver.Add(surface); - surface.OnDragEnter(point); - } - } - - public void EndDrag(Point point) - { - IDropSurface dropSufrace = null; - foreach (IDropSurface surface in Surfaces) - { - if (surface.SurfaceRectangle.Contains(point)) - { - if (surface.OnDrop(point)) - { - dropSufrace = surface; - break; - } - } - } - - foreach (IDropSurface surface in SurfacesWithDragOver) - { - if (surface != dropSufrace) - { - surface.OnDragLeave(point); - } - } - - SurfacesWithDragOver.Clear(); - - _wnd.OnEndDrag();//notify floating window that drag operation is coming to end - - if (dropSufrace != null) - _wnd.Close(); - else - _wnd.Activate(); - - _wnd = null; - } - - FloatingWindow _wnd; - public FloatingWindow FloatingWindow - { - get { return _wnd; } - } - - } -} diff --git a/src/Libraries/AvalonDock/FloatingDockablePane.cs b/src/Libraries/AvalonDock/FloatingDockablePane.cs deleted file mode 100644 index 9b4bc9baa7..0000000000 --- a/src/Libraries/AvalonDock/FloatingDockablePane.cs +++ /dev/null @@ -1,68 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; - -namespace AvalonDock -{ - public class FloatingDockablePane : DockablePane - { - static FloatingDockablePane() - { - //DefaultStyleKeyProperty.OverrideMetadata(typeof(FloatingDockablePane), new FrameworkPropertyMetadata(typeof(FloatingDockablePane))); - DockablePane.ShowHeaderProperty.OverrideMetadata(typeof(FloatingDockablePane), new FrameworkPropertyMetadata(false)); - } - - public FloatingDockablePane(FloatingWindow floatingWindow) - { - _floatingWindow = floatingWindow; - } - - FloatingWindow _floatingWindow = null; - - public FloatingWindow FloatingWindow - { - get { return _floatingWindow; } - } - - public override DockingManager GetManager() - { - return _floatingWindow.Manager; - } - - protected override void CheckItems(System.Collections.IList newItems) - { - foreach (object newItem in newItems) - { - if (!(newItem is DockableContent) && !(newItem is DocumentContent)) - throw new InvalidOperationException("FloatingDockablePane can contain only DockableContents and DocumentContents!"); - } - } - - } -} diff --git a/src/Libraries/AvalonDock/FloatingWindow.cs b/src/Libraries/AvalonDock/FloatingWindow.cs deleted file mode 100644 index 4b76cee13a..0000000000 --- a/src/Libraries/AvalonDock/FloatingWindow.cs +++ /dev/null @@ -1,502 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.ComponentModel; -using System.Windows.Markup; -using System.Diagnostics; -using System.Windows.Threading; -using System.Windows.Media.Animation; -using System.Windows.Interop; -using System.Runtime.InteropServices; - -namespace AvalonDock -{ - public abstract class FloatingWindow : Window, INotifyPropertyChanged - { - static FloatingWindow() - { - Window.ShowInTaskbarProperty.OverrideMetadata(typeof(FloatingWindow), new FrameworkPropertyMetadata(false)); - Window.WindowStyleProperty.OverrideMetadata(typeof(FloatingWindow), new FrameworkPropertyMetadata(WindowStyle.ToolWindow)); - } - - - public FloatingWindow() - { - this.Loaded += new RoutedEventHandler(OnLoaded); - this.Unloaded += new RoutedEventHandler(OnUnloaded); - - this.SizeChanged += new SizeChangedEventHandler(FloatingWindow_SizeChanged); - - this.CommandBindings.Add(new CommandBinding(SetAsDockableWindowCommand, OnExecuteCommand, OnCanExecuteCommand)); - this.CommandBindings.Add(new CommandBinding(SetAsFloatingWindowCommand, OnExecuteCommand, OnCanExecuteCommand)); - this.CommandBindings.Add(new CommandBinding(TabbedDocumentCommand, OnExecuteCommand, OnCanExecuteCommand)); - this.CommandBindings.Add(new CommandBinding(CloseCommand, OnExecuteCommand, OnCanExecuteCommand)); - } - - void FloatingWindow_SizeChanged(object sender, SizeChangedEventArgs e) - { - if (HostedPane != null) - { - foreach (ManagedContent c in HostedPane.Items) - c.FloatingWindowSize = new Size(Width, Height); - - ResizingPanel.SetEffectiveSize(HostedPane, new Size(Width, Height)); - } - } - - public FloatingWindow(DockingManager manager) - : this() - { - //save manager ref - _manager = manager; - } - - DockingManager _manager = null; - - internal DockingManager Manager - { - get { return _manager; } - } - - - public FloatingDockablePane HostedPane - { - get { return (FloatingDockablePane)GetValue(ReferencedPaneProperty); } - set { SetValue(ReferencedPaneProperty, value); } - } - - // Using a DependencyProperty as the backing store for HostedPane. This enables animation, styling, binding, etc... - public static readonly DependencyProperty ReferencedPaneProperty = - DependencyProperty.Register("HostedPane", typeof(FloatingDockablePane), typeof(FlyoutPaneWindow)); - - - internal virtual void OnEndDrag() - { - } - - internal virtual void OnShowSelectionBox() - { - - } - - internal virtual void OnHideSelectionBox() - { - - } - - #region Active Content Management - ManagedContent lastActiveContent = null; - - protected override void OnActivated(EventArgs e) - { - if (Manager != null) - { - lastActiveContent = Manager.ActiveContent; - Manager.ActiveContent = HostedPane.SelectedItem as ManagedContent; - } - - base.OnActivated(e); - } - - protected override void OnDeactivated(EventArgs e) - { - if (Manager != null && lastActiveContent != null) - { - Manager.ActiveContent = lastActiveContent; - } - base.OnDeactivated(e); - } - #endregion - - #region IsClosing Flag Management - public void Close(bool force) - { - ForcedClosing = force; - base.Close(); - } - - protected bool ForcedClosing { get; private set; } - - - internal bool IsClosing { get; private set; } - - protected override void OnClosing(CancelEventArgs e) - { - if (HostedPane.Items.Count > 0 && !ForcedClosing) - { - ManagedContent cntToClose = HostedPane.Items[0] as ManagedContent; - if (!cntToClose.IsCloseable) - { - e.Cancel = true; - base.OnClosing(e); - return; - } - } - - IsClosing = true; - base.OnClosing(e); - } - - protected override void OnClosed(EventArgs e) - { - IsClosing = false; - base.OnClosed(e); - } - #endregion - - public abstract Pane ClonePane(); - - - #region Enable/Disable window Close Button - [DllImport("User32.dll", CharSet = CharSet.Auto)] - private static extern IntPtr GetSystemMenu( - IntPtr hWnd, - Int32 bRevert - ); - - [DllImport("User32.dll", CharSet = CharSet.Auto)] - private static extern int GetMenuItemCount( - IntPtr hMenu - ); - - [DllImport("User32.dll", CharSet = CharSet.Auto)] - private static extern int DrawMenuBar( - IntPtr hWnd - ); - - [DllImport("User32.dll", CharSet = CharSet.Auto)] - private static extern bool EnableMenuItem( - IntPtr hMenu, - Int32 uIDEnableItem, - Int32 uEnable - ); - - private const Int32 MF_BYPOSITION = 0x400; - private const Int32 MF_ENABLED = 0x0000; - private const Int32 MF_GRAYED = 0x0001; - private const Int32 MF_DISABLED = 0x0002; - - void EnableXButton() - { - WindowInteropHelper helper = new WindowInteropHelper(this); - IntPtr hMenu = GetSystemMenu(helper.Handle, 0); - - int menuItemCount = GetMenuItemCount(hMenu); - - EnableMenuItem(hMenu, menuItemCount - 1, MF_BYPOSITION | MF_ENABLED); - DrawMenuBar(helper.Handle); - } - - void DisableXButton() - { - WindowInteropHelper helper = new WindowInteropHelper(this); - IntPtr hMenu = GetSystemMenu(helper.Handle, 0); - - int menuItemCount = GetMenuItemCount(hMenu); - - EnableMenuItem(hMenu, menuItemCount - 1, MF_BYPOSITION | MF_DISABLED | MF_GRAYED); - DrawMenuBar(helper.Handle); - } - - #endregion - - #region Non-Client area management - - protected const int WM_MOVE = 0x0003; - protected const int WM_SIZE = 0x0005; - protected const int WM_NCMOUSEMOVE = 0xa0; - protected const int WM_NCLBUTTONDOWN = 0xA1; - protected const int WM_NCLBUTTONUP = 0xA2; - protected const int WM_NCLBUTTONDBLCLK = 0xA3; - protected const int WM_NCRBUTTONDOWN = 0xA4; - protected const int WM_NCRBUTTONUP = 0xA5; - protected const int HTCAPTION = 2; - protected const int SC_MOVE = 0xF010; - protected const int WM_SYSCOMMAND = 0x0112; - - - - #region Load/Unload window events - HwndSource _hwndSource; - HwndSourceHook _wndProcHandler; - - protected void OnLoaded(object sender, EventArgs e) - { - WindowInteropHelper helper = new WindowInteropHelper(this); - _hwndSource = HwndSource.FromHwnd(helper.Handle); - _wndProcHandler = new HwndSourceHook(FilterMessage); - _hwndSource.AddHook(_wndProcHandler); - - if (HostedPane.Items.Count > 0) - { - ManagedContent cntHosted = HostedPane.Items[0] as ManagedContent; - if (!cntHosted.IsCloseable) - { - DisableXButton(); - } - } - } - protected void OnUnloaded(object sender, EventArgs e) - { - if (_hwndSource != null) - _hwndSource.RemoveHook(_wndProcHandler); - } - #endregion - - - protected virtual IntPtr FilterMessage( - IntPtr hwnd, - int msg, - IntPtr wParam, - IntPtr lParam, - ref bool handled - ) - { - handled = false; - - if (Manager == null) - return IntPtr.Zero; - - switch (msg) - { - case WM_SIZE: - case WM_MOVE: - //HostedPane.ReferencedPane.SaveFloatingWindowSizeAndPosition(this); - break; - case WM_NCLBUTTONDOWN: - if (IsDockableWindow && wParam.ToInt32() == HTCAPTION) - { - short x = (short)((lParam.ToInt32() & 0xFFFF)); - short y = (short)((lParam.ToInt32() >> 16)); - - Point clickPoint = this.TransformToDeviceDPI(new Point(x, y)); - Manager.Drag(this, clickPoint, new Point(clickPoint.X - Left, clickPoint.Y - Top)); - - handled = true; - } - break; - case WM_NCLBUTTONDBLCLK: - if (IsDockableWindow && wParam.ToInt32() == HTCAPTION) - { - if (IsDockableWindow) - { - Redock(); - handled = true; - } - } - break; - case WM_NCRBUTTONDOWN: - if (wParam.ToInt32() == HTCAPTION) - { - short x = (short)((lParam.ToInt32() & 0xFFFF)); - short y = (short)((lParam.ToInt32() >> 16)); - - ContextMenu cxMenu = FindResource(new ComponentResourceKey(typeof(DockingManager), ContextMenuElement.FloatingWindow)) as ContextMenu; - if (cxMenu != null) - { - foreach (MenuItem menuItem in cxMenu.Items) - menuItem.CommandTarget = this; - - cxMenu.Placement = PlacementMode.AbsolutePoint; - cxMenu.PlacementRectangle = new Rect(new Point(x, y), new Size(0, 0)); - cxMenu.PlacementTarget = this; - cxMenu.IsOpen = true; - } - - handled = true; - } - break; - case WM_NCRBUTTONUP: - if (wParam.ToInt32() == HTCAPTION) - { - - handled = true; - } - break; - - } - - - return IntPtr.Zero; - } - #endregion - - #region Floating/dockable window state - bool _dockableWindow = true; - - public bool IsDockableWindow - { - get { return _dockableWindow; } - set - { - _dockableWindow = value; - - if (_dockableWindow) - { - foreach (ManagedContent content in HostedPane.Items) - if (content is DockableContent) - ((DockableContent)content).SetStateToDockableWindow(); - } - else - { - foreach (ManagedContent content in HostedPane.Items) - if (content is DockableContent) - ((DockableContent)content).SetStateToFloatingWindow(); - } - } - } - - public bool IsFloatingWindow - { - get { return !IsDockableWindow; } - set { IsDockableWindow = !value; } - } - - protected virtual void Redock() - { - - } - #endregion - - #region Commands - private static object syncRoot = new object(); - - private static RoutedUICommand tabbedDocumentCommand = null; - public static RoutedUICommand TabbedDocumentCommand - { - get - { - lock (syncRoot) - { - if (null == tabbedDocumentCommand) - { - tabbedDocumentCommand = new RoutedUICommand("T_abbed Document", "TabbedDocument", typeof(FloatingWindow)); - } - - } - return tabbedDocumentCommand; - } - } - - private static RoutedUICommand dockableCommand = null; - public static RoutedUICommand SetAsDockableWindowCommand - { - get - { - lock (syncRoot) - { - if (null == dockableCommand) - { - dockableCommand = new RoutedUICommand("D_ockable", "Dockable", typeof(FloatingWindow)); - } - - } - return dockableCommand; - } - } - - private static RoutedUICommand floatingCommand = null; - public static RoutedUICommand SetAsFloatingWindowCommand - { - get - { - lock (syncRoot) - { - if (null == floatingCommand) - { - floatingCommand = new RoutedUICommand("F_loating", "Floating", typeof(FloatingWindow)); - } - - } - return floatingCommand; - } - } - - private static RoutedUICommand closeCommand = null; - public static RoutedUICommand CloseCommand - { - get - { - lock (syncRoot) - { - if (null == closeCommand) - { - closeCommand = new RoutedUICommand("Close", "Close", typeof(FloatingWindow)); - } - - } - return closeCommand; - } - } - - protected virtual void OnExecuteCommand(object sender, ExecutedRoutedEventArgs e) - { - if (e.Command == SetAsDockableWindowCommand) - { - IsDockableWindow = true; - e.Handled = true; - } - else if (e.Command == SetAsFloatingWindowCommand) - { - IsFloatingWindow = true; - e.Handled = true; - } - } - - protected virtual void OnCanExecuteCommand(object sender, CanExecuteRoutedEventArgs e) - { - if (e.Command == SetAsDockableWindowCommand) - e.CanExecute = IsFloatingWindow; - else if (e.Command == SetAsFloatingWindowCommand) - e.CanExecute = IsDockableWindow; - else - e.CanExecute = true; - } - #endregion - - #region INotifyPropertyChanged Members - - public event PropertyChangedEventHandler PropertyChanged; - - protected void NotifyPropertyChanged(string propertyName) - { - if (PropertyChanged != null) - PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - #endregion - } -} diff --git a/src/Libraries/AvalonDock/FlyoutDockablePane.cs b/src/Libraries/AvalonDock/FlyoutDockablePane.cs deleted file mode 100644 index 6b75057884..0000000000 --- a/src/Libraries/AvalonDock/FlyoutDockablePane.cs +++ /dev/null @@ -1,113 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Input; - -namespace AvalonDock -{ - internal class FlyoutDockablePane : DockablePane - { - static FlyoutDockablePane() - { - DockablePane.ShowTabsProperty.AddOwner(typeof(FlyoutDockablePane), new FrameworkPropertyMetadata(false)); - } - - int _arrayIndexPreviousPane = -1; - - - public FlyoutDockablePane() - { } - - public FlyoutDockablePane(DockableContent content) - { - _referencedPane = content.ContainerPane as DockablePane; - _manager = _referencedPane.GetManager(); - - //save current content position in container pane - _arrayIndexPreviousPane = _referencedPane.Items.IndexOf(content); - Anchor = _referencedPane.Anchor; - - SetValue(ResizingPanel.ResizeWidthProperty, new GridLength(ResizingPanel.GetEffectiveSize(_referencedPane).Width)); - SetValue(ResizingPanel.ResizeHeightProperty, new GridLength(ResizingPanel.GetEffectiveSize(_referencedPane).Height)); - - - //if (double.IsInfinity(ResizingPanel.GetResizeWidth(this))) - // ResizingPanel.SetResizeWidth(this, 200); - //if (double.IsInfinity(ResizingPanel.GetResizeHeight(this))) - // ResizingPanel.SetResizeHeight(this, 200); - - this.Style = _referencedPane.Style; - - //remove content from container pane - //and add content to my temporary pane - _referencedPane.Items.RemoveAt(_arrayIndexPreviousPane); - this.Items.Add(content); - - - //select the single content in this pane - SelectedItem = this.Items[0]; - } - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - } - - internal void RestoreOriginalPane() - { - if (this.Items.Count == 1) - { - _referencedPane.Items.Insert(_arrayIndexPreviousPane, RemoveContent(0)); - ResizingPanel.SetResizeWidth(_referencedPane, ResizingPanel.GetResizeWidth(this)); - ResizingPanel.SetResizeHeight(_referencedPane, ResizingPanel.GetResizeHeight(this)); - } - } - - - DockablePane _referencedPane = null; - - DockingManager _manager = null; - - public override DockingManager GetManager() - { - return _manager; - } - - internal override void ToggleAutoHide() - { - GetManager().ToggleAutoHide(_referencedPane); - } - //internal override void Close() - //{ - // DockingManager manager = GetManager(); - // if (manager != null) - // Manager.Hide(SelectedItem as DockableContent); - //} - } -} diff --git a/src/Libraries/AvalonDock/FlyoutPaneWindow.cs b/src/Libraries/AvalonDock/FlyoutPaneWindow.cs deleted file mode 100644 index 8651c3d76c..0000000000 --- a/src/Libraries/AvalonDock/FlyoutPaneWindow.cs +++ /dev/null @@ -1,923 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.ComponentModel; -using System.Windows.Markup; -using System.Diagnostics; -using System.Windows.Threading; -using System.Windows.Media.Animation; -using System.Windows.Forms.Integration; -using System.Runtime.InteropServices; -using System.Windows.Interop; -using System.Threading; - -namespace AvalonDock -{ - [ContentPropertyAttribute("ReferencedPane")] - public class FlyoutPaneWindow : System.Windows.Window - { - static FlyoutPaneWindow() - { - //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. - //This style is defined in themes\generic.xaml - DefaultStyleKeyProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(typeof(FlyoutPaneWindow))); - - //AllowsTransparency slow down perfomance under XP/VISTA because rendering is enterely perfomed using CPU - //Window.AllowsTransparencyProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(true)); - - Window.WindowStyleProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(WindowStyle.None)); - Window.ShowInTaskbarProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(false)); - Window.ResizeModeProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(ResizeMode.NoResize)); - Control.BackgroundProperty.OverrideMetadata(typeof(FlyoutPaneWindow), new FrameworkPropertyMetadata(Brushes.Transparent)); - } - - public FlyoutPaneWindow() - { - Title = "AvalonDock_FlyoutPaneWindow"; - } - - - WindowsFormsHost _winFormsHost = null; - double _targetWidth; - double _targetHeight; - - internal double TargetWidth - { - get { return _targetWidth; } - set { _targetWidth = value; } - } - - internal double TargetHeight - { - get { return _targetHeight; } - set { _targetHeight = value; } - } - - double _minLeft; - double _minTop; - - internal double MinLeft - { - get { return _minLeft; } - set { _minLeft = value; } - } - - internal double MinTop - { - get { return _minTop; } - set { _minTop = value; } - } - - DockingManager _dockingManager = null; - - public FlyoutPaneWindow(DockingManager manager, DockableContent content) - : this() - { - //create a new temporary pane - _refPane = new FlyoutDockablePane(content); - _dockingManager = manager; - - _winFormsHost = ReferencedPane.GetLogicalChildContained(); - - if (_winFormsHost != null) - { - AllowsTransparency = false; - } - - this.Loaded += new RoutedEventHandler(FlyoutPaneWindow_Loaded); - } - - - void FlyoutPaneWindow_Loaded(object sender, RoutedEventArgs e) - { - StartOpenAnimation(); - //Storyboard storyBoard = new Storyboard(); - //double originalLeft = this.Left; - //double originalTop = this.Top; - - //AnchorStyle CorrectedAnchor = Anchor; - - //if (CorrectedAnchor == AnchorStyle.Left && FlowDirection == FlowDirection.RightToLeft) - // CorrectedAnchor = AnchorStyle.Right; - //else if (CorrectedAnchor == AnchorStyle.Right && FlowDirection == FlowDirection.RightToLeft) - // CorrectedAnchor = AnchorStyle.Left; - - - //if (CorrectedAnchor == AnchorStyle.Left || CorrectedAnchor == AnchorStyle.Right) - //{ - // DoubleAnimation anim = new DoubleAnimation(0.0, _targetWidth, new Duration(TimeSpan.FromMilliseconds(200))); - // Storyboard.SetTargetProperty(anim, new PropertyPath("Width")); - // this.Width = _targetWidth; - // //storyBoard.Children.Add(anim); - //} - //if (CorrectedAnchor == AnchorStyle.Right) - //{ - // //DoubleAnimation anim = new DoubleAnimation(this.Left, this.Left + this.ActualWidth, new Duration(TimeSpan.FromMilliseconds(500))); - - // DoubleAnimation anim = new DoubleAnimation(this.Left, Left - _targetWidth, new Duration(TimeSpan.FromMilliseconds(200))); - // Storyboard.SetTargetProperty(anim, new PropertyPath("Left")); - // storyBoard.Children.Add(anim); - //} - - //if (CorrectedAnchor == AnchorStyle.Top || CorrectedAnchor == AnchorStyle.Bottom) - //{ - // DoubleAnimation anim = new DoubleAnimation(0.0, _targetHeight, new Duration(TimeSpan.FromMilliseconds(200))); - // Storyboard.SetTargetProperty(anim, new PropertyPath("Height")); - // storyBoard.Children.Add(anim); - //} - //if (CorrectedAnchor == AnchorStyle.Bottom) - //{ - // DoubleAnimation anim = new DoubleAnimation(originalTop, originalTop - _targetHeight, new Duration(TimeSpan.FromMilliseconds(200))); - // Storyboard.SetTargetProperty(anim, new PropertyPath("Top")); - // storyBoard.Children.Add(anim); - //} - - //{ - // DoubleAnimation anim = new DoubleAnimation(0.0, 1.0, new Duration(TimeSpan.FromMilliseconds(100))); - // Storyboard.SetTargetProperty(anim, new PropertyPath("Opacity")); - // //AllowsTransparency slow down perfomance under XP/VISTA because rendering is enterely perfomed using CPU - // //storyBoard.Children.Add(anim); - //} - - //storyBoard.Completed += (anim, eventargs) => - // { - // if (CorrectedAnchor == AnchorStyle.Left) - // { - // this.Left = originalLeft; - // this.Width = _targetWidth; - // } - // if (CorrectedAnchor == AnchorStyle.Right) - // { - // this.Left = originalLeft - _targetWidth; - // this.Width = _targetWidth; - // } - // if (CorrectedAnchor == AnchorStyle.Top) - // { - // this.Top = originalTop; - // this.Height = _targetHeight; - // } - // if (CorrectedAnchor == AnchorStyle.Bottom) - // { - // this.Top = originalTop - _targetHeight; - // this.Height = _targetHeight; - // } - // }; - - //foreach (AnimationTimeline animTimeLine in storyBoard.Children) - //{ - // animTimeLine.FillBehavior = FillBehavior.Stop; - //} - - //storyBoard.Begin(this); - } - - protected override void OnClosed(EventArgs e) - { - ReferencedPane.RestoreOriginalPane(); - - base.OnClosed(e); - - _closed = true; - } - - bool _closed = false; - - internal bool IsClosed - { - get { return _closed; } - } - - //public AnchorStyle Anchor - //{ - // get { return (AnchorStyle)GetValue(AnchorPropertyKey.DependencyProperty); } - // protected set { SetValue(AnchorPropertyKey, value); } - //} - - //// Using a DependencyProperty as the backing store for Anchor. This enables animation, styling, binding, etc... - //public static readonly DependencyPropertyKey AnchorPropertyKey = - // DependencyProperty.RegisterReadOnly("Anchor", typeof(AnchorStyle), typeof(FlyoutPaneWindow), new UIPropertyMetadata(AnchorStyle.Right)); - - //public FlyoutDockablePane ReferencedPane - //{ - // get { return (FlyoutDockablePane)GetValue(ReferencedPaneProperty); } - // set { SetValue(ReferencedPaneProperty, value); } - //} - - //// Using a DependencyProperty as the backing store for EmbeddedPane. This enables animation, styling, binding, etc... - //public static readonly DependencyProperty ReferencedPaneProperty = - // DependencyProperty.Register("ReferencedPane", typeof(FlyoutDockablePane), typeof(FlyoutPaneWindow)); - - //AnchorStyle _anchor = AnchorStyle.Top; - //public AnchorStyle Anchor - //{ - // get { return _anchor; } - // set { _anchor = value; } - //} - - public AnchorStyle Anchor - { - get { return ReferencedPane.Anchor; } - } - - FlyoutDockablePane _refPane; - - internal FlyoutDockablePane ReferencedPane - { - get { return _refPane; } - //set - //{ - // _refPane = value; - //} - } - - - protected override void OnInitialized(EventArgs e) - { - base.OnInitialized(e); - - if (ReferencedPane == null) - _refPane = this.Content as FlyoutDockablePane; - - if (ReferencedPane != null) - { - - Content = ReferencedPane; - - _closingTimer = new DispatcherTimer( - new TimeSpan(0, 0, 2), - DispatcherPriority.Normal, - new EventHandler(OnCloseWindow), - Dispatcher.CurrentDispatcher); - } - - - } - - UIElement _resizer = null; - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - _resizer = GetTemplateChild("INT_Resizer") as UIElement; - - if (_resizer != null) - { - _resizer.MouseDown += new MouseButtonEventHandler(_resizer_MouseDown); - _resizer.MouseMove += new MouseEventHandler(_resizer_MouseMove); - _resizer.MouseUp += new MouseButtonEventHandler(_resizer_MouseUp); - } - } - - - #region Resize management - double originalWidth = 0.0; - double originalHeight = 0.0; - double originalLeft = 0.0; - double originalTop = 0.0; - Point ptStartDrag; - - private void _resizer_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) - { - UIElement dragElement = sender as UIElement; - - originalLeft = Left; - originalTop = Top; - originalWidth = Width; - originalHeight = Height; - - ptStartDrag = e.GetPosition(dragElement); - dragElement.CaptureMouse(); - } - - private void _resizer_MouseMove(object sender, System.Windows.Input.MouseEventArgs e) - { - UIElement dragElement = sender as UIElement; - - if (dragElement.IsMouseCaptured) - { - Point ptMoveDrag = e.GetPosition(dragElement); - AnchorStyle CorrectedAnchor = Anchor; - - if (CorrectedAnchor == AnchorStyle.Left && FlowDirection == FlowDirection.RightToLeft) - CorrectedAnchor = AnchorStyle.Right; - else if (CorrectedAnchor == AnchorStyle.Right && FlowDirection == FlowDirection.RightToLeft) - CorrectedAnchor = AnchorStyle.Left; - - double deltaX = FlowDirection == FlowDirection.LeftToRight ? ptMoveDrag.X - ptStartDrag.X : ptStartDrag.X - ptMoveDrag.X; - - double newWidth = Width; - double newHeight = Height; - - double newLeft = Left; - double newTop = Top; - - if (CorrectedAnchor == AnchorStyle.Left) - { - if (newWidth + deltaX < 4.0) - newWidth = 4.0; - else - newWidth += deltaX; - - } - else if (CorrectedAnchor == AnchorStyle.Top) - { - if (newHeight + (ptMoveDrag.Y - ptStartDrag.Y) < 4.0) - newHeight = 4.0; - else - newHeight += ptMoveDrag.Y - ptStartDrag.Y; - - } - else if (CorrectedAnchor == AnchorStyle.Right) - { - if (newWidth - (deltaX) < 4) - { - newLeft = originalLeft + originalWidth - 4; - newWidth = 4; - } - else - { - newLeft += deltaX; - newWidth -= deltaX; - } - - } - else if (CorrectedAnchor == AnchorStyle.Bottom) - { - if (newHeight - (ptMoveDrag.Y - ptStartDrag.Y) < 4) - { - newTop = originalTop + originalHeight - 4; - newHeight = 4; - } - else - { - newTop += ptMoveDrag.Y - ptStartDrag.Y; - newHeight -= ptMoveDrag.Y - ptStartDrag.Y; - } - } - - //ResizingPanel.SetResizeHeight(ReferencedPane, ReferencedPane.ActualHeight); - //ResizingPanel.SetResizeWidth(ReferencedPane, ReferencedPane.ActualWidth); - - Width = Math.Min(newWidth, MaxWidth); - Height = Math.Min(newHeight, MaxHeight); - - Left = Math.Max(newLeft, MinLeft); - Top = Math.Max(newTop, MinTop); - - ApplyRegion(new Rect(0, 0, this.Width, this.Height)); - } - } - - private void _resizer_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) - { - UIElement dragElement = sender as UIElement; - dragElement.ReleaseMouseCapture(); - - } - - #endregion - - #region Closing window strategies - - - DispatcherTimer _closingTimer = null; - - protected override void OnMouseLeave(MouseEventArgs e) - { - base.OnMouseLeave(e); - - if (!IsFocused && !IsKeyboardFocusWithin && !ReferencedPane.IsOptionsMenuOpened) - _closingTimer.Start(); - } - - protected override void OnMouseMove(MouseEventArgs e) - { - base.OnMouseMove(e); - - _closingTimer.Stop(); - } - - protected override void OnLostFocus(RoutedEventArgs e) - { - base.OnLostFocus(e); - - if (!IsMouseOver && !ReferencedPane.IsOptionsMenuOpened) - _closingTimer.Start(); - } - - protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e) - { - base.OnLostKeyboardFocus(e); - - if (!IsMouseOver) - _closingTimer.Start(); - } - - protected override void OnGotFocus(RoutedEventArgs e) - { - base.OnGotFocus(e); - _closingTimer.Stop(); - } - - protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e) - { - base.OnGotKeyboardFocus(e); - - _closingTimer.Stop(); - } - - internal void StartCloseWindow() - { - _closingTimer.Start(); - } - - void OnCloseWindow(object sender, EventArgs e) - { - //options menu is open don't close the flyout window - if (ReferencedPane.IsOptionsMenuOpened || - IsMouseDirectlyOver || - (_winFormsHost != null && _winFormsHost.IsFocused && _refPane.Items.Count > 0 && ((ManagedContent)_refPane.Items[0]).IsActiveContent)) - { - _closingTimer.Start(); - return; - } - - _closingTimer.Stop(); - - if (IsClosed) - return; - - StartCloseAnimation(); - } - - [DllImport("user32.dll")] - static extern int SetWindowRgn(IntPtr hWnd, IntPtr hRgn, bool bRedraw); - - [DllImport("gdi32.dll")] - static extern IntPtr CreateRectRgn(int left, int top, int right, int bottom); - - - [DllImport("gdi32.dll")] - static extern int CombineRgn(IntPtr hrgnDest, IntPtr hrgnSrc1, IntPtr hrgnSrc2, int fnCombineMode); - - enum CombineRgnStyles : int - { - RGN_AND = 1, - RGN_OR = 2, - RGN_XOR = 3, - RGN_DIFF = 4, - RGN_COPY = 5, - RGN_MIN = RGN_AND, - RGN_MAX = RGN_COPY - } - - - public bool IsClosing { get; private set; } - - internal void StartCloseAnimation() - { - AnchorStyle CorrectedAnchor = Anchor; - - if (CorrectedAnchor == AnchorStyle.Left && FlowDirection == FlowDirection.RightToLeft) - CorrectedAnchor = AnchorStyle.Right; - else if (CorrectedAnchor == AnchorStyle.Right && FlowDirection == FlowDirection.RightToLeft) - CorrectedAnchor = AnchorStyle.Left; - - double wnd_Width = this.ActualWidth; - double wnd_Height = this.ActualHeight; - double wnd_Left = this.Left; - double wnd_Top = this.Top; - - int wnd_TrimWidth = (int)wnd_Width; - int wnd_TrimHeight = (int)wnd_Height; - - int stepWidth = (int)(wnd_Width / 20); - int stepHeight = (int)(wnd_Height / 20); - - DispatcherTimer animTimer = new DispatcherTimer(); - animTimer.Interval = TimeSpan.FromMilliseconds(1); - - animTimer.Tick += (sender, eventArgs) => - { - bool stopTimer = false; - double newLeft = 0.0; - double newTop = 0.0; - switch (CorrectedAnchor) - { - case AnchorStyle.Right: - newLeft = this.Left; - if (this.Left + stepWidth >= wnd_Left + wnd_Width) - { - newLeft = wnd_Left + wnd_Width; - wnd_TrimWidth = 0; - stopTimer = true; - } - else - { - newLeft += stepWidth; - wnd_TrimWidth -= stepWidth; - wnd_TrimWidth = Math.Max(wnd_TrimWidth, 0); - } - - //SetWindowRgn(new WindowInteropHelper(this).Handle, CreateRectRgn(0, 0, wnd_TrimWidth, wnd_TrimHeight), true); - ApplyRegion(new Rect(0, 0, wnd_TrimWidth, wnd_TrimHeight)); - this.Left = newLeft; - break; - case AnchorStyle.Left: - newLeft = this.Left; - if (this.Left - stepWidth <= wnd_Left - wnd_Width) - { - newLeft = wnd_Left - wnd_Width; - wnd_TrimWidth = 0; - stopTimer = true; - } - else - { - newLeft -= stepWidth; - wnd_TrimWidth -= stepWidth; - wnd_TrimWidth = Math.Max(wnd_TrimWidth, 0); - } - - this.Left = newLeft; - //SetWindowRgn(new WindowInteropHelper(this).Handle, CreateRectRgn((int)(wnd_Left - this.Left), 0, (int)(wnd_Width), wnd_TrimHeight), true); - ApplyRegion( - new Rect((int)(wnd_Left - this.Left), 0, (int)(wnd_Width), wnd_TrimHeight)); - break; - case AnchorStyle.Bottom: - newTop = this.Top; - if (this.Top + stepHeight >= wnd_Top + wnd_Height) - { - newTop = wnd_Top + wnd_Height; - wnd_TrimHeight = 0; - stopTimer = true; - } - else - { - newTop += stepHeight; - wnd_TrimHeight -= stepHeight; - wnd_TrimHeight = Math.Max(wnd_TrimHeight, 0); - } - - //SetWindowRgn(new WindowInteropHelper(this).Handle, CreateRectRgn(0, 0, wnd_TrimWidth, wnd_TrimHeight), true); - ApplyRegion( - new Rect(0, 0, wnd_TrimWidth, wnd_TrimHeight)); - this.Top = newTop; - break; - case AnchorStyle.Top: - newTop = this.Top; - if (this.Top - stepHeight <= wnd_Top - wnd_Height) - { - newTop = wnd_Top - wnd_Height; - wnd_TrimHeight = 0; - stopTimer = true; - } - else - { - newTop -= stepHeight; - wnd_TrimHeight -= stepHeight; - wnd_TrimHeight = Math.Max(wnd_TrimWidth, 0); - } - - this.Top = newTop; - ApplyRegion( - new Rect(0, (int)(wnd_Top - this.Top), wnd_TrimWidth, (int)(wnd_Height))); - //SetWindowRgn(new WindowInteropHelper(this).Handle, CreateRectRgn(0, (int)(wnd_Top - this.Top), wnd_TrimWidth, (int)(wnd_Height)), true); - break; - } - - if (stopTimer) - { - //window is being closed - Width = 0.0; - Height = 0.0; - animTimer.Stop(); - if (!IsClosed) - Close(); - IsClosing = false; - } - }; - - IsClosing = true; - animTimer.Start(); - } - - public bool IsOpening { get; private set; } - - internal void StartOpenAnimation() - { - AnchorStyle CorrectedAnchor = Anchor; - - if (CorrectedAnchor == AnchorStyle.Left && FlowDirection == FlowDirection.RightToLeft) - CorrectedAnchor = AnchorStyle.Right; - else if (CorrectedAnchor == AnchorStyle.Right && FlowDirection == FlowDirection.RightToLeft) - CorrectedAnchor = AnchorStyle.Left; - - double wnd_Width = this._targetWidth > 0.0 ? this._targetWidth : this.ActualWidth; - double wnd_Height = this._targetHeight > 0.0 ? this._targetHeight : this.ActualHeight; - double wnd_Left = this.Left; - double wnd_Top = this.Top; - - - int wnd_TrimWidth = 0; - int wnd_TrimHeight = 0; - - int stepWidth = (int)(wnd_Width / 8); - int stepHeight = (int)(wnd_Height / 8); - - if (CorrectedAnchor == AnchorStyle.Left) - { - SetWindowRgn(new WindowInteropHelper(this).Handle, CreateRectRgn(0, 0, 0, (int)wnd_Height - wnd_TrimHeight), true); - this.Left = wnd_Left - wnd_Width; - } - else if (CorrectedAnchor == AnchorStyle.Top) - { - SetWindowRgn(new WindowInteropHelper(this).Handle, CreateRectRgn(0, 0, (int)wnd_Width - wnd_TrimWidth, 0), true); - this.Top = wnd_Top - wnd_Height; - } - - DispatcherTimer animTimer = new DispatcherTimer(); - animTimer.Interval = TimeSpan.FromMilliseconds(2); - - animTimer.Tick += (sender, eventArgs) => - { - bool stopTimer = false; - switch (CorrectedAnchor) - { - case AnchorStyle.Right: - double newLeft = this.Left; - if (this.Left - stepWidth <= wnd_Left - wnd_Width) - { - newLeft = wnd_Left - wnd_Width; - wnd_TrimWidth = (int)wnd_Width; - stopTimer = true; - } - else - { - newLeft -= stepWidth; - wnd_TrimWidth += stepWidth; - } - - //SetWindowRgn(new WindowInteropHelper(this).Handle, CreateRectRgn(0, 0, wnd_TrimWidth, (int)wnd_Height - wnd_TrimHeight), true); - Width = _targetWidth; - this.Left = newLeft; - ApplyRegion(new Rect(0, 0, wnd_TrimWidth, (int)wnd_Height - wnd_TrimHeight)); - break; - case AnchorStyle.Left: - if (this.Left + stepWidth >= wnd_Left) - { - this.Left = wnd_Left; - wnd_TrimWidth = (int)wnd_Width; - stopTimer = true; - } - else - { - this.Left += stepWidth; - wnd_TrimWidth += stepWidth; - } - - //SetWindowRgn(new WindowInteropHelper(this).Handle, CreateRectRgn((int)(wnd_Left - this.Left), 0, (int)(wnd_Width), (int)wnd_Height - wnd_TrimHeight), true); - ApplyRegion( - new Rect((int)(wnd_Left - this.Left), 0, (int)(wnd_Width), (int)wnd_Height - wnd_TrimHeight)); - Width = _targetWidth; - break; - case AnchorStyle.Bottom: - double newTop = this.Top; - if (this.Top - stepHeight <= wnd_Top - wnd_Height) - { - newTop = wnd_Top - wnd_Height; - wnd_TrimHeight = (int)wnd_Height; - stopTimer = true; - } - else - { - newTop -= stepHeight; - wnd_TrimHeight += stepHeight; - } - - //SetWindowRgn(new WindowInteropHelper(this).Handle, CreateRectRgn(0, 0, (int)wnd_Width - wnd_TrimWidth, wnd_TrimHeight), true); - ApplyRegion( - new Rect(0, 0, (int)wnd_Width - wnd_TrimWidth, wnd_TrimHeight)); - - Height = _targetHeight; - this.Top = newTop; - break; - case AnchorStyle.Top: - if (this.Top + stepHeight >= wnd_Top) - { - this.Top = wnd_Top; - wnd_TrimHeight = (int)wnd_Height; - stopTimer = true; - } - else - { - this.Top += stepHeight; - wnd_TrimHeight += stepHeight; - } - - //SetWindowRgn(new WindowInteropHelper(this).Handle, CreateRectRgn(0, (int)(wnd_Top - this.Top), (int)wnd_Width - wnd_TrimWidth, (int)(wnd_Height)), true); - ApplyRegion( - new Rect(0, (int)(wnd_Top - this.Top), (int)wnd_Width - wnd_TrimWidth, (int)(wnd_Height))); - - Height = _targetHeight; - break; - } - - if (stopTimer) - { - //SetWindowRgn(new WindowInteropHelper(this).Handle, IntPtr.Zero, false); - UpdateClipRegion(); - animTimer.Stop(); - IsOpening = false; - } - }; - - IsOpening = true; - animTimer.Start(); - - - } - - //internal void StartCloseAnimation() - //{ - // AnchorStyle CorrectedAnchor = Anchor; - - // if (CorrectedAnchor == AnchorStyle.Left && FlowDirection == FlowDirection.RightToLeft) - // CorrectedAnchor = AnchorStyle.Right; - // else if (CorrectedAnchor == AnchorStyle.Right && FlowDirection == FlowDirection.RightToLeft) - // CorrectedAnchor = AnchorStyle.Left; - - - // //Let closing animation to occur - // //Here we get a reference to a storyboard resource with a name ClosingStoryboard and - // //wait that it completes before closing the window - // FrameworkElement targetElement = GetTemplateChild("INT_pane") as FrameworkElement; - // if (targetElement != null) - // { - // Storyboard storyBoard = new Storyboard(); - - // if (CorrectedAnchor == AnchorStyle.Left || CorrectedAnchor == AnchorStyle.Right) - // { - // DoubleAnimation anim = new DoubleAnimation(this.ActualWidth, 0.0, new Duration(TimeSpan.FromMilliseconds(500))); - // Storyboard.SetTargetProperty(anim, new PropertyPath("Width")); - // //storyBoard.Children.Add(anim); - // } - // if (CorrectedAnchor == AnchorStyle.Right) - // { - // DoubleAnimation anim = new DoubleAnimation(this.Left, this.Left + this.ActualWidth, new Duration(TimeSpan.FromMilliseconds(500))); - // Storyboard.SetTargetProperty(anim, new PropertyPath("Left")); - // storyBoard.Children.Add(anim); - // } - // if (CorrectedAnchor == AnchorStyle.Top || CorrectedAnchor == AnchorStyle.Bottom) - // { - // DoubleAnimation anim = new DoubleAnimation(this.Height, 0.0, new Duration(TimeSpan.FromMilliseconds(500))); - // Storyboard.SetTargetProperty(anim, new PropertyPath("Height")); - // storyBoard.Children.Add(anim); - // } - // if (CorrectedAnchor == AnchorStyle.Bottom) - // { - // DoubleAnimation anim = new DoubleAnimation(this.Top, this.Top + this.Height, new Duration(TimeSpan.FromMilliseconds(500))); - // Storyboard.SetTargetProperty(anim, new PropertyPath("Top")); - // storyBoard.Children.Add(anim); - // } - - // { - // //DoubleAnimation anim = new DoubleAnimation(1.0, 0.0, new Duration(TimeSpan.FromMilliseconds(500))); - // //Storyboard.SetTargetProperty(anim, new PropertyPath("Opacity")); - // //AllowsTransparency slow down perfomance under XP/VISTA because rendering is enterely perfomed using CPU - // //storyBoard.Children.Add(anim); - // } - - // storyBoard.Completed += (animation, eventArgs) => - // { - // if (!IsClosed) - // Close(); - // }; - - // foreach (AnimationTimeline animTimeLine in storyBoard.Children) - // { - // animTimeLine.FillBehavior = FillBehavior.Stop; - // } - - // storyBoard.Begin(this); - // } - - //} - - - - #endregion - - - #region Clipping Region - - protected override void OnActivated(EventArgs e) - { - if (!IsOpening && !IsClosing) - UpdateClipRegion(); - - base.OnActivated(e); - } - - internal void UpdateClipRegion() - { - //ApplyRegion(_lastApplyRect.IsEmpty ? new Rect(0, 0, this.Width, this.Height) : _lastApplyRect); - ApplyRegion(new Rect(0, 0, Width, Height)); - } - - Rect _lastApplyRect = Rect.Empty; - - void ApplyRegion(Rect wndRect) - { - if (!this.CanTransform()) - return; - - wndRect = new Rect( - this.TransformFromDeviceDPI(wndRect.TopLeft), - this.TransformFromDeviceDPI(wndRect.Size)); - - _lastApplyRect = wndRect; - - if (PresentationSource.FromVisual(this) == null) - return; - - - if (_dockingManager != null) - { - List otherRects = new List(); - - foreach (Window fl in Window.GetWindow(_dockingManager).OwnedWindows) - { - //not with myself! - if (fl == this) - continue; - - if (!fl.IsVisible) - continue; - - Rect flRect = new Rect( - PointFromScreen(new Point(fl.Left, fl.Top)), - PointFromScreen(new Point(fl.Left + fl.Width, fl.Top + fl.Height))); - - if (flRect.IntersectsWith(wndRect)) - otherRects.Add(Rect.Intersect(flRect, wndRect)); - } - - IntPtr hDestRegn = CreateRectRgn( - (int)wndRect.Left, - (int)wndRect.Top, - (int)wndRect.Right, - (int)wndRect.Bottom); - - foreach (Rect otherRect in otherRects) - { - IntPtr otherWin32Rect = CreateRectRgn( - (int)otherRect.Left, - (int)otherRect.Top, - (int)otherRect.Right, - (int)otherRect.Bottom); - - CombineRgn(hDestRegn, hDestRegn, otherWin32Rect, (int)CombineRgnStyles.RGN_DIFF); - } - - - SetWindowRgn(new WindowInteropHelper(this).Handle, hDestRegn, true); - } - } - - #endregion - } -} diff --git a/src/Libraries/AvalonDock/GreyableImage/GreyableImage.cs b/src/Libraries/AvalonDock/GreyableImage/GreyableImage.cs deleted file mode 100644 index 0910cd40d5..0000000000 --- a/src/Libraries/AvalonDock/GreyableImage/GreyableImage.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; - -using System.Windows; -using System.Windows.Controls; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.ComponentModel; - - -namespace AvalonDock -{ - /// - /// Image control that get's greyed out when disabled. - /// This control is intended to be used for toolbar, menu or button icons where ability of an icon to - /// grey itself out when disabled is essential. - /// - /// 1) Greyscale image is created using FormatConvertedBitmap class. Unfortunately when converting the - /// image to greyscale this class does n0t preserve transparency information. To overcome that, there is - /// an opacity mask created from original image that is applied to greyscale image in order to preserve - /// transparency information. Because of that if an OpacityMask is applied to original image that mask - /// has to be combined with that special opacity mask of greyscale image in order to make a proper - /// greyscale image look. If you know how to combine two opacity masks please let me know. - /// 2) DrawingImage source is not supported at the moment. - /// 3) Have not tried to use any BitmapSource derived sources accept for BitmapImage so it may not be - /// able to convert some of them to greyscale. - /// 4) When specifying source Uri from XAML try to use Absolute Uri otherwise the greyscale image - /// may not be created in some scenarious. There is some code to improve the situation but I cannot - /// guarantee it will work in all possible scenarious. - /// 5) In case the greyscaled version cannot be created for whatever reason the original image with - /// 60% opacity (i.e. dull colours) will be used instead (that will work even with the DrawingImage - /// source). - /// - /// - public class GreyableImage : Image - { - // these are holding references to original and greyscale ImageSources - private ImageSource _sourceC, _sourceG; - // these are holding original and greyscale opacity masks - private Brush _opacityMaskC, _opacityMaskG; - - static GreyableImage() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(GreyableImage), new FrameworkPropertyMetadata(typeof(GreyableImage))); - } - - /// - /// Overwritten to handle changes of IsEnabled, Source and OpacityMask properties - /// - /// - protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) - { - if (e.Property.Name.Equals("IsEnabled")) - { - if ((e.NewValue as bool?) == false) - { - Source = _sourceG; - OpacityMask = _opacityMaskG; - } - else if ((e.NewValue as bool?) == true) - { - Source = _sourceC; - OpacityMask = _opacityMaskC; - } - } - else if (e.Property.Name.Equals("Source") && - !object.ReferenceEquals(Source, _sourceC) && - !object.ReferenceEquals(Source, _sourceG)) // only recache Source if it's the new one from outside - { - SetSources(); - } - else if (e.Property.Name.Equals("OpacityMask") && - !object.ReferenceEquals(OpacityMask, _opacityMaskC) && - !object.ReferenceEquals(OpacityMask, _opacityMaskG)) // only recache opacityMask if it's the new one from outside - { - _opacityMaskC = OpacityMask; - } - - base.OnPropertyChanged(e); - } - - /// - /// Cashes original ImageSource, creates and caches greyscale ImageSource and greyscale opacity mask - /// - private void SetSources() - { - // in case greyscale image cannot be created set greyscale source to original Source first - _sourceG = _sourceC = Source; - - // create Opacity Mask for greyscale image as FormatConvertedBitmap does not keep transparency info - _opacityMaskG = new ImageBrush(_sourceC); - _opacityMaskG.Opacity = 0.6; - - try - { - // get the string Uri for the original image source first - String stringUri = TypeDescriptor.GetConverter(Source).ConvertTo(Source, typeof(string)) as string; - Uri uri = null; - // try to resolve it as an absolute Uri (if it is relative and used it as is - // it is likely to point in a wrong direction) - if (!Uri.TryCreate(stringUri, UriKind.Absolute, out uri)) - { - // it seems that the Uri is relative, at this stage we can only assume that - // the image requested is in the same assembly as this oblect, - // so we modify the string Uri to make it absolute ... - stringUri = "pack://application:,,,/" + stringUri.TrimStart(new char[2] { System.IO.Path.DirectorySeparatorChar, System.IO.Path.AltDirectorySeparatorChar }); - - // ... and try to resolve again - uri = new Uri(stringUri); - } - - // create and cache greyscale ImageSource - _sourceG = new FormatConvertedBitmap(new BitmapImage(uri), PixelFormats.Gray8, null, 0); - } - catch (Exception e) - { - System.Diagnostics.Debug.Fail("The Image used cannot be greyed out.", - "Use BitmapImage or URI as a Source in order to allow greyscaling. Make sure the absolute Uri is used as relative Uri may sometimes resolve incorrectly.\n\nException: " + e.Message); - } - } - } -} diff --git a/src/Libraries/AvalonDock/HelperFunc.cs b/src/Libraries/AvalonDock/HelperFunc.cs deleted file mode 100644 index 3d8373bb48..0000000000 --- a/src/Libraries/AvalonDock/HelperFunc.cs +++ /dev/null @@ -1,206 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Media; -using System.Windows.Controls; -using System.Windows.Threading; -using System.Threading; - -namespace AvalonDock -{ - internal static class HelperFunc - { - //public static bool AreVeryClose(double v1, double v2) - //{ - // if (Math.Abs(v1 - v2) < 0.000001) - // return true; - - // return false; - //} - public static bool AreClose(double v1, double v2) - { - if (v1 == v2) - { - return true; - } - double num = ((Math.Abs(v1) + Math.Abs(v2)) + 10.0) * 2.2204460492503131E-16; - double num2 = v1 - v2; - return ((-num < num2) && (num > num2)); - } - - public static double MultiplyCheckNaN(double v1, double v2) - { - //inf * 0 = 1 - if (double.IsInfinity(v1) && - v2 == 0.0) - return 1.0; - if (double.IsInfinity(v2) && - v1 == 0.0) - return 1.0; - - return v1 * v2; - } - - - public static bool IsLessThen(double v1, double v2) - { - if (AreClose(v1, v2)) - return false; - - return v1 < v2; - } - - public static Point PointToScreenWithoutFlowDirection(FrameworkElement element, Point point) - { - if (FrameworkElement.GetFlowDirection(element) == FlowDirection.RightToLeft) - { - Point leftToRightPoint = new Point( - element.ActualWidth - point.X, - point.Y); - return element.PointToScreenDPI(leftToRightPoint); - } - - return element.PointToScreenDPI(point); - } - - public static T FindVisualAncestor(this DependencyObject obj, bool includeThis) where T : DependencyObject - { - if (!includeThis) - obj = VisualTreeHelper.GetParent(obj); - - while (obj != null && (!(obj is T))) - { - obj = VisualTreeHelper.GetParent(obj); - } - - return obj as T; - } - - public static bool IsLogicalChildContained(this DependencyObject obj) where T : DependencyObject - { - foreach (object child in LogicalTreeHelper.GetChildren(obj)) - { - if (child is T) - return true; - - if (child is DependencyObject) - { - - bool res = (child as DependencyObject).IsLogicalChildContained(); - if (res) - return true; - } - } - - return false; - } - - public static T GetLogicalChildContained(this DependencyObject obj) where T : DependencyObject - { - foreach (object child in LogicalTreeHelper.GetChildren(obj)) - { - if (child is T) - return child as T; - - if (child is DependencyObject) - { - T childFound = (child as DependencyObject).GetLogicalChildContained(); - if (childFound != null) - return childFound; - } - } - - return null; - } - - public static T FindAnotherLogicalChildContained(this DependencyObject obj, UIElement childToExclude) where T : DependencyObject - { - foreach (object child in LogicalTreeHelper.GetChildren(obj)) - { - if (child is T && child != childToExclude) - return child as T; - - if (child is DependencyObject) - { - T childFound = (child as DependencyObject).FindAnotherLogicalChildContained(childToExclude); - if (childFound != null) - return childFound; - } - } - - return null; - } - - public static DockablePane FindChildDockablePane(this DockingManager manager, AnchorStyle desideredAnchor) - { - foreach (UIElement childObject in LogicalTreeHelper.GetChildren(manager)) - { - DockablePane foundPane = FindChildDockablePane(childObject, desideredAnchor); - if (foundPane != null) - return foundPane; - } - - return null; - } - - static DockablePane FindChildDockablePane(UIElement parent, AnchorStyle desideredAnchor) - { - if (parent is DockablePane && ((DockablePane)parent).Anchor == desideredAnchor) - return parent as DockablePane; - - if (parent is ResizingPanel) - { - foreach (UIElement childObject in ((ResizingPanel)parent).Children) - { - DockablePane foundPane = FindChildDockablePane(childObject, desideredAnchor); - if (foundPane != null) - return foundPane; - } - } - - return null; - } - - - public static Point PointToScreenDPI(this Visual visual, Point pt) - { - Point resultPt = visual.PointToScreen(pt); - return TransformToDeviceDPI(visual, resultPt); - } - - public static Point TransformToDeviceDPI(this Visual visual, Point pt) - { - Matrix m = PresentationSource.FromVisual(visual).CompositionTarget.TransformToDevice; - return new Point(pt.X / m.M11, pt.Y /m.M22); - } - - public static Size TransformFromDeviceDPI(this Visual visual, Size size) - { - Matrix m = PresentationSource.FromVisual(visual).CompositionTarget.TransformToDevice; - return new Size(size.Width * m.M11, size.Height * m.M22); - } - - public static Point TransformFromDeviceDPI(this Visual visual, Point pt) - { - Matrix m = PresentationSource.FromVisual(visual).CompositionTarget.TransformToDevice; - return new Point(pt.X * m.M11, pt.Y * m.M22); - } - - public static bool CanTransform(this Visual visual) - { - return PresentationSource.FromVisual(visual) != null; - } - - - public static void CallMethod(this object o, string methodName, object[] args) - { - o.GetType().GetMethod(methodName).Invoke(o, null); - } - - public static T GetPropertyValue(this object o, string propertyName) - { - return (T)o.GetType().GetProperty(propertyName).GetValue(o, null); - } - } -} diff --git a/src/Libraries/AvalonDock/IDockableControl.cs b/src/Libraries/AvalonDock/IDockableControl.cs deleted file mode 100644 index 428fc143fb..0000000000 --- a/src/Libraries/AvalonDock/IDockableControl.cs +++ /dev/null @@ -1,36 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; - -namespace AvalonDock -{ - interface IDockableControl - { - bool IsDocked { get; } - } -} diff --git a/src/Libraries/AvalonDock/IDropSurface.cs b/src/Libraries/AvalonDock/IDropSurface.cs deleted file mode 100644 index c6ce35139e..0000000000 --- a/src/Libraries/AvalonDock/IDropSurface.cs +++ /dev/null @@ -1,72 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; - -namespace AvalonDock -{ - /// - /// Defines an interface that must be implemented by objects that can host dragged panes - /// - interface IDropSurface - { - /// - /// Gets a value indicating if this area is avilable for drop a dockable pane - /// - bool IsSurfaceVisible { get; } - - /// - /// Gets the sensible area for drop a pane - /// - Rect SurfaceRectangle { get; } - - /// - /// Called by when user dragged pane enter this surface - /// - /// Location of the mouse - void OnDragEnter(Point point); - - /// - /// Called by when user dragged pane is over this surface - /// - /// Location of the mouse - void OnDragOver(Point point); - - /// - /// Called by when user dragged pane leave this surface - /// - /// Location of the mouse - void OnDragLeave(Point point); - - /// - /// Called by when user drops a pane to this surface - /// - /// Location of the mouse - bool OnDrop(Point point); - } -} diff --git a/src/Libraries/AvalonDock/ManagedContent.cs b/src/Libraries/AvalonDock/ManagedContent.cs deleted file mode 100644 index 204ec3e3db..0000000000 --- a/src/Libraries/AvalonDock/ManagedContent.cs +++ /dev/null @@ -1,534 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.ComponentModel; -using System.Xml; -using System.Windows.Forms.Integration; -using System.Diagnostics; -using System.Windows.Threading; -using System.Threading; -using System.Reflection; - - -namespace AvalonDock -{ - - public abstract class ManagedContent : ContentControl, INotifyPropertyChanged - { - static ManagedContent() - { - //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. - //This style is defined in themes\generic.xaml - //DefaultStyleKeyProperty.OverrideMetadata(typeof(ManagedContent), new FrameworkPropertyMetadata(typeof(ManagedContent))); - FocusableProperty.OverrideMetadata(typeof(ManagedContent), new FrameworkPropertyMetadata(true)); - } - - public ManagedContent() - { - this.Loaded += new RoutedEventHandler(ManagedContent_Loaded); - this.Unloaded += new RoutedEventHandler(ManagedContent_Unloaded); - } - - void ManagedContent_Loaded(object sender, RoutedEventArgs e) - { - } - - void ManagedContent_Unloaded(object sender, RoutedEventArgs e) - { - } - - - public string Title - { - get { return (string)GetValue(TitleProperty); } - set { SetValue(TitleProperty, value); } - } - - // Using a DependencyProperty as the backing store for Title. This enables animation, styling, binding, etc... - public static readonly DependencyProperty TitleProperty = - DependencyProperty.Register("Title", typeof(string), typeof(ManagedContent)); - - //public string IconSource - //{ - // get { return (string)GetValue(IconSourceProperty); } - // set { SetValue(IconSourceProperty, value); } - //} - - //// Using a DependencyProperty as the backing store for Icon. This enables animation, styling, binding, etc... - //public static readonly DependencyProperty IconSourceProperty = - // DependencyProperty.Register("IconSource", typeof(string), typeof(ManagedContent)); - - /// - /// Access to dependency property - /// - public object Icon - { - get { return (object)GetValue(IconProperty); } - set { SetValue(IconProperty, value); } - } - - /// - /// Select an icon object for the content - /// - public static readonly DependencyProperty IconProperty = - DependencyProperty.Register("Icon", typeof(object), typeof(ManagedContent), - new FrameworkPropertyMetadata(null, new CoerceValueCallback(OnCoerce_Icon))); - - private static object OnCoerce_Icon(DependencyObject o, object value) - { - if (value is string) - { - Uri iconUri; - // try to resolve given value as an absolute URI - if (Uri.TryCreate(value as String, UriKind.RelativeOrAbsolute, out iconUri)) - { - ImageSource img = new BitmapImage(iconUri); - if (null != img) - { - GreyableImage icon = (o as ManagedContent).Icon as GreyableImage; - if (null == icon) - icon = new GreyableImage(); - - icon.Source = img; - icon.Stretch = Stretch.None; - icon.SnapsToDevicePixels = true; - - return icon; - } - } - } - return value; - } - - /// - /// Access to - /// - public IInputElement DefaultElement - { - - get { return (IInputElement)GetValue(DefaultFocusedElementProperty); } - - set { SetValue(DefaultFocusedElementProperty, value); } - - } - - /// - /// Gets or sets an element which is focused by default when content is activated - /// - public static readonly DependencyProperty DefaultFocusedElementProperty = DependencyProperty.Register("DefaultElement", typeof(IInputElement), typeof(ManagedContent)); - - - FrameworkElement _dragEnabledArea; - - protected FrameworkElement DragEnabledArea - { - get { return _dragEnabledArea; } - } - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - _dragEnabledArea = GetTemplateChild("PART_DragArea") as FrameworkElement; - - if (_dragEnabledArea != null) - { - _dragEnabledArea.MouseDown += new MouseButtonEventHandler(OnDragMouseDown); - _dragEnabledArea.MouseMove += new MouseEventHandler(OnDragMouseMove); - _dragEnabledArea.MouseUp += new MouseButtonEventHandler(OnDragMouseUp); - _dragEnabledArea.MouseLeave += new MouseEventHandler(OnDragMouseLeave); - } - } - - - #region Mouse management - - protected virtual void OnDragStart(Point ptMouse, Point ptrelativeMouse) - { - - } - - Point ptStartDrag; - bool isMouseDown = false; - - protected Point StartDragPoint - { - get { return ptStartDrag; } - } - - protected bool IsMouseDown - { - get { return isMouseDown; } - } - - protected void ResetIsMouseDownFlag() - { - isMouseDown = false; - } - - protected virtual void OnDragMouseDown(object sender, MouseButtonEventArgs e) - { - if (!e.Handled && Manager != null)// && State != DockableContentState.AutoHide) - { - isMouseDown = true; - ptStartDrag = e.GetPosition((IInputElement)System.Windows.Media.VisualTreeHelper.GetParent(this)); - } - } - - protected virtual void OnDragMouseMove(object sender, MouseEventArgs e) - { - } - - protected virtual void OnDragMouseUp(object sender, MouseButtonEventArgs e) - { - isMouseDown = false; - } - - Point ptRelativePosition; - - protected virtual void OnDragMouseLeave(object sender, MouseEventArgs e) - { - if (!e.Handled && IsMouseDown && Manager != null) - { - if (!IsMouseCaptured) - { - Point ptMouseMove = e.GetPosition(this); - ManagedContent contentToSwap = null; - if (ContainerPane != null) - { - foreach (ManagedContent content in ContainerPane.Items) - { - if (content == this) - continue; - - HitTestResult res = VisualTreeHelper.HitTest(content, e.GetPosition(content)); - if (res != null) - { - contentToSwap = content; - break; - } - } - } - - - - if (contentToSwap != null) - { - Pane containerPane = ContainerPane; - int myIndex = containerPane.Items.IndexOf(this); - - ContainerPane.Items.RemoveAt(myIndex); - - int otherIndex = containerPane.Items.IndexOf(contentToSwap); - containerPane.Items.RemoveAt(otherIndex); - - containerPane.Items.Insert(otherIndex, this); - - containerPane.Items.Insert(myIndex, contentToSwap); - - containerPane.SelectedItem = this; - - e.Handled = false; - return; - } - else if (Math.Abs(ptMouseMove.X - StartDragPoint.X) > SystemParameters.MinimumHorizontalDragDistance || - Math.Abs(ptMouseMove.Y - StartDragPoint.Y) > SystemParameters.MinimumVerticalDragDistance) - { - ptRelativePosition = e.GetPosition(DragEnabledArea); - - ResetIsMouseDownFlag(); - OnDragStart(StartDragPoint, ptRelativePosition); - e.Handled = true; - } - } - } - - isMouseDown = false; - } - - - #endregion - - protected override void OnMouseDown(MouseButtonEventArgs e) - { - base.OnMouseDown(e); - - if (!e.Handled) - { - SetAsActive(); - IInputElement focusedElement = e.Source as IInputElement; - if (focusedElement != null) Keyboard.Focus(focusedElement); - } - - } - - - protected override void OnKeyDown(KeyEventArgs e) - { - if (e.Key == Key.Enter) - { - if (ContainerPane != null) - ContainerPane.SelectedItem = this; - } - - base.OnKeyDown(e); - } - - public Pane ContainerPane - { - get - { - Pane containerPane = Parent as Pane; - if (containerPane != null) - return containerPane; - - return this.FindVisualAncestor(false); - } - } - - internal DockingManager Manager - { - get - { - if (ContainerPane != null) - return ContainerPane.GetManager(); - - return null; - } - } - - protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e) - { - base.OnGotKeyboardFocus(e); - - Debug.WriteLine(string.Format("[{0}].OnGotKeyboardFocus() Source={1} NewFocus={2} OldFocus={3}", this.Name, e.Source.GetType().ToString(), e.NewFocus.GetType().ToString(), e.OldFocus == null ? "" : e.OldFocus.GetType().ToString())); - - if (Manager != null && this.IsKeyboardFocusWithin)// && Manager.ActiveContent != this) - { - Manager.ActiveContent = this; - } - } - - protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e) - { - Debug.WriteLine(string.Format("[{0}].OnLostKeyboardFocus() Source={1} NewFocus={2} OldFocus={3}", this.Name, e.Source.GetType().ToString(), e.NewFocus == null ? "" : e.NewFocus.GetType().ToString(), e.OldFocus == null ? "" : e.OldFocus.GetType().ToString())); - base.OnLostKeyboardFocus(e); - } - - bool _isActiveContent = false; - - /// - /// Returns true if the content is the currently active content. - /// - /// Use method to set a content as active. - public bool IsActiveContent - { - get - { - return _isActiveContent; - } - internal set - { - if (_isActiveContent != value) - { - _isActiveContent = value; - NotifyPropertyChanged("IsActiveContent"); - if (IsActiveContentChanged != null) - IsActiveContentChanged(this, EventArgs.Empty); - - if (_isActiveContent && !IsKeyboardFocused) - { - Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(delegate - { - if (_isActiveContent && !IsKeyboardFocused) - { - if (this.Content is WindowsFormsHost) - { - //Use reflection in order to remove WinForms assembly reference - WindowsFormsHost contentHost = this.Content as WindowsFormsHost; - - object childCtrl = contentHost.GetType().GetProperty("Child").GetValue(contentHost, null); - - if (childCtrl != null) - { - if (!childCtrl.GetPropertyValue("Focused")) - { - childCtrl.CallMethod("Focus", null); - } - } - } - else if (DefaultElement != null) - { - Debug.WriteLine("Try to set kb focus to " + DefaultElement); - - IInputElement kbFocused = Keyboard.Focus(DefaultElement); - - if (kbFocused != null) - Debug.WriteLine("Focused element " + kbFocused); - else - Debug.WriteLine("No focused element"); - - } - else if (this.Content is IInputElement) - { - //Debug.WriteLine("Try to set kb focus to " + this.Content.ToString()); - //IInputElement kbFocused = Keyboard.Focus(this.Content as IInputElement); - //if (kbFocused != null) - // Debug.WriteLine("Focused element " + kbFocused); - //else - // Debug.WriteLine("No focused element"); - } - } - })); - } - } - - } - } - - public event EventHandler IsActiveContentChanged; - - /// - /// Set the content as the active content - /// - /// After this method returns property returns true. - public void SetAsActive() - { - if (ContainerPane != null && Manager != null)// && Manager.ActiveContent != this) - { - ContainerPane.SelectedItem = this; - FocusContent(); - if (Manager != null) - Manager.ActiveContent = this; - } - } - - protected virtual void FocusContent() - { - } - - bool _isActiveDocument = false; - - /// - /// Returns true if the document is the currently active document. - /// - /// Use method to set a content as active. - public bool IsActiveDocument - { - get - { - return _isActiveDocument; - } - internal set - { - if (_isActiveDocument != value) - { - if (value) - { - if (ContainerPane != null) - ContainerPane.SelectedItem = this; - } - - _isActiveDocument = value; - NotifyPropertyChanged("IsActiveDocument"); - } - } - } - - bool _isLocked; - - /// - /// Gets or sets a value indicating if this content is locked (readonly). - /// - public bool IsLocked - { - get { return _isLocked; } - set - { - _isLocked = value; - NotifyPropertyChanged("IsLocked"); - } - } - - Size _floatingWindowSize = Size.Empty; - - /// - /// Gets or sets the size of the floating window which hosts this content - /// - public Size FloatingWindowSize - { - get - { return _floatingWindowSize; } - set - { _floatingWindowSize = value; } - } - - - ResizeMode _floatingResizeMode = ResizeMode.CanResize; - public ResizeMode FloatingResizeMode - { - get - { return _floatingResizeMode; } - set - { _floatingResizeMode = value; } - } - - #region INotifyPropertyChanged Members - - public event PropertyChangedEventHandler PropertyChanged; - - protected void NotifyPropertyChanged(string propertyName) - { - if (PropertyChanged != null) - PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - #endregion - - - public bool IsCloseable - { - get { return (bool)GetValue(IsCloseableProperty); } - set { SetValue(IsCloseableProperty, value); } - } - - // Using a DependencyProperty as the backing store for IsCloseable. This enables animation, styling, binding, etc... - public static readonly DependencyProperty IsCloseableProperty = - DependencyProperty.Register("IsCloseable", typeof(bool), typeof(ManagedContent), new UIPropertyMetadata(true)); - - - } -} diff --git a/src/Libraries/AvalonDock/NavigatorWindow.cs b/src/Libraries/AvalonDock/NavigatorWindow.cs deleted file mode 100644 index b5c911ec01..0000000000 --- a/src/Libraries/AvalonDock/NavigatorWindow.cs +++ /dev/null @@ -1,358 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using System.ComponentModel; - -namespace AvalonDock -{ - - public class NavigatorWindowItem - { - private string _title; - - public string Title - { - get - { - return _title; - } - } - - private object _icon; - - public object Icon - { - get - { - return _icon; - } - } - - protected ManagedContent _content; - - public ManagedContent ItemContent - { - get { return _content; } - } - - internal NavigatorWindowItem(ManagedContent content) - { - _title = content.Title; - _icon = content.Icon; - _content = content; - } - } - - public class NavigatorWindowDocumentItem : NavigatorWindowItem - { - private string _infoTip; - - public string InfoTip - { - get - { - return _infoTip; - } - } - - private string _contentTypeDescription; - - public string ContentTypeDescription - { - get - { - return _contentTypeDescription; - } - } - - private DateTime _lastActivation; - - public DateTime LastActivation - { - get { return _lastActivation; } - } - - - internal NavigatorWindowDocumentItem(DocumentContent document) - : base(document) - { - _infoTip = document.InfoTip; - if (_infoTip == null && document.ToolTip != null && document.ToolTip is string) - _infoTip = document.ToolTip.ToString(); - - _contentTypeDescription = document.ContentTypeDescription; - _lastActivation = document.LastActivation; - } - - - } - - public class NavigatorWindow : Window, INotifyPropertyChanged - { - static NavigatorWindow() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(NavigatorWindow), new FrameworkPropertyMetadata(typeof(NavigatorWindow))); - - - Window.AllowsTransparencyProperty.OverrideMetadata(typeof(NavigatorWindow), new FrameworkPropertyMetadata(true)); - Window.WindowStyleProperty.OverrideMetadata(typeof(NavigatorWindow), new FrameworkPropertyMetadata(WindowStyle.None)); - Window.ShowInTaskbarProperty.OverrideMetadata(typeof(NavigatorWindow), new FrameworkPropertyMetadata(false)); - Control.BackgroundProperty.OverrideMetadata(typeof(NavigatorWindow), new FrameworkPropertyMetadata(Brushes.Transparent)); - } - - public NavigatorWindow() - { - } - - void OnKeyUp(object sender, KeyEventArgs e) - { - if (e.Key != Key.Tab) - CloseThisWindow();//Hide(); - else - { - e.Handled = true; - MoveNextSelectedContent(); - } - } - - void OnKeyDown(object sender, KeyEventArgs e) - { - if (e.Key != Key.Tab) - CloseThisWindow();//Hide(); - else - { - e.Handled = true; - } - } - - DockingManager _manager; - public NavigatorWindow(DockingManager manager) - { - _manager = manager; - Keyboard.AddKeyUpHandler(this, new KeyEventHandler(this.OnKeyUp)); - Keyboard.AddKeyDownHandler(this, new KeyEventHandler(this.OnKeyDown)); - } - - - protected override void OnActivated(EventArgs e) - { - base.OnActivated(e); - - List listOfDocuments = _manager.FindContents(); - List docs = new List(); - listOfDocuments.ForEach((DocumentContent doc) => - { - docs.Add(new NavigatorWindowDocumentItem(doc)); - }); - - docs.Sort((NavigatorWindowDocumentItem item1, NavigatorWindowDocumentItem item2) => - { - if (item1 == item2 || - item1.LastActivation == item2.LastActivation) - return 0; - return (item1.LastActivation < item2.LastActivation) ? 1 : -1; - }); - - Documents = docs; - - List listOfContents = _manager.FindContents(); - List cnts = new List(); - listOfContents.ForEach((DockableContent cnt) => - { - cnts.Add(new NavigatorWindowItem(cnt)); - }); - - DockableContents = cnts; - - - SelectedContent = Documents.Find((NavigatorWindowDocumentItem docItem) => - { - return docItem.ItemContent == _manager.ActiveDocument; - }); - - SelectedToolWindow = null; - } - - protected override void OnDeactivated(EventArgs e) - { - if (_manager != null) - { - Window mainWindow = Window.GetWindow(_manager); - if (mainWindow != null) - { - mainWindow.Activate(); - if (SelectedContent != null) - { - _manager.Show(SelectedContent.ItemContent as DocumentContent); - SelectedContent.ItemContent.SetAsActive(); - } - else if (SelectedToolWindow != null) - { - _manager.Show(SelectedToolWindow.ItemContent as DockableContent); - SelectedToolWindow.ItemContent.SetAsActive(); - } - } - } - - if (!_isClosing) - CloseThisWindow();//Hide(); - - base.OnDeactivated(e); - } - - void CloseThisWindow() - { - Window wndParent = this.Owner; - Close(); - wndParent.Activate(); - } - - List _documents = new List(); - - public List Documents - { - get { return _documents; } - private - set - { - _documents = value; - NotifyPropertyChanged("Documents"); - } - } - - List _tools = new List(); - - public List DockableContents - { - get { return _tools; } - private set - { - _tools = value; - NotifyPropertyChanged("DockableContents"); - } - } - - NavigatorWindowDocumentItem _selectedContent; - - public NavigatorWindowDocumentItem SelectedContent - { - get - { - return _selectedContent; - } - set - { - if (_selectedContent != value) - { - _selectedContent = value; - NotifyPropertyChanged("SelectedContent"); - } - } - } - - NavigatorWindowItem _toolContent; - - public NavigatorWindowItem SelectedToolWindow - { - get - { - return _toolContent; - } - set - { - if (_toolContent != value) - { - _toolContent = value; - - NotifyPropertyChanged("SelectedToolWindow"); - - SelectedContent = null; - Close();// Hide(); - } - } - } - - public void MoveNextSelectedContent() - { - if (_selectedContent == null) - return; - - if (Documents.Contains(SelectedContent)) - { - int indexOfSelecteContent = Documents.IndexOf(_selectedContent); - - if (indexOfSelecteContent == Documents.Count - 1) - { - indexOfSelecteContent = 0; - } - else - indexOfSelecteContent++; - - SelectedContent = Documents[indexOfSelecteContent]; - } - } - - bool _isClosing = false; - protected override void OnClosing(CancelEventArgs e) - { - _isClosing = true; - - base.OnClosing(e); - } - - protected override void OnClosed(EventArgs e) - { - //reset documents list to avoid WPF Bug: - //http://social.msdn.microsoft.com/forums/en/wpf/thread/f3fc5b7e-e035-4821-908c-b6c07e5c7042/ - //http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=321955 - Documents = new List(); - - base.OnClosed(e); - } - - #region INotifyPropertyChanged Members - - public event PropertyChangedEventHandler PropertyChanged; - - void NotifyPropertyChanged(string propertyName) - { - if (PropertyChanged != null) - PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - #endregion - } -} diff --git a/src/Libraries/AvalonDock/OverlayWindow.cs b/src/Libraries/AvalonDock/OverlayWindow.cs deleted file mode 100644 index 00af4da30f..0000000000 --- a/src/Libraries/AvalonDock/OverlayWindow.cs +++ /dev/null @@ -1,383 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.ComponentModel; -using System.Windows.Markup; -using System.Diagnostics; -using System.Windows.Threading; -using System.Windows.Media.Animation; - -namespace AvalonDock -{ - public enum OverlayButtonHover - { - None, - DropPaneInto, - DropPaneLeft, - DropPaneRight, - DropPaneTop, - DropPaneBottom, - DropBorderLeft, - DropBorderRight, - DropBorderTop, - DropBorderBottom, - } - - public class OverlayWindow : Window, INotifyPropertyChanged - { - static OverlayWindow() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(OverlayWindow), new FrameworkPropertyMetadata(typeof(OverlayWindow))); - - Window.AllowsTransparencyProperty.OverrideMetadata(typeof(OverlayWindow), new FrameworkPropertyMetadata(true)); - Window.WindowStyleProperty.OverrideMetadata(typeof(OverlayWindow), new FrameworkPropertyMetadata(WindowStyle.None)); - Window.ShowInTaskbarProperty.OverrideMetadata(typeof(OverlayWindow), new FrameworkPropertyMetadata(false)); - } - - public OverlayWindow() - { } - - DockingManager _manager = null; - - public OverlayWindow(DockingManager manager) - { - _manager = manager; - } - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - gridPaneRelativeDockingOptions = GetTemplateChild("PART_gridPaneRelativeDockingOptions") as FrameworkElement; - selectionBox = GetTemplateChild("PART_SelectionBox") as FrameworkElement; - - owdBottom = new OverlayWindowDockingButton(GetTemplateChild("PART_btnDockBottom") as FrameworkElement, this); - owdTop = new OverlayWindowDockingButton(GetTemplateChild("PART_btnDockTop") as FrameworkElement, this); - owdLeft = new OverlayWindowDockingButton(GetTemplateChild("PART_btnDockLeft") as FrameworkElement, this); - owdRight = new OverlayWindowDockingButton(GetTemplateChild("PART_btnDockRight") as FrameworkElement, this); - - owdPaneBottom = new OverlayWindowDockingButton(GetTemplateChild("PART_btnDockPaneBottom") as FrameworkElement, this); - owdPaneTop = new OverlayWindowDockingButton(GetTemplateChild("PART_btnDockPaneTop") as FrameworkElement, this); - owdPaneLeft = new OverlayWindowDockingButton(GetTemplateChild("PART_btnDockPaneLeft") as FrameworkElement, this); - owdPaneRight = new OverlayWindowDockingButton(GetTemplateChild("PART_btnDockPaneRight") as FrameworkElement, this); - owdPaneInto = new OverlayWindowDockingButton(GetTemplateChild("PART_btnDockPaneInto") as FrameworkElement, this); - - _manager.DragPaneServices.Register(owdBottom); - _manager.DragPaneServices.Register(owdTop); - _manager.DragPaneServices.Register(owdLeft); - _manager.DragPaneServices.Register(owdRight); - _manager.DragPaneServices.Register(owdPaneBottom); - _manager.DragPaneServices.Register(owdPaneTop); - _manager.DragPaneServices.Register(owdPaneLeft); - _manager.DragPaneServices.Register(owdPaneRight); - _manager.DragPaneServices.Register(owdPaneInto); - } - - FrameworkElement gridPaneRelativeDockingOptions; - FrameworkElement selectionBox; - - OverlayWindowDockingButton owdBottom; - OverlayWindowDockingButton owdTop; - OverlayWindowDockingButton owdLeft; - OverlayWindowDockingButton owdRight; - OverlayWindowDockingButton owdPaneBottom; - OverlayWindowDockingButton owdPaneTop; - OverlayWindowDockingButton owdPaneLeft; - OverlayWindowDockingButton owdPaneRight; - OverlayWindowDockingButton owdPaneInto; - - - internal bool OnDrop(OverlayWindowDockingButton owdDock, Point point) - { - //user has dropped the floating window over a anchor button - //create a new dockable pane to insert in the main layout - Pane paneToAnchor = _manager.DragPaneServices.FloatingWindow.ClonePane(); - - //floating window is going to be closed.. - - if (owdDock == owdBottom) - _manager.Anchor(paneToAnchor, AnchorStyle.Bottom); - else if (owdDock == owdLeft) - _manager.Anchor(paneToAnchor, AnchorStyle.Left); - else if (owdDock == owdRight) - _manager.Anchor(paneToAnchor, AnchorStyle.Right); - else if (owdDock == owdTop) - _manager.Anchor(paneToAnchor, AnchorStyle.Top); - else if (owdDock == owdPaneTop) - _manager.Anchor(paneToAnchor, CurrentDropPane, AnchorStyle.Top); - else if (owdDock == owdPaneBottom) - _manager.Anchor(paneToAnchor, CurrentDropPane, AnchorStyle.Bottom); - else if (owdDock == owdPaneLeft) - _manager.Anchor(paneToAnchor, CurrentDropPane, AnchorStyle.Left); - else if (owdDock == owdPaneRight) - _manager.Anchor(paneToAnchor, CurrentDropPane, AnchorStyle.Right); - else if (owdDock == owdPaneInto) - _manager.DropInto(paneToAnchor, CurrentDropPane); - - selectionBox.Visibility = Visibility.Hidden; - - return true; - } - - Pane CurrentDropPane = null; - - public void ShowOverlayPaneDockingOptions(Pane pane) - { - - HideOverlayPaneDockingOptions(pane); - - //check if dockable on a document pane - DockableStyle currentPaneDockableStyle = - _manager.DragPaneServices.FloatingWindow.HostedPane.GetCumulativeDockableStyle(); - - //if current drop pane is a DocumentPane ... - if (pane is DocumentPane && - (currentPaneDockableStyle & DockableStyle.Document) == 0) - return; - if (pane is DockablePane && - (currentPaneDockableStyle & DockableStyle.Dockable) == 0) - return; - - - Rect rectPane = pane.SurfaceRectangle; - - Point myScreenTopLeft = this.PointToScreenDPI(new Point(0, 0)); - rectPane.Offset(-myScreenTopLeft.X, -myScreenTopLeft.Y);//relative to me - gridPaneRelativeDockingOptions.SetValue(Canvas.LeftProperty, rectPane.Left + rectPane.Width / 2 - gridPaneRelativeDockingOptions.Width / 2); - gridPaneRelativeDockingOptions.SetValue(Canvas.TopProperty, rectPane.Top + rectPane.Height / 2 - gridPaneRelativeDockingOptions.Height / 2); - - if (pane is DocumentPane) - gridPaneRelativeDockingOptions.Visibility = Visibility.Visible; - else - { - gridPaneRelativeDockingOptions.Visibility = !(_manager.DragPaneServices.FloatingWindow is DocumentFloatingWindow) ? Visibility.Visible : Visibility.Hidden; - } - - - owdBottom.Enabled = ((currentPaneDockableStyle & DockableStyle.BottomBorder) > 0); - owdTop.Enabled = ((currentPaneDockableStyle & DockableStyle.TopBorder) > 0); - owdLeft.Enabled = ((currentPaneDockableStyle & DockableStyle.LeftBorder) > 0); - owdRight.Enabled = ((currentPaneDockableStyle & DockableStyle.RightBorder) > 0); - - - if (pane is DocumentPane) - owdPaneInto.Enabled = true; - else - owdPaneInto.Enabled = !(_manager.DragPaneServices.FloatingWindow is DocumentFloatingWindow); - - int destPaneChildCount = pane.Items.Count; - - owdPaneBottom.Enabled = owdPaneInto.Enabled && destPaneChildCount > 0; - owdPaneTop.Enabled = owdPaneInto.Enabled && destPaneChildCount > 0; - owdPaneLeft.Enabled = owdPaneInto.Enabled && destPaneChildCount > 0; - owdPaneRight.Enabled = owdPaneInto.Enabled && destPaneChildCount > 0; - - CurrentDropPane = pane; - } - - public void HideOverlayPaneDockingOptions(Pane surfaceElement) - { - - owdPaneBottom.Enabled = false; - owdPaneTop.Enabled = false; - owdPaneLeft.Enabled = false; - owdPaneRight.Enabled = false; - owdPaneInto.Enabled = false; - - gridPaneRelativeDockingOptions.Visibility = Visibility.Collapsed; - CurrentDropPane = null; - OverlayButtonHover = OverlayButtonHover.None; - } - - protected override void OnDeactivated(EventArgs e) - { - selectionBox.Visibility = Visibility.Hidden; - - base.OnDeactivated(e); - } - - protected override void OnActivated(EventArgs e) - { - base.OnActivated(e); - - - DockableStyle currentPaneDockableStyle = - _manager.DragPaneServices.FloatingWindow.HostedPane.GetCumulativeDockableStyle(); - - selectionBox.Visibility = Visibility.Hidden; - - owdBottom.Enabled = (currentPaneDockableStyle & DockableStyle.BottomBorder) > 0; - owdTop.Enabled = (currentPaneDockableStyle & DockableStyle.TopBorder) > 0; - owdLeft.Enabled = (currentPaneDockableStyle & DockableStyle.LeftBorder) > 0; - owdRight.Enabled = (currentPaneDockableStyle & DockableStyle.RightBorder) > 0; - } - - /// - /// Shows a highlighting rectangle - /// - /// - /// - /// - internal void OnDragEnter(OverlayWindowDockingButton owdDock, Point point) - { - OnDragOver(owdDock, point); - } - - /// - /// Hides the highlighting rectangle - /// - /// - /// - /// - internal void OnDragLeave(OverlayWindowDockingButton owdDock, Point point) - { - selectionBox.Visibility = Visibility.Hidden; - _manager.DragPaneServices.FloatingWindow.OnHideSelectionBox(); - OverlayButtonHover = OverlayButtonHover.None; - } - - internal void OnDragOver(OverlayWindowDockingButton owdDock, Point point) - { - if (selectionBox == null) - return; - - Rect rectPane; - - if (owdDock == owdBottom || - owdDock == owdLeft || - owdDock == owdTop || - owdDock == owdRight) - rectPane = _manager.SurfaceRectangle; - else - rectPane = CurrentDropPane.SurfaceRectangle; - - double selectionBoxWidth = Math.Min( - rectPane.Width / 2.0, - ResizingPanel.GetEffectiveSize(_manager.DragPaneServices.FloatingWindow.HostedPane).Width); - double selectionBoxHeight = Math.Min( - rectPane.Height / 2.0, - ResizingPanel.GetEffectiveSize(_manager.DragPaneServices.FloatingWindow.HostedPane).Height); - - - Point myScreenTopLeft = this.PointToScreenDPI(new Point()); - rectPane.Offset(-myScreenTopLeft.X, -myScreenTopLeft.Y);//relative to me - - if (owdDock == owdBottom || owdDock == owdPaneBottom) - { - selectionBox.SetValue(Canvas.LeftProperty, rectPane.Left); - selectionBox.SetValue(Canvas.TopProperty, rectPane.Top + rectPane.Height - selectionBoxHeight); - selectionBox.Width = rectPane.Width; - selectionBox.Height = selectionBoxHeight; - } - if (owdDock == owdLeft || owdDock == owdPaneLeft) - { - selectionBox.SetValue(Canvas.LeftProperty, rectPane.Left); - selectionBox.SetValue(Canvas.TopProperty, rectPane.Top); - selectionBox.Width = selectionBoxWidth; - selectionBox.Height = rectPane.Height; - } - if (owdDock == owdRight || owdDock == owdPaneRight) - { - selectionBox.SetValue(Canvas.LeftProperty, rectPane.Left + rectPane.Width - selectionBoxWidth); - selectionBox.SetValue(Canvas.TopProperty, rectPane.Top); - selectionBox.Width = selectionBoxWidth; - selectionBox.Height = rectPane.Height; - } - if (owdDock == owdTop || owdDock == owdPaneTop) - { - selectionBox.SetValue(Canvas.LeftProperty, rectPane.Left); - selectionBox.SetValue(Canvas.TopProperty, rectPane.Top); - selectionBox.Width = rectPane.Width; - selectionBox.Height = selectionBoxHeight; - } - if (owdDock == owdPaneInto) - { - selectionBox.SetValue(Canvas.LeftProperty, rectPane.Left); - selectionBox.SetValue(Canvas.TopProperty, rectPane.Top); - selectionBox.Width = rectPane.Width; - selectionBox.Height = rectPane.Height; - } - - if (owdDock == owdLeft) - OverlayButtonHover = OverlayButtonHover.DropBorderLeft; - else if (owdDock == owdRight) - OverlayButtonHover = OverlayButtonHover.DropBorderRight; - else if (owdDock == owdTop) - OverlayButtonHover = OverlayButtonHover.DropBorderTop; - else if (owdDock == owdBottom) - OverlayButtonHover = OverlayButtonHover.DropBorderBottom; - else if (owdDock == owdPaneInto) - OverlayButtonHover = OverlayButtonHover.DropPaneInto; - else if (owdDock == owdPaneRight) - OverlayButtonHover = OverlayButtonHover.DropPaneRight; - else if (owdDock == owdPaneTop) - OverlayButtonHover = OverlayButtonHover.DropPaneTop; - else if (owdDock == owdPaneLeft) - OverlayButtonHover = OverlayButtonHover.DropPaneLeft; - else if (owdDock == owdPaneBottom) - OverlayButtonHover = OverlayButtonHover.DropPaneBottom; - else - OverlayButtonHover = OverlayButtonHover.None; - - - selectionBox.Visibility = Visibility.Visible; - - _manager.DragPaneServices.FloatingWindow.OnShowSelectionBox(); - - } - - OverlayButtonHover _overlayButtonHover = OverlayButtonHover.None; - - public OverlayButtonHover OverlayButtonHover - { - get - { return _overlayButtonHover; } - set - { - _overlayButtonHover = value; - if (PropertyChanged != null) - PropertyChanged(this, new PropertyChangedEventArgs("OverlayButtonHover")); - } - } - - #region INotifyPropertyChanged Members - - public event PropertyChangedEventHandler PropertyChanged; - - #endregion - } -} diff --git a/src/Libraries/AvalonDock/OverlayWindowAnchorButton.cs b/src/Libraries/AvalonDock/OverlayWindowAnchorButton.cs deleted file mode 100644 index ee07a4aa09..0000000000 --- a/src/Libraries/AvalonDock/OverlayWindowAnchorButton.cs +++ /dev/null @@ -1,125 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; - -namespace AvalonDock -{ - class OverlayWindowDockingButton : IDropSurface - { - OverlayWindow _owner; - FrameworkElement _btnDock; - - public OverlayWindowDockingButton(FrameworkElement btnDock, OverlayWindow owner) - : this(btnDock, owner, true) - { - - } - public OverlayWindowDockingButton(FrameworkElement btnDock, OverlayWindow owner, bool enabled) - { - _btnDock = btnDock; - _owner = owner; - Enabled = enabled; - } - - bool _enabled = true; - - public bool Enabled - { - get { return _enabled; } - set - { - _enabled = value; - - if (_enabled) - _btnDock.Visibility = Visibility.Visible; - else - _btnDock.Visibility = Visibility.Hidden; - } - } - - - - #region IDropSurface Membri di - - - - public Rect SurfaceRectangle - { - get - { - if (!IsSurfaceVisible) - return Rect.Empty; - - if (PresentationSource.FromVisual(_btnDock) == null) - return Rect.Empty; - - return new Rect(HelperFunc.PointToScreenWithoutFlowDirection(_btnDock, new Point()), new Size(_btnDock.ActualWidth, _btnDock.ActualHeight)); - } - } - - public void OnDragEnter(Point point) - { - if (!Enabled) - return; - - _owner.OnDragEnter(this, point); - } - - public void OnDragOver(Point point) - { - if (!Enabled) - return; - - _owner.OnDragOver(this, point); - } - - public void OnDragLeave(Point point) - { - if (!Enabled) - return; - - _owner.OnDragLeave(this, point); - } - - public bool OnDrop(Point point) - { - if (!Enabled) - return false; - - return _owner.OnDrop(this, point); - } - - public bool IsSurfaceVisible - { - get { return (_owner.IsLoaded && _btnDock != null); } - } - - #endregion - } -} diff --git a/src/Libraries/AvalonDock/Pane.cs b/src/Libraries/AvalonDock/Pane.cs deleted file mode 100644 index e2fce0e78e..0000000000 --- a/src/Libraries/AvalonDock/Pane.cs +++ /dev/null @@ -1,300 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.Diagnostics; -using System.Collections.Specialized; -using System.ComponentModel; - -namespace AvalonDock -{ - public abstract class Pane : - System.Windows.Controls.Primitives.Selector, - IDropSurface, - IDockableControl, - INotifyPropertyChanged - { - - public Pane() - { - this.Loaded += new RoutedEventHandler(Pane_Loaded); - this.Unloaded += new RoutedEventHandler(Pane_Unloaded); - } - - void Pane_Loaded(object sender, RoutedEventArgs e) - { - //if (GetManager() == null && Parent != null) - // throw new InvalidOperationException("Pane must be put under a DockingManager!"); - - AddDragPaneReferences(); - } - - void Pane_Unloaded(object sender, RoutedEventArgs e) - { - RemoveDragPaneReferences(); - } - - - - #region Contents management - public bool HasSingleItem - { - get - { - return (bool)GetValue(HasSingleItemProperty); - } - protected set { SetValue(HasSingleItemPropertyKey, value); } - } - - // Using a DependencyProperty as the backing store for HasSingleItem. This enables animation, styling, binding, etc... - private static readonly DependencyPropertyKey HasSingleItemPropertyKey = - DependencyProperty.RegisterReadOnly("HasSingleItem", typeof(bool), typeof(Pane), new PropertyMetadata(false)); - - public static readonly DependencyProperty HasSingleItemProperty = HasSingleItemPropertyKey.DependencyProperty; - - - protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) - { - HasSingleItem = (Items.Count == 1); - - if (Items.Count > 0) - { - int currentIndex = SelectedIndex; - SelectedIndex = -1; - - if (currentIndex < 0 || - currentIndex >= Items.Count) - currentIndex = Items.Count - 1; - - SelectedIndex = currentIndex; - } - //else - // RemoveDragPaneReferences(); - - base.OnItemsChanged(e); - } - - //void RefreshContentsSelectedProperty() - //{ - // //foreach (ManagedContent mc in Items) - // //{ - // // //mc.IsSelected = (mc == SelectedItem); - // // //Selector.SetIsSelected(mc - - // // if (Selector.GetIsSelected(mc)) - // // mc.FocusContent(); - // //} - //} - - //protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) - //{ - // if (e.Property == SelectedItemProperty) - // RefreshContentsSelectedProperty(); - // // SetValue(ActiveContentProperty, SelectedItem); - - // //if (e.Property == ActiveContentProperty) - // //{ - // // //SetValue(SelectedItemProperty, ActiveContent); - - // //} - - // base.OnPropertyChanged(e); - //} - #endregion - - #region IDockableControl Members - - public virtual bool IsDocked - { - get { return true; } - } - - #endregion - - public virtual DockingManager GetManager() - { - DependencyObject parent = LogicalTreeHelper.GetParent(this); - - while (parent != null && - (!(parent is DockingManager))) - parent = LogicalTreeHelper.GetParent(parent); - - return parent as DockingManager; - } - - - - - #region IDockableControl Members - - #endregion - - #region Membri di IDropSurface - #region Drag pane services - - DockingManager _oldManager = null; - //protected override void OnVisualParentChanged(DependencyObject oldParent) - //{ - // base.OnVisualParentChanged(oldParent); - - // RemoveDragPaneReferences(); - - // AddDragPaneReferences(); - //} - - protected void RemoveDragPaneReferences() - { - if (_oldManager != null) - { - _oldManager.DragPaneServices.Unregister(this); - _oldManager = null; - } - - } - - protected void AddDragPaneReferences() - { - { - _oldManager = GetManager(); - if (_oldManager != null) - _oldManager.DragPaneServices.Register(this); - } - } - #endregion - - - public abstract bool IsSurfaceVisible {get;} - - public virtual Rect SurfaceRectangle - { - get - { - if (!IsSurfaceVisible) - return new Rect(); - - if (PresentationSource.FromVisual(this) == null) - return new Rect(); - - return new Rect(HelperFunc.PointToScreenWithoutFlowDirection(this, new Point()), new Size(ActualWidth, ActualHeight)); - } - } - - public virtual void OnDragEnter(Point point) - { - GetManager().OverlayWindow.ShowOverlayPaneDockingOptions(this); - } - - public virtual void OnDragOver(Point point) - { - - } - - public virtual void OnDragLeave(Point point) - { - GetManager().OverlayWindow.HideOverlayPaneDockingOptions(this); - } - - public virtual bool OnDrop(Point point) - { - return false; - } - - #endregion - - - public virtual ManagedContent RemoveContent(int index) - { - ManagedContent contentToRemove = Items[index] as ManagedContent; - - Items.RemoveAt(index); - - return contentToRemove; - } - - protected FrameworkElement _partHeader = null; - - public override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - //gets a reference to the header for the pane - _partHeader = GetTemplateChild("PART_Header") as FrameworkElement; - } - - - internal virtual ResizingPanel GetContainerPanel() - { - return LogicalTreeHelper.GetParent(this) as ResizingPanel; - } - - /// - /// Closes or hides provided content depending on HideOnClose property - /// - internal virtual void CloseOrHide(DockableContent cntToCloseOrHide) - { - CloseOrHide(cntToCloseOrHide, false); - } - - /// - /// Closes or hides provided content depending on HideOnClose property - /// - internal virtual void CloseOrHide(DockableContent cntToCloseOrHide, bool force) - { - Debug.Assert(cntToCloseOrHide != null); - - if (!force && !cntToCloseOrHide.IsCloseable) - return; - - DockingManager manager = GetManager(); - if (cntToCloseOrHide.HideOnClose && manager != null) - manager.Hide(cntToCloseOrHide); - else - RemoveContent(Items.IndexOf(cntToCloseOrHide)); - } - - - #region INotifyPropertyChanged Members - - public event PropertyChangedEventHandler PropertyChanged; - - protected void NotifyPropertyChanged(string propertyName) - { - if (PropertyChanged != null) - PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - #endregion - } -} diff --git a/src/Libraries/AvalonDock/PaneTabPanel.cs b/src/Libraries/AvalonDock/PaneTabPanel.cs deleted file mode 100644 index 75c10b190a..0000000000 --- a/src/Libraries/AvalonDock/PaneTabPanel.cs +++ /dev/null @@ -1,77 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; - - -namespace AvalonDock -{ - public abstract class PaneTabPanel : System.Windows.Controls.Panel - { - //static PaneTabPanel() - //{ - // //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. - // //This style is defined in themes\generic.xaml - // DefaultStyleKeyProperty.OverrideMetadata(typeof(PaneTabPanel), new FrameworkPropertyMetadata(typeof(PaneTabPanel))); - //} - - protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved) - { - base.OnVisualChildrenChanged(visualAdded, visualRemoved); - - ManagedContent mc = visualAdded as ManagedContent; - if (mc != null) - { - mc.Style = null; - mc.Style = TabItemStyle; - } - - } - - - - - public Style TabItemStyle - { - get { return (Style)GetValue(TabItemStyleProperty); } - set { SetValue(TabItemStyleProperty, value); } - } - - // Using a DependencyProperty as the backing store for TabStyle. This enables animation, styling, binding, etc... - public static readonly DependencyProperty TabItemStyleProperty = - DependencyProperty.Register("TabItemStyle", typeof(Style), typeof(PaneTabPanel)); - } -} diff --git a/src/Libraries/AvalonDock/Properties/AssemblyInfo.cs b/src/Libraries/AvalonDock/Properties/AssemblyInfo.cs deleted file mode 100644 index 6b9b29848c..0000000000 --- a/src/Libraries/AvalonDock/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,62 +0,0 @@ -#region Using directives - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Resources; -using System.Globalization; -using System.Windows; -using System.Runtime.InteropServices; - -#endregion - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("AvalonDock")] -[assembly: AssemblyDescription("WPF docking library")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AvalonDock")] -[assembly: AssemblyCopyright("Copyright @ Adolfo Marinucci 2007-2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] - -//In order to begin building localizable applications, set -//CultureYouAreCodingWith in your .csproj file -//inside a . For example, if you are using US english -//in your source files, set the to en-US. Then uncomment -//the NeutralResourceLanguage attribute below. Update the "en-US" in -//the line below to match the UICulture setting in the project file. - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -// Specifies the location in which theme dictionaries are stored for types in an assembly. -[assembly: ThemeInfo( - // Specifies the location of system theme-specific resource dictionaries for this project. - // The default setting in this project is "None" since this default project does not - // include these user-defined theme files: - // Themes\Aero.NormalColor.xaml - // Themes\Classic.xaml - // Themes\Luna.Homestead.xaml - // Themes\Luna.Metallic.xaml - // Themes\Luna.NormalColor.xaml - // Themes\Royale.NormalColor.xaml - ResourceDictionaryLocation.SourceAssembly, - - // Specifies the location of the system non-theme specific resource dictionary: - // Themes\generic.xaml - ResourceDictionaryLocation.SourceAssembly)] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.2.2702")] diff --git a/src/Libraries/AvalonDock/Properties/Resources.Designer.cs b/src/Libraries/AvalonDock/Properties/Resources.Designer.cs deleted file mode 100644 index 6204034140..0000000000 --- a/src/Libraries/AvalonDock/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.1433 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace AvalonDock.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AvalonDock.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/src/Libraries/AvalonDock/Properties/Resources.resx b/src/Libraries/AvalonDock/Properties/Resources.resx deleted file mode 100644 index 3e18af958a..0000000000 --- a/src/Libraries/AvalonDock/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/Properties/Settings.Designer.cs b/src/Libraries/AvalonDock/Properties/Settings.Designer.cs deleted file mode 100644 index f67dbf13f4..0000000000 --- a/src/Libraries/AvalonDock/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.1433 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace AvalonDock.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/src/Libraries/AvalonDock/Properties/Settings.settings b/src/Libraries/AvalonDock/Properties/Settings.settings deleted file mode 100644 index 4024694778..0000000000 --- a/src/Libraries/AvalonDock/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/RequestDocumentCloseEventArgs.cs b/src/Libraries/AvalonDock/RequestDocumentCloseEventArgs.cs deleted file mode 100644 index 447c19db0e..0000000000 --- a/src/Libraries/AvalonDock/RequestDocumentCloseEventArgs.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.ComponentModel; - -namespace AvalonDock -{ - public class RequestDocumentCloseEventArgs : CancelEventArgs - { - public RequestDocumentCloseEventArgs(DocumentContent doc) - { - DocumentToClose = doc; - } - - /// - /// Document content that user wants to close - /// - public DocumentContent DocumentToClose { get; private set; } - } -} diff --git a/src/Libraries/AvalonDock/ResizingPanel.cs b/src/Libraries/AvalonDock/ResizingPanel.cs deleted file mode 100644 index 06c8e9caa6..0000000000 --- a/src/Libraries/AvalonDock/ResizingPanel.cs +++ /dev/null @@ -1,1307 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; -using System.Windows.Markup; -using System.Diagnostics; -using System.Linq; - - -namespace AvalonDock -{ - public class ResizingPanel : Panel, IDockableControl - { - /// - /// Gets or sets the orientation of the panel - /// - /// If horizontal oriented children are positioned from left to right and width of each child is computed according to attached property value. When vertical oriented children are arranged from top to bottom, according to of each child. - public Orientation Orientation - { - get { return (Orientation)GetValue(OrientationProperty); } - set { SetValue(OrientationProperty, value); } - } - - /// - /// Give access to Orientation attached property - /// - /// If horizontal oriented children are positioned from left to right and width of each child is computed according to attached property value. When vertical oriented children are arranged from top to bottom, according to of each child. - public static readonly DependencyProperty OrientationProperty = - DependencyProperty.Register("Orientation", typeof(Orientation), typeof(ResizingPanel), new FrameworkPropertyMetadata(Orientation.Horizontal, FrameworkPropertyMetadataOptions.AffectsMeasure, OnOrientationChanged)); - - static void OnOrientationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ((ResizingPanel)d).splitterListIsDirty = true; - } - - public static GridLength GetResizeWidth(DependencyObject obj) - { - return (GridLength)obj.GetValue(ResizeWidthProperty); - } - - public static void SetResizeWidth(DependencyObject obj, GridLength value) - { - obj.SetValue(ResizeWidthProperty, value); - } - - - public static readonly DependencyProperty ResizeWidthProperty = - DependencyProperty.RegisterAttached("ResizeWidth", - typeof(GridLength), - typeof(ResizingPanel), - new FrameworkPropertyMetadata(new GridLength(1.0, GridUnitType.Star), - OnSplitSizeChanged, - OnCoerceSplitSize), - new ValidateValueCallback(IsSplitSizeValid)); - - public static GridLength GetResizeHeight(DependencyObject obj) - { - return (GridLength)obj.GetValue(ResizeHeightProperty); - } - - public static void SetResizeHeight(DependencyObject obj, GridLength value) - { - obj.SetValue(ResizeHeightProperty, value); - } - - - public static readonly DependencyProperty ResizeHeightProperty = - DependencyProperty.RegisterAttached("ResizeHeight", - typeof(GridLength), - typeof(ResizingPanel), - new FrameworkPropertyMetadata(new GridLength(1.0, GridUnitType.Star), - OnSplitSizeChanged, - OnCoerceSplitSize), - new ValidateValueCallback(IsSplitSizeValid)); - - static void OnSplitSizeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) - { - ResizingPanel parentPanel = LogicalTreeHelper.GetParent(sender) as ResizingPanel; - if (parentPanel != null) - parentPanel.InvalidateMeasure(); - } - - static object OnCoerceSplitSize(DependencyObject sender, object value) - { - GridLength gd = (GridLength)value; - - if (gd.Value < 0.0) - gd = new GridLength(0.0, gd.GridUnitType); - - return gd; - } - - static bool IsSplitSizeValid(object value) - { - GridLength v = (GridLength)value; - return v.IsStar || v.IsAbsolute;//at the moment auto is not supported - } - - - - public static Size GetEffectiveSize(DependencyObject obj) - { - return (Size)obj.GetValue(EffectiveSizeProperty); - } - - public static void SetEffectiveSize(DependencyObject obj, Size value) - { - obj.SetValue(EffectiveSizeProperty, value); - } - - public static readonly DependencyProperty EffectiveSizeProperty = - DependencyProperty.RegisterAttached("EffectiveSize", typeof(Size), typeof(ResizingPanel), new FrameworkPropertyMetadata(new Size())); - - - List _splitterList = new List(); - - /// - /// Correct sizes of children if all of them are set to absolutes - /// - void CorrectSizes() - { - IEnumerable children = Children.OfType().Where(c => !(c is ResizingPanelSplitter)); - - if (children.All(c => c.IsAbsolute())) - { - double totSum = children.Sum(f => f.GetAbsoluteValue()); - foreach (var c in children) - { - if (Orientation == Orientation.Horizontal) - SetResizeWidth(c, new GridLength(c.GetAbsoluteValue() / totSum, GridUnitType.Star)); - else - SetResizeHeight(c, new GridLength(c.GetAbsoluteValue() / totSum, GridUnitType.Star)); - } - } - } - - /// - /// Helper funcs which correct elements size of a resizing panel - /// - internal void AdjustPanelSizes() - { - IEnumerable children = Children.OfType().Where(c => !(c is ResizingPanelSplitter)); - - if (!this.IsLogicalChildContained()) - { - //if no document pane is contained in this panel - //adjust elements so that any child will get a proportional star size - if (Orientation == Orientation.Horizontal) - { - double totSum = children.Sum(f => f.IsAbsolute() ? f.GetAbsoluteValue() : GetEffectiveSize(f).Width); - foreach (var c in children) - SetResizeWidth(c, new GridLength((c.IsAbsolute() ? c.GetAbsoluteValue() : GetEffectiveSize(c).Width) / totSum, GridUnitType.Star)); - } - else - { - double totSum = children.Sum(f => f.IsAbsolute() ? f.GetAbsoluteValue() : GetEffectiveSize(f).Height); - foreach (var c in children) - SetResizeHeight(c, new GridLength((c.IsAbsolute() ? c.GetAbsoluteValue() : GetEffectiveSize(c).Height) / totSum, GridUnitType.Star)); - } - } - - } - - - /// - /// Compute the desidered size of the panel - /// - /// - /// - protected override Size MeasureOverride(Size availableSize) - { - SetupSplitters(); - - CorrectSizes(); - - //Compute the list of visible children - List visibleChildren = new List(); - for (int i = 0; i < VisualChildrenCount; i++) - { - FrameworkElement child = GetVisualChild(i) as FrameworkElement; - - IDockableControl dockableControl = child as IDockableControl; - if (dockableControl != null && - !dockableControl.IsDocked) - { - child.Measure(Size.Empty); - - if (i == VisualChildrenCount - 1 && - i > 0) - { - child = GetVisualChild(i - 1) as FrameworkElement; - Debug.Assert(child is ResizingPanelSplitter); - - child.Measure(Size.Empty); - - if (visibleChildren.Count > 0) - { - Debug.Assert(visibleChildren[visibleChildren.Count - 1] is ResizingPanelSplitter); - visibleChildren[visibleChildren.Count - 1].Measure(Size.Empty); - visibleChildren.RemoveAt(visibleChildren.Count - 1); - } - } - else if (i < VisualChildrenCount - 1) - { - i++; - child = GetVisualChild(i) as FrameworkElement; - Debug.Assert(child is ResizingPanelSplitter); - child.Measure(Size.Empty); - } - - continue; - } - - visibleChildren.Add(child); - } - - - //with no children no space needed - if (visibleChildren.Count == 0) - return new Size(); - - Debug.Assert(!(visibleChildren.Last() is ResizingPanelSplitter)); - - if (availableSize.Width == double.PositiveInfinity && - Orientation == Orientation.Horizontal) - { - Size newAvailSize = new Size(); - foreach (FrameworkElement child in visibleChildren) - { - child.Measure(availableSize); - newAvailSize.Width += child.DesiredSize.Width; - newAvailSize.Height = Math.Max(child.DesiredSize.Height, newAvailSize.Height); - } - availableSize = newAvailSize; - } - //Thx to TMx - else if (availableSize.Height == double.PositiveInfinity && - Orientation == Orientation.Vertical) - { - Size newAvailSize = new Size(); - foreach (FrameworkElement child in visibleChildren) - { - child.Measure(newAvailSize); - newAvailSize.Width = Math.Max(child.DesiredSize.Width, newAvailSize.Width); - newAvailSize.Height += child.DesiredSize.Height; - } - availableSize = newAvailSize; - } - - var splitters = from FrameworkElement child in visibleChildren - where child is ResizingPanelSplitter - select child; - var childStars = from FrameworkElement child in visibleChildren - where (!(child is ResizingPanelSplitter)) && child.IsStar() - select child; - - var childAbsolutes = from FrameworkElement child in visibleChildren - where (!(child is ResizingPanelSplitter)) && child.IsAbsolute() - select child; - - var childAutoSizes = from FrameworkElement child in visibleChildren - where (!(child is ResizingPanelSplitter)) && child.IsAuto() - select child; - - //calculate the size of the splitters - Size splitterSize = new Size(); - foreach (ResizingPanelSplitter splitter in splitters) - { - splitterSize.Width += splitter.MinWidth; - splitterSize.Height += splitter.MinHeight; - } - - Size minimumSize = new Size(splitterSize.Width, splitterSize.Height); - foreach (FrameworkElement child in childStars) - { - minimumSize.Width += child.MinWidth; - minimumSize.Height += child.MinHeight; - } - foreach (FrameworkElement child in childAbsolutes) - { - minimumSize.Width += child.MinWidth; - minimumSize.Height += child.MinHeight; - } - foreach (FrameworkElement child in childAutoSizes) - { - minimumSize.Width += child.MinWidth; - minimumSize.Height += child.MinHeight; - } - - - Size minimumPrefferedSize = new Size(minimumSize.Width, minimumSize.Height); - foreach (FrameworkElement child in childAbsolutes) - { - minimumPrefferedSize.Width += child.GetAbsoluteValue() - child.MinWidth; - minimumPrefferedSize.Height += child.GetAbsoluteValue() - child.MinHeight; - } - foreach (FrameworkElement child in childAutoSizes) - { - minimumPrefferedSize.Width += child.DesiredSize.Width - child.MinWidth; - minimumPrefferedSize.Height += child.DesiredSize.Height - child.MinHeight; - } - - if (Orientation == Orientation.Horizontal) - { - #region Horizontal Orientation - - //if finalSize is not sufficient... - double offset = 0.0; - double maxHeight = 0.0; - if (minimumSize.Width >= availableSize.Width) - { - foreach (FrameworkElement child in visibleChildren) - { - child.Measure(new Size(child.MinWidth, availableSize.Height)); - maxHeight = Math.Max(child.DesiredSize.Height, maxHeight); - offset += child.MinWidth; - } - } - else if (minimumPrefferedSize.Width >= availableSize.Width) - { - double delta = (minimumPrefferedSize.Width - availableSize.Width) / childAbsolutes.Count(); - - foreach (FrameworkElement child in visibleChildren) - { - if (child is ResizingPanelSplitter) - { - child.Measure(new Size(child.MinWidth, availableSize.Height)); - maxHeight = Math.Max(child.DesiredSize.Height, maxHeight); - offset += child.MinWidth; - } - else if (child.IsAbsolute()) - { - child.Measure(new Size(Math.Max(child.GetAbsoluteValue() - delta, child.MinWidth), availableSize.Height)); - maxHeight = Math.Max(child.DesiredSize.Height, maxHeight); - offset += child.GetAbsoluteValue() - delta; - } - else - { - child.Measure(new Size(child.MinWidth, availableSize.Height)); - maxHeight = Math.Max(child.DesiredSize.Height, maxHeight); - offset += child.MinWidth; - } - } - } - else - { - double starsSum = childStars.Sum(v => v.GetStarValue()); - double starsFinalWidth = - availableSize.Width - - splitters.Sum(s => s.MinWidth) - - childAbsolutes.Sum(a => a.GetAbsoluteValue()) - - childAutoSizes.Sum(a => a.DesiredSize.Width); - - foreach (FrameworkElement child in visibleChildren) - { - if (child is ResizingPanelSplitter) - { - child.Measure(new Size(child.MinWidth, availableSize.Height)); - maxHeight = Math.Max(child.DesiredSize.Height, maxHeight); - offset += child.MinWidth; - } - else if (child.IsAbsolute()) - { - child.Measure(new Size(child.GetAbsoluteValue(), availableSize.Height)); - maxHeight = Math.Max(child.DesiredSize.Height, maxHeight); - offset += child.GetAbsoluteValue(); - } - else if (child.IsStar()) - { - double w = child.GetStarValue() / starsSum * starsFinalWidth; - child.Measure(new Size(w, availableSize.Height)); - maxHeight = Math.Max(child.DesiredSize.Height, maxHeight); - offset += w; - } - else - { - child.Measure(new Size(child.DesiredSize.Width, availableSize.Height)); - maxHeight = Math.Max(child.DesiredSize.Height, maxHeight); - offset += child.DesiredSize.Width; - } - } - } - - return new Size(offset, maxHeight); - - #endregion - } - else - { - #region Vertical Orientation - - //if finalSize is not sufficient... - double offset = 0.0; - double maxWidth = 0.0; - if (minimumSize.Height >= availableSize.Height) - { - foreach (FrameworkElement child in visibleChildren) - { - child.Measure(new Size(availableSize.Width, child.MinHeight)); - maxWidth = Math.Max(child.DesiredSize.Width, maxWidth); - offset += child.MinHeight; - } - } - else if (minimumPrefferedSize.Height >= availableSize.Height) - { - double delta = (minimumPrefferedSize.Height - availableSize.Height) / childAbsolutes.Count(); - - foreach (FrameworkElement child in visibleChildren) - { - if (child is ResizingPanelSplitter) - { - child.Measure(new Size(availableSize.Width, child.MinHeight)); - maxWidth = Math.Max(child.DesiredSize.Width, maxWidth); - offset += child.MinHeight; - } - else if (child.IsAbsolute()) - { - child.Measure(new Size(availableSize.Width, Math.Max(child.GetAbsoluteValue() - delta, child.MinHeight))); - maxWidth = Math.Max(child.DesiredSize.Width, maxWidth); - offset += child.GetAbsoluteValue() - delta; - } - else - { - child.Measure(new Size(availableSize.Width, child.MinHeight)); - maxWidth = Math.Max(child.DesiredSize.Width, maxWidth); - offset += child.MinWidth; - } - } - } - else - { - double starsSum = childStars.Sum(v => v.GetStarValue()); - double starsFinalHeight = - availableSize.Height - - splitters.Sum(s => s.MinHeight) - - childAbsolutes.Sum(a => a.GetAbsoluteValue()) - - childAutoSizes.Sum(a => a.DesiredSize.Height); - - foreach (FrameworkElement child in visibleChildren) - { - if (child is ResizingPanelSplitter) - { - child.Measure(new Size(availableSize.Width, child.MinHeight)); - maxWidth = Math.Max(child.DesiredSize.Width, maxWidth); - offset += child.MinWidth; - } - else if (child.IsAbsolute()) - { - child.Measure(new Size(availableSize.Width, child.GetAbsoluteValue())); - maxWidth = Math.Max(child.DesiredSize.Width, maxWidth); - offset += child.GetAbsoluteValue(); - } - else if (child.IsStar()) - { - double w = child.GetStarValue() / starsSum * starsFinalHeight; - child.Measure(new Size(availableSize.Width, w)); - maxWidth = Math.Max(child.DesiredSize.Width, maxWidth); - offset += w; - } - else - { - child.Measure(new Size(availableSize.Width, child.DesiredSize.Height)); - maxWidth = Math.Max(child.DesiredSize.Width, maxWidth); - offset += child.DesiredSize.Width; - } - } - } - - return new Size(maxWidth, offset); - - #endregion - - } - } - - Size[] _childrenFinalSizes = null; - - /// - /// Arranges children giving them a proportional space according to their attached property value - /// - /// - /// - protected override Size ArrangeOverride(Size finalSize) - { - //Compute the list of visible children - List visibleChildren = new List(); - for (int i = 0; i < VisualChildrenCount; i++) - { - FrameworkElement child = GetVisualChild(i) as FrameworkElement; - - IDockableControl dockableControl = child as IDockableControl; - if (dockableControl != null && - !dockableControl.IsDocked) - { - child.Arrange(new Rect()); - - if (i == VisualChildrenCount - 1 && - i > 0) - { - child = GetVisualChild(i - 1) as FrameworkElement; - Debug.Assert(child is ResizingPanelSplitter); - - child.Arrange(new Rect()); - - if (visibleChildren.Count > 0) - { - Debug.Assert(visibleChildren[visibleChildren.Count - 1] is ResizingPanelSplitter); - visibleChildren[visibleChildren.Count - 1].Arrange(new Rect()); - visibleChildren.RemoveAt(visibleChildren.Count - 1); - } - - } - else if (i < VisualChildrenCount - 1) - { - i++; - child = GetVisualChild(i) as FrameworkElement; - child.Arrange(new Rect()); - Debug.Assert(child is ResizingPanelSplitter); - } - - continue; - } - - visibleChildren.Add(child); - } - - //with no children fill the space - if (visibleChildren.Count == 0) - { - _childrenFinalSizes = new Size[] { }; - return new Size(); - } - - Debug.Assert(!(visibleChildren.Last() is ResizingPanelSplitter)); - - - _childrenFinalSizes = new Size[visibleChildren.Count]; - - var splitters = from FrameworkElement child in visibleChildren - where child is ResizingPanelSplitter - select child; - var childStars = from FrameworkElement child in visibleChildren - where (!(child is ResizingPanelSplitter)) && child.IsStar() - select child; - - var childAbsolutes = from FrameworkElement child in visibleChildren - where (!(child is ResizingPanelSplitter)) && child.IsAbsolute() - select child; - - var childAutoSizes = from FrameworkElement child in visibleChildren - where (!(child is ResizingPanelSplitter)) && child.IsAuto() - select child; - - //calculate the size of the splitters - Size splitterSize = new Size(); - foreach (ResizingPanelSplitter splitter in splitters) - { - splitterSize.Width += splitter.MinWidth; - splitterSize.Height += splitter.MinHeight; - } - - Size minimumSize = new Size(splitterSize.Width, splitterSize.Height); - foreach (FrameworkElement child in childStars) - { - minimumSize.Width += child.MinWidth; - minimumSize.Height += child.MinHeight; - } - foreach (FrameworkElement child in childAbsolutes) - { - minimumSize.Width += child.MinWidth; - minimumSize.Height += child.MinHeight; - } - foreach (FrameworkElement child in childAutoSizes) - { - minimumSize.Width += child.MinWidth; - minimumSize.Height += child.MinHeight; - } - - - Size minimumPrefferedSize = new Size(minimumSize.Width, minimumSize.Height); - foreach (FrameworkElement child in childAbsolutes) - { - minimumPrefferedSize.Width += child.GetAbsoluteValue() - child.MinWidth; - minimumPrefferedSize.Height += child.GetAbsoluteValue() - child.MinHeight; - } - foreach (FrameworkElement child in childAutoSizes) - { - minimumPrefferedSize.Width += child.DesiredSize.Width - child.MinWidth; - minimumPrefferedSize.Height += child.DesiredSize.Height - child.MinHeight; - } - - int iChild = 0; - - if (Orientation == Orientation.Horizontal) - { - #region Horizontal Orientation - - //if finalSize is not sufficient... - if (minimumSize.Width >= finalSize.Width) - { - foreach (FrameworkElement child in visibleChildren) - { - _childrenFinalSizes[iChild++] = new Size(child.MinWidth, finalSize.Height); - } - } - else if (minimumPrefferedSize.Width >= finalSize.Width) - { - double delta = (minimumPrefferedSize.Width - finalSize.Width) / childAbsolutes.Count(); - - foreach (FrameworkElement child in visibleChildren) - { - if (child is ResizingPanelSplitter) - _childrenFinalSizes[iChild++] = new Size(child.MinWidth, finalSize.Height); - else if (child.IsAbsolute()) - _childrenFinalSizes[iChild++] = new Size(Math.Max(child.GetAbsoluteValue() - delta, 0.0), finalSize.Height); - else - _childrenFinalSizes[iChild++] = new Size(child.MinWidth, finalSize.Height); - } - } - else - { - double starsSum = childStars.Sum(v => v.GetStarValue()); - double starsFinalWidth = - finalSize.Width - - splitters.Sum(s => s.MinWidth) - - childAbsolutes.Sum(a => a.GetAbsoluteValue()) - - childAutoSizes.Sum(a => a.DesiredSize.Width); - - foreach (FrameworkElement child in visibleChildren) - { - if (child is ResizingPanelSplitter) - _childrenFinalSizes[iChild++] = new Size(child.MinWidth, finalSize.Height); - else if (child.IsAbsolute()) - _childrenFinalSizes[iChild++] = new Size(child.GetAbsoluteValue(), finalSize.Height); - else if (child.IsStar()) - _childrenFinalSizes[iChild++] = new Size(child.GetStarValue() / starsSum * starsFinalWidth, finalSize.Height); - else - _childrenFinalSizes[iChild++] = new Size(child.DesiredSize.Width, finalSize.Height); - } - - } - - double offset = 0.0; - - for (int i = 0; i < visibleChildren.Count; i++) - { - FrameworkElement child = visibleChildren[i] as FrameworkElement; - child.Arrange(new Rect(offset, 0.0, _childrenFinalSizes[i].Width, finalSize.Height)); - offset += _childrenFinalSizes[i].Width; - - SetEffectiveSize(child, new Size(_childrenFinalSizes[i].Width, finalSize.Height)); - } - - return new Size(offset, finalSize.Height); - #endregion - } - else - { - #region Vertical Orientation - - //if finalSize is not sufficient... - if (minimumSize.Height >= finalSize.Height) - { - foreach (FrameworkElement child in visibleChildren) - { - _childrenFinalSizes[iChild++] = new Size(finalSize.Width, child.MinHeight); - } - } - else if (minimumPrefferedSize.Height >= finalSize.Height) - { - double delta = (minimumPrefferedSize.Height - finalSize.Height) / childAbsolutes.Count(); - - foreach (FrameworkElement child in visibleChildren) - { - if (child is ResizingPanelSplitter) - _childrenFinalSizes[iChild++] = new Size(finalSize.Width, child.MinHeight); - else if (child.IsAbsolute()) - _childrenFinalSizes[iChild++] = new Size(finalSize.Width, Math.Max(child.GetAbsoluteValue() - delta, 0.0)); - else - _childrenFinalSizes[iChild++] = new Size(finalSize.Width, child.MinHeight); - } - } - else - { - double starsSum = childStars.Sum(v => v.GetStarValue()); - double starsFinalHeight = - finalSize.Height - - splitters.Sum(s => s.MinHeight) - - childAbsolutes.Sum(a => a.GetAbsoluteValue()) - - childAutoSizes.Sum(a => a.DesiredSize.Height); - - foreach (FrameworkElement child in visibleChildren) - { - if (child is ResizingPanelSplitter) - _childrenFinalSizes[iChild++] = new Size(finalSize.Width, child.MinHeight); - else if (child.IsAbsolute()) - _childrenFinalSizes[iChild++] = new Size(finalSize.Width, child.GetAbsoluteValue()); - else if (child.IsStar()) - _childrenFinalSizes[iChild++] = new Size(finalSize.Width, child.GetStarValue() / starsSum * starsFinalHeight); - else - _childrenFinalSizes[iChild++] = new Size(finalSize.Width, child.DesiredSize.Height); - } - - } - - double offset = 0.0; - - for (int i = 0; i < visibleChildren.Count; i++) - { - FrameworkElement child = visibleChildren[i] as FrameworkElement; - child.Arrange(new Rect(0.0, offset, finalSize.Width, _childrenFinalSizes[i].Height)); - offset += _childrenFinalSizes[i].Height; - SetEffectiveSize(child, new Size(finalSize.Width, _childrenFinalSizes[i].Height)); - } - - return new Size(finalSize.Width, offset); - #endregion - } - - - } - - bool setupSplitters = false; - bool splitterListIsDirty = false; - - void SetupSplitters() - { - if (!splitterListIsDirty) - return; - - if (setupSplitters) - return; - - setupSplitters = true; - - while (_splitterList.Count > 0) - { - ResizingPanelSplitter splitter = _splitterList[0]; - splitter.DragStarted -= new DragStartedEventHandler(splitter_DragStarted); - splitter.DragDelta -= new DragDeltaEventHandler(splitter_DragDelta); - splitter.DragCompleted -= new DragCompletedEventHandler(splitter_DragCompleted); - _splitterList.Remove(splitter); - Children.Remove(splitter); - } - - int i = 0;//child index - int j = 0;//splitter index - - while (i < Children.Count - 1) - { - if (j == _splitterList.Count) - { - ResizingPanelSplitter splitter = new ResizingPanelSplitter(); - _splitterList.Add(splitter); - splitter.DragStarted += new DragStartedEventHandler(splitter_DragStarted); - splitter.DragDelta += new DragDeltaEventHandler(splitter_DragDelta); - splitter.DragCompleted += new DragCompletedEventHandler(splitter_DragCompleted); - Children.Insert(i + 1, splitter); - } - - i += 2; - j++; - } - - for (j = 0; j < _splitterList.Count; j++) - { - _splitterList[j].Width = (Orientation == Orientation.Horizontal) ? 4 : double.NaN; - _splitterList[j].Height = (Orientation == Orientation.Vertical) ? 4 : double.NaN; - } - -#if DEBUG - Debug.Assert(_splitterList.Count == Children.Count / 2); - i = 0; - while (Children.Count > 0) - { - Debug.Assert(Children[i] != null); - Debug.Assert(!(Children[i] is ResizingPanelSplitter)); - i++; - if (i >= Children.Count) - break; - - Debug.Assert((Children[i] is ResizingPanelSplitter)); - i++; - - } -#endif - splitterListIsDirty = false; - setupSplitters = false; - } - - protected override void OnVisualChildrenChanged(DependencyObject visualAdded, DependencyObject visualRemoved) - { - base.OnVisualChildrenChanged(visualAdded, visualRemoved); - - splitterListIsDirty = true; - } - - void splitter_DragCompleted(object sender, DragCompletedEventArgs e) - { - Cursor = Cursors.Arrow; - } - - /// - /// This method is called by a splitter when it is dragged - /// - /// Dragged splitter - /// - void splitter_DragDelta(object sender, DragDeltaEventArgs e) - { - ResizingPanelSplitter splitter = e.Source as ResizingPanelSplitter; - int i = 0; - - //Compute the list of visible children - List visibleChildren = new List(); - for (i = 0; i < VisualChildrenCount; i++) - { - FrameworkElement child = GetVisualChild(i) as FrameworkElement; - - IDockableControl dockableControl = child as IDockableControl; - if (dockableControl != null && - !dockableControl.IsDocked) - { - if (i == VisualChildrenCount - 1 && - i > 0) - { - //remove the last splitter added - if (visibleChildren.Count > 0 && - visibleChildren.Last() is ResizingPanelSplitter) - visibleChildren.RemoveAt(visibleChildren.Count - 1); - } - else if (i < VisualChildrenCount - 1) - { - //discard the next splitter - i++; - } - - continue; - } - - visibleChildren.Add(child); - } - - if (visibleChildren.Count == 0) - return; - - if (visibleChildren.Last() is ResizingPanelSplitter) - visibleChildren.RemoveAt(visibleChildren.Count - 1); - - Size[] currentSizes = new Size[visibleChildren.Count]; - double delta = Orientation == Orientation.Horizontal ? e.HorizontalChange : e.VerticalChange; - - if (_childrenFinalSizes == null) - return; - - _childrenFinalSizes.CopyTo(currentSizes, 0); - - int iSplitter = visibleChildren.IndexOf(splitter); - - Debug.Assert(iSplitter > -1); - - List prevChildren = new List(); - for (i = iSplitter - 1; i >= 0; i--) - { - FrameworkElement child = visibleChildren[i] as FrameworkElement; - if (child is ResizingPanelSplitter) - continue; - if (child.IsAbsolute() || child.IsAuto()) - { - if (prevChildren.Count == 0) - { - prevChildren.Add(child); - } - break; - } - if (child.IsStar()) - { - prevChildren.Add(child); - } - } - - List nextChildren = new List(); - - for (i = iSplitter + 1; i < visibleChildren.Count; i++) - { - FrameworkElement child = visibleChildren[i] as FrameworkElement; - if (child is ResizingPanelSplitter) - continue; - if (child.IsAbsolute() || child.IsAuto()) - { - if (nextChildren.Count == 0) - nextChildren.Add(child); - break; - } - if (child.IsStar()) - { - nextChildren.Add(child); - } - } - - - double prevMinSize = prevChildren.Sum(c => Orientation == Orientation.Horizontal ? c.MinWidth : c.MinHeight); - double nextMinSize = nextChildren.Sum(c => Orientation == Orientation.Horizontal ? c.MinWidth : c.MinHeight); - double prevMaxSize = prevChildren.Sum(c => Orientation == Orientation.Horizontal ? c.MaxWidth : c.MaxHeight); - double nextMaxSize = nextChildren.Sum(c => Orientation == Orientation.Horizontal ? c.MaxWidth : c.MaxHeight); - - double prevSize = prevChildren.Sum(c => Orientation == Orientation.Horizontal ? currentSizes[visibleChildren.IndexOf(c)].Width : currentSizes[visibleChildren.IndexOf(c)].Height); - double nextSize = nextChildren.Sum(c => Orientation == Orientation.Horizontal ? currentSizes[visibleChildren.IndexOf(c)].Width : currentSizes[visibleChildren.IndexOf(c)].Height); - - if (prevSize + delta < prevMinSize) - delta = prevMinSize - prevSize; - if (nextSize - delta < nextMinSize) - delta = -(nextMinSize - nextSize); - - double remDelta = delta * 2; - - while (!HelperFunc.AreClose(delta, 0.0)) - { - int prevChildrenCountWithNoMinLen = - prevChildren.Count(c => delta > 0 ? true : (Orientation == Orientation.Horizontal ? currentSizes[visibleChildren.IndexOf(c)].Width > c.MinWidth : currentSizes[visibleChildren.IndexOf(c)].Height > c.MinHeight)); - int nextChildrenCountWithNoMinLen = - nextChildren.Count(c => delta < 0 ? true : (Orientation == Orientation.Horizontal ? currentSizes[visibleChildren.IndexOf(c)].Width > c.MinWidth : currentSizes[visibleChildren.IndexOf(c)].Height > c.MinHeight)); - - delta = remDelta / 2.0; - - for (i = 0; i < currentSizes.Length; i++) - { - FrameworkElement child = visibleChildren[i] as FrameworkElement; - if (child is ResizingPanelSplitter) - continue; - - if (Orientation == Orientation.Horizontal) - { - if (prevChildren.Contains(child) && prevChildrenCountWithNoMinLen > 0) - { - double s = delta / prevChildrenCountWithNoMinLen; - if (currentSizes[i].Width + s < child.MinWidth) - s = child.MinWidth - currentSizes[i].Width; - - currentSizes[i].Width += s; - remDelta -= s; - } - if (nextChildren.Contains(child) && nextChildrenCountWithNoMinLen > 0) - { - double s = delta / nextChildrenCountWithNoMinLen; - if (currentSizes[i].Width - s < child.MinWidth) - s = currentSizes[i].Width - child.MinWidth; - - currentSizes[i].Width -= s; - remDelta -= s; - } - } - else - { - if (prevChildren.Contains(child) && prevChildrenCountWithNoMinLen > 0) - { - double s = delta / prevChildrenCountWithNoMinLen; - if (currentSizes[i].Height + s < child.MinHeight) - s = child.MinHeight - currentSizes[i].Height; - - currentSizes[i].Height += s; - remDelta -= s; - } - if (nextChildren.Contains(child) && nextChildrenCountWithNoMinLen > 0) - { - double s = delta / nextChildrenCountWithNoMinLen; - if (currentSizes[i].Height - s < child.MinHeight) - s = currentSizes[i].Height - child.MinHeight; - - currentSizes[i].Height -= s; - remDelta -= s; - } - } - } - } - - Debug.Assert(HelperFunc.AreClose(delta, 0.0)); - - double totalStartsSum = 0.0; - double totalSizeForStarts = 0.0; - - for (i = 0; i < visibleChildren.Count; i++) - { - FrameworkElement child = visibleChildren[i] as FrameworkElement; - if (child is ResizingPanelSplitter) - continue; - if (child.IsStar()) - { - totalStartsSum += child.GetStarValue(); - totalSizeForStarts += Orientation == Orientation.Horizontal ? currentSizes[i].Width : currentSizes[i].Height; - } - } - - - double starsScaleFactor = totalStartsSum / totalSizeForStarts; - - for (i = 0; i < currentSizes.Length; i++) - { - FrameworkElement child = visibleChildren[i] as FrameworkElement; - - if (child is ResizingPanelSplitter) - continue; - - if (child.IsStar()) - { - if (Orientation == Orientation.Horizontal) - { - SetResizeWidth(child, - new GridLength(HelperFunc.MultiplyCheckNaN(currentSizes[i].Width, starsScaleFactor), GridUnitType.Star)); - } - else - { - SetResizeHeight(child, - new GridLength(HelperFunc.MultiplyCheckNaN(currentSizes[i].Height, starsScaleFactor), GridUnitType.Star)); - } - } - else if (child.IsAbsolute()) - { - if (Orientation == Orientation.Horizontal) - { - SetResizeWidth(child, - new GridLength(currentSizes[i].Width, GridUnitType.Pixel)); - } - else - { - SetResizeHeight(child, - new GridLength(currentSizes[i].Height, GridUnitType.Pixel)); - } - } - } - - InvalidateMeasure(); - - //ResizingPanelSplitter splitter = e.Source as ResizingPanelSplitter; - //int iSplitter = Children.IndexOf(splitter); - - //UIElement childPrev = null; - //UIElement childNext = null; - - ////int posInc = ResizingDirection == ResizingDirection.Direct ? 2 : -2; - //int posInc = 2;// FlowDirection == FlowDirection.LeftToRight ? 2 : -2; - //int negInc = -posInc; - //int i = iSplitter; - - //while (i >= 0 || - // i < Children.Count - 1) - //{ - // if (NextChildIsVisible(i)) - // { - // //childNext = Children[ResizingDirection == ResizingDirection.Direct ? i + 1 : i - 1]; - // childNext = Children[i + 1];//FlowDirection == FlowDirection.LeftToRight ? i + 1 : i - 1]; - // break; - // } - - // i += posInc; - //} - - //i = iSplitter; - - //while (i >= 0 || - // i < Children.Count - 1) - //{ - // if (PrevChildIsVisible(i)) - // { - // //childPrev = Children[ResizingDirection == ResizingDirection.Direct ? i - 1 : i + 1]; - // childPrev = Children[i - 1];//FlowDirection == FlowDirection.LeftToRight ? i - 1 : i + 1]; - // break; - // } - - // i -= posInc; - //} - - //Size resExtPrev = new Size((double)childPrev.GetValue(ResizeWidthProperty), (double)childPrev.GetValue(ResizeHeightProperty)); - //Size resExtNext = new Size((double)childNext.GetValue(ResizeWidthProperty), (double)childNext.GetValue(ResizeHeightProperty)); - - - //#region Orientation == Horizontal - //if (Orientation == Orientation.Horizontal) - //{ - // double delta = e.HorizontalChange; - - // if (!double.IsPositiveInfinity(resExtPrev.Width) && - // (resExtPrev.Width + delta < 0)) - // delta = -resExtPrev.Width; - - // if (!double.IsPositiveInfinity(resExtNext.Width) && - // resExtNext.Width - delta < 0) - // delta = resExtNext.Width; - - - // if (!double.IsPositiveInfinity(resExtPrev.Width)) - // childPrev.SetValue(ResizeWidthProperty, resExtPrev.Width + delta); - // if (!double.IsPositiveInfinity(resExtNext.Width)) - // childNext.SetValue(ResizeWidthProperty, resExtNext.Width - delta); - //} - //#endregion - //#region Orientation == Vertical - //else //if (Orientation == Orientation.Vertical) - //{ - // double delta = e.VerticalChange; - - // if (!double.IsPositiveInfinity(resExtPrev.Height) && - // (resExtPrev.Height + delta < 0)) - // delta = -resExtPrev.Height; - - // if (!double.IsPositiveInfinity(resExtNext.Height) && - // resExtNext.Height - delta < 0) - // delta = resExtNext.Height; - - - // if (!double.IsPositiveInfinity(resExtPrev.Height)) - // childPrev.SetValue(ResizeHeightProperty, resExtPrev.Height + delta); - - // if (!double.IsPositiveInfinity(resExtNext.Height)) - // childNext.SetValue(ResizeHeightProperty, resExtNext.Height - delta); - //} - //#endregion - - } - - void splitter_DragStarted(object sender, DragStartedEventArgs e) - { - Cursor = Orientation == Orientation.Horizontal ? Cursors.SizeWE : Cursors.SizeNS; - } - - #region IDockableControl Membri di - - public bool IsDocked - { - get - { - foreach (UIElement child in this.Children) - { - if (child is IDockableControl) - if (((IDockableControl)child).IsDocked) - return true; - } - - return false; - } - } - - #endregion - - - /// - /// Remove a child from children collection - /// - /// - internal void RemoveChild(FrameworkElement childToRemove) - { - int indexOfChildToRemove = Children.IndexOf(childToRemove); - - Debug.Assert(indexOfChildToRemove != -1); - - Children.RemoveAt(indexOfChildToRemove); - - if (Children.Count > 0) - { - SetupSplitters(); - - if (Children.Count == 1) - { - UIElement singleChild = this.Children[0]; - - if (Parent is ResizingPanel) - { - ResizingPanel parentPanel = Parent as ResizingPanel; - if (parentPanel != null) - { - int indexOfThisPanel = parentPanel.Children.IndexOf(this); - parentPanel.Children.RemoveAt(indexOfThisPanel); - this.Children.Remove(singleChild); - parentPanel.Children.Insert(indexOfThisPanel, singleChild); - - if (parentPanel.Orientation == Orientation.Horizontal) - { - SetResizeWidth(singleChild, GetResizeWidth(this)); - } - else - { - SetResizeHeight(singleChild, GetResizeHeight(this)); - } - } - } - else if (Parent is DockingManager) - { - DockingManager manager = Parent as DockingManager; - if (manager != null) - { - this.Children.Remove(singleChild); - manager.Content = singleChild; - } - } - - } - } - else - { - ResizingPanel parentPanel = Parent as ResizingPanel; - if (parentPanel != null) - { - parentPanel.RemoveChild(this); - } - } - } - - /// - /// Insert a new child element into the children collection. - /// - /// New child element to insert. - /// Child after or before which element must be insert. - /// True if new child must be insert after the element. False otherwise. - internal void InsertChildRelativeTo(FrameworkElement childToInsert, FrameworkElement relativeChild, bool next) - { - int childRelativeIndex = Children.IndexOf(relativeChild); - - Debug.Assert(childRelativeIndex != -1); - - Children.Insert( - next ? childRelativeIndex + 1 : childRelativeIndex, childToInsert); - - SetupSplitters(); - } - - - } - - - internal static class ResizingPanelExFuncs - { - public static double GetAbsoluteValue(this FrameworkElement child) - { - ResizingPanel parentPanel = LogicalTreeHelper.GetParent(child) as ResizingPanel; - GridLength len = parentPanel.Orientation == Orientation.Horizontal ? ResizingPanel.GetResizeWidth(child) : ResizingPanel.GetResizeHeight(child); - if (!len.IsAbsolute) - throw new InvalidOperationException(); - return len.Value; - } - - public static double GetStarValue(this FrameworkElement child) - { - ResizingPanel parentPanel = LogicalTreeHelper.GetParent(child) as ResizingPanel; - GridLength len = parentPanel.Orientation == Orientation.Horizontal ? ResizingPanel.GetResizeWidth(child) : ResizingPanel.GetResizeHeight(child); - if (!len.IsStar) - throw new InvalidOperationException(); - return len.Value; - } - - public static bool IsStar(this FrameworkElement child) - { - ResizingPanel parentPanel = LogicalTreeHelper.GetParent(child) as ResizingPanel; - return parentPanel.Orientation == Orientation.Horizontal ? - ResizingPanel.GetResizeWidth(child).IsStar : - ResizingPanel.GetResizeHeight(child).IsStar; - } - public static bool IsAbsolute(this FrameworkElement child) - { - ResizingPanel parentPanel = LogicalTreeHelper.GetParent(child) as ResizingPanel; - return parentPanel.Orientation == Orientation.Horizontal ? - ResizingPanel.GetResizeWidth(child).IsAbsolute : - ResizingPanel.GetResizeHeight(child).IsAbsolute; - } - - public static bool IsAuto(this FrameworkElement child) - { - ResizingPanel parentPanel = LogicalTreeHelper.GetParent(child) as ResizingPanel; - return parentPanel.Orientation == Orientation.Horizontal ? - ResizingPanel.GetResizeWidth(child).IsAuto : - ResizingPanel.GetResizeHeight(child).IsAuto; - } - - } - -} diff --git a/src/Libraries/AvalonDock/ResizingPanelSplitter.cs b/src/Libraries/AvalonDock/ResizingPanelSplitter.cs deleted file mode 100644 index e13684f1bd..0000000000 --- a/src/Libraries/AvalonDock/ResizingPanelSplitter.cs +++ /dev/null @@ -1,75 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Controls.Primitives; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; - -namespace AvalonDock -{ - public class ResizingPanelSplitter : System.Windows.Controls.Primitives.Thumb - { - static ResizingPanelSplitter() - { - //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. - //This style is defined in themes\generic.xaml - DefaultStyleKeyProperty.OverrideMetadata(typeof(ResizingPanelSplitter), new FrameworkPropertyMetadata(typeof(ResizingPanelSplitter))); - MinWidthProperty.OverrideMetadata(typeof(ResizingPanelSplitter), new FrameworkPropertyMetadata(4.0, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); - MinHeightProperty.OverrideMetadata(typeof(ResizingPanelSplitter), new FrameworkPropertyMetadata(4.0, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); - HorizontalAlignmentProperty.OverrideMetadata(typeof(ResizingPanelSplitter), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); - VerticalAlignmentProperty.OverrideMetadata(typeof(ResizingPanelSplitter), new FrameworkPropertyMetadata(VerticalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); - } - - public Orientation Orientation - { - get { return (Orientation)GetValue(OrientationProperty); } - protected set { SetValue(OrientationPropertyKey, value); } - } - - // Using a DependencyProperty as the backing store for Orientation. This enables animation, styling, binding, etc... - private static readonly DependencyPropertyKey OrientationPropertyKey = - DependencyProperty.RegisterReadOnly("Orientation", typeof(Orientation), typeof(ResizingPanelSplitter), new UIPropertyMetadata(Orientation.Horizontal)); - - public static readonly DependencyProperty OrientationProperty = OrientationPropertyKey.DependencyProperty; - - protected override void OnVisualParentChanged(DependencyObject oldParent) - { - ResizingPanel panel = Parent as ResizingPanel; - if (panel != null) - Orientation = panel.Orientation; - - base.OnVisualParentChanged(oldParent); - } - } -} diff --git a/src/Libraries/AvalonDock/Resources/Brushes.xaml b/src/Libraries/AvalonDock/Resources/Brushes.xaml deleted file mode 100644 index 2c85933640..0000000000 --- a/src/Libraries/AvalonDock/Resources/Brushes.xaml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/Resources/Common.xaml b/src/Libraries/AvalonDock/Resources/Common.xaml deleted file mode 100644 index 1041b37c96..0000000000 --- a/src/Libraries/AvalonDock/Resources/Common.xaml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/Resources/DockablePaneStyles.xaml b/src/Libraries/AvalonDock/Resources/DockablePaneStyles.xaml deleted file mode 100644 index 467055b6db..0000000000 --- a/src/Libraries/AvalonDock/Resources/DockablePaneStyles.xaml +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/Resources/DockingManagerStyles.xaml b/src/Libraries/AvalonDock/Resources/DockingManagerStyles.xaml deleted file mode 100644 index 30dfd9d484..0000000000 --- a/src/Libraries/AvalonDock/Resources/DockingManagerStyles.xaml +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/Resources/DocumentNavigatorWindowStyle.xaml b/src/Libraries/AvalonDock/Resources/DocumentNavigatorWindowStyle.xaml deleted file mode 100644 index d0c43ae544..0000000000 --- a/src/Libraries/AvalonDock/Resources/DocumentNavigatorWindowStyle.xaml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/Resources/DocumentPaneStyles.xaml b/src/Libraries/AvalonDock/Resources/DocumentPaneStyles.xaml deleted file mode 100644 index edbdc3e2f0..0000000000 --- a/src/Libraries/AvalonDock/Resources/DocumentPaneStyles.xaml +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/Resources/FloatingWindowStyle.xaml b/src/Libraries/AvalonDock/Resources/FloatingWindowStyle.xaml deleted file mode 100644 index 0d6b191279..0000000000 --- a/src/Libraries/AvalonDock/Resources/FloatingWindowStyle.xaml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/Resources/ManagedContentStyle.xaml b/src/Libraries/AvalonDock/Resources/ManagedContentStyle.xaml deleted file mode 100644 index f6e2c151c6..0000000000 --- a/src/Libraries/AvalonDock/Resources/ManagedContentStyle.xaml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/Resources/NavigatorWindowStyle.xaml b/src/Libraries/AvalonDock/Resources/NavigatorWindowStyle.xaml deleted file mode 100644 index f8433a0e02..0000000000 --- a/src/Libraries/AvalonDock/Resources/NavigatorWindowStyle.xaml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/Resources/OverlayWindowStyle.xaml b/src/Libraries/AvalonDock/Resources/OverlayWindowStyle.xaml deleted file mode 100644 index b26979c92e..0000000000 --- a/src/Libraries/AvalonDock/Resources/OverlayWindowStyle.xaml +++ /dev/null @@ -1,58 +0,0 @@ - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockBottom.png b/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockBottom.png deleted file mode 100644 index 63edb12fc6bf956948ae5270c99089f5d13aa7d4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 699 zcmV;s0!00ZP)Vl&|0000ibVXQnLvm$d zbZKvHAXI5>WdLnuav(A_AZ=lCATls8IUq4NIyEsmG&3M8FflMN$=#l?00007bV*G` z2iXG|5HteXRf#j5Qg7176Af{L=?&5qXxI)&_jum+;f9Vj!C7S(o;|UX+8E(a_kSN zN+Y#75k3ScQcf|S2IK6k1j02bCdhkfUuk98%+9mpomn#sT!X>Dsnu$z*XtOLMhHsL zNCdfD4u)YM7K<^~@AsX`)fI}xBGRc8!r^dWaLcmL?sQPCR#7gMzNX z{Zoxb17@!WrG9&hbUG~!Ov+?3Ag(&*uR>MTwG&1b&yAt8)-D=hi0=H|hIoSOceTyV z5Z{0G@X)uPw0W@`!rMX|Z(c`z`ScAhgSEDHJcV8?MbgNp^^_n;~^ zK7aY)`R)Ad5Qe_Di90CEtMM}oJ&6zRjxjLr7K85Txu5wSxL+`h*=&aWWE_|8Pca_e zi!0sJbH6@Zd%kK_>y+11`1J9Dm#GHZwtdehyHF^!9eg^SLemb!brUhhya~4{{JC?M z_3X&Ekt=f9a8Klvtumx2iaT=p)J-N6DR9bkN;+5MR4%gQikx1#EV!rC2rg^S=O^I; zE;Hd)!ey1(GDq3M&(``6|3~5T<4!t!hqp&`y3v6jv?xeA+lfb9(Jt}gLyGrl^l=HY z-U%Gx&0@RV7XN_MSG;5VTB(RGLesQB8$}AP)9vE-%?--sGQ?(^rYTzFW~+r!fGsjb h{W6;sEpj4}V2`D0f?CO~sw)5h002ovPDHLkV1j_NItBm$ diff --git a/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockBottomHover.png b/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockBottomHover.png deleted file mode 100644 index 69d4fe3115edb371f94dde5caac0857183f4c316..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1260 zcmVVl&|0000ibVXQnLvm$d zbZKvHAXI5>WdLnuav(A_AZ=lCATls8IUq4NIyE#pH8~(FFflMNM=lB^00007bV*G` z2iXG|5H}TasA4Su000SaNLh0L01FZT01FZU(%pXi00004XF*Lt006O%3;baP000C- zNklfv7>E@t`7jHVDCh2fZu)T=gXA zLA-iVqF_M0iCzK`4M`-o=#tfd;K3z_Fk`Yivoq5_<@dU(XM4t--5FuMXbq27T|NE2 z_r7}XRks31qtW>K=j$uapIr{Ix*lV<#zIBoOx;Jly7=YX+}tTe;2%z(y?(;f9>>$i z4GxqPO8jG9QK)@tk6MojU?`CYCn0s0xrxOmBY(0mN< zoir#L1&=7c7BJ2UtVCdC+#wDKf3XoU2*nXD7|y#|I489hE5s!@Y_}{8boPC}}Jc z*B^(*JR@4U(Zc!5O*C$YBmcMOE+0=Go57K#X@t?vcKy^FGeTr^XsA}LK-WR!+b-5oK^d%aa zi~S(pWI)@<`A}@Ec4FvJGKUkle!Car-n}z;=j|8JURzDHT+4d@Sq$08+GQkzw8yp# zJc@Rb&6lLkGbMB@^iZ!Iz(?=Djt36z$IZ@QnWj{y3?@-KNw=gAp31&Qn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DE$5s@cd ze@K_qd_ISC+ck;rYBkR&WV2cB-jIUq4+c1HHc_os;U#}G8hP&cTepiDXLn4|-zpS5 dcdV+a@CRQ2<|#Fq1<(Kh002ovPDHLkV1g?SI^6&O diff --git a/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockLeftHover.png b/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockLeftHover.png deleted file mode 100644 index 4011775be4bba17668cdf2cd036afa2615f705fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1198 zcmV;f1X25mP)WdLnuav(A_AZ=lCATls8IUq4NIy5#qGc+J8FflMNCGBmV00007bV*G` z2iXG|5HAjT)-#v@000SaNLh0L01FZT01FZU(%pXi00004XF*Lt006O%3;baP000C9 zNklU;HlufD1hU|U^X{py#-<>zLWLR?!{7-X9)NxWS5P_G@DtyZfq2s;1%#7yH!U3&t@ zk7+zKDlozqhXqiiEf5~BB`o@FW*89>YM@KorESw*ZEJixFCZHi@aapn@5J2s3;Oix zG~Pe1QG!50I)^cYwXRc z2}FE5Af&P*7t%%}?ge(}A}0xzac=q_DF|%Pnz|tQBq1V`6r>SwA8D0gt+(r=AH)%G z7#|X7{@%tO))iA@LU%tU5QT_~gn1Ba!R2aO=uGFQee^i|?C(22oE7UUD-e-AI}o30wEIWf~`6 zJ8kso+`KpGD>SZL$LTZYQJR>-sPDAF+(x=L4P_F6Kv^P@(?psEl|K#l_!8HyH}TE~ zpWRWMq0?AOz=Xu4z`zg*bP|<+=%Nn{Gsl+}7xC(AAKo!KrvGka`%F_X)6}ST0#sO^ z$0?c;rD~>)PeBaDt0PxQw?g*Q4%Uz2%tt5j#@nClc(#07;aBcCzU0`a(i8;18fU@= znQannqN6OfR4+RHqVZRR$@}lcd#6t9AYl6246(fqfCM%|`=CQ?MHXF$K;=V+-+Z$I z96tB}-hJ~K_{Bm>!1UL4Ga*ADA_2vbYko{nNn51Yr45M0=7H(w^Q!^YOXGO{*#j6a zd6od5ZPHhe)d18^(J8kmWh-Q!rkp4jnjz}@tC;SrVS@X?CexEFe!U0`xGl95Mh=uQ zdxM+a&Fw?+c7uRP?GJQ*E7-ZC_|JDl{}YhO?`|?NzLLt|?HLgmqcF=wxho`m%D&9{ zzD7M7-`*=nhA_8S;Nc{K&&gZ%>{>8N47;^pDCb&WnyCSyTV;nM#C`dmJ%5zxxIBmW zjOaajq<*8mFu(Wg(lIj~#v3?lD@emR|UI31=@WtZWSSfOg-Q#EUhF#~-PqQmKf)0iCJ0B3Oqp>i_@% M07*qoM6N<$f;wa#3jhEB diff --git a/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockPane.png b/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockPane.png deleted file mode 100644 index ccc29ae53e7b0cce104699e0571a42596190a701..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3624 zcmV+@4%hLCP)KEW0000ibVXQnLvm$d zbZKvHAXI5>WdLnuav(A_AZ=lCATls8IUq4NIx;ajGcq76FflMNOjL=U00007bV*G` z2iXG|5F!(-ejyA1000SaNLh0L01FZT01FZU(%pXi00004XF*Lt006O%3;baP000et zNkl~_nq;PfLK~uk{&;POi!OarR8`$XZ3`FL5jsC)xP(xb)Y9HyqGCfDkG z_UswWFDy{|zI{T;!|yc#T0DL7gtlzi;%c3Zjg3mZqCq(2tRxZ?2n1ZM6ZN59(IA|1 z@>oY+IWikcg=S}GDVxa0$H$fH z)vH&o2*Bs}Q(+*W)Oq2v&oYt+o35gwf{KfasXh{+9W5<6HS=lqHy1JT6zEgmu77PZdwx))DbmmOf`xh1#6xznd z#^~zRt5QvEEgkIa%!!g5SI(U~cckY-LsVZ^M;&jyWvdJfX>Ro#R-ak023A>FNo{Ry zG%_+mfBEVwX=`I6wYRrBsw791bL-YEX?b~>j=%RF`Th1+hM*YNhBZ!8x}l+g>g(&N ztE)@lzoVnWF$Focws!mWZ7EbzLWd3=;!+F%VI`AES1vRHUgHD&f^YB-IXER#N0fuz z%eA#N+S%Ib2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q*HKRp9527_u+cj zy@q_<22(AEFHX1eO&SQqw46j0jY+f^EuCkG1*+lT>fS8!v+|H}t`D=P1e+oU<3EV_ zoxtcsl!ngC)BIxb(TSRBFKxdsLR)*owv~%7ivrnICi_cMV2T_ZiGO!)j@DIITTYG^h4uB+k#y-lFOGb%LPNSk|3=KS$21}(XW2?qWp>f^=`ee zf*g2#(7}cC=Ph|{izPuQ4jLL68Ik8b5Otek{m^hl86k$Q%xb@s=(5$YQJBqhr|!0p1$}PX)7h zs6m`0d{=DubTQcVdKM$=0=O)^f5ExhkQFTk3m~j~e~zVNYbY4rJcWV8zP>)$)rOhj z^Y2{P=gCJUh zGTz$k0#`Vny)1Pt)*~SB#uWX;#Dpy0{{8#QQk%+NMU`(moV|Ouvc~`5eILW-cSByqj7ljCxW= z^Qw@e14a)@GJ*;@I$`H7H@6Z4xNe%df)!NAaWN|7xEK|3T#O1iE`}?~abmi`jc^?~ z%59M4M*cQGx50IBj+t$cdXc})&uws}{V=)>QZMqi`8h3jK3rEI4kOzj^&)?ppWE<1 X_J6fgw+pDo00000NkvXXu0mjf3~EjB diff --git a/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockPaneLeft.png b/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockPaneLeft.png deleted file mode 100644 index aca8e9310195d900dccbc7dc8afede07184beafb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4244 zcmV;F5Nq#=P)KEW0000ibVXQnLvm$d zbZKvHAXI5>WdLnuav(A_AZ=lCATls8IUq4NIx;ajGcq76FflMNOjL=U00007bV*G` z2iXG|5GWPD@@%sJ000SaNLh0L01FZT01FZU(%pXi00004XF*Lt006O%3;baP000l` zNkl3&26+Ukk&)A;9HW+UhV~jCoGlZp}tR#w(G(sXFAx)J^Ren`btEyG{ zrJDrB-UIh(FCDrL96p(j*P2&C*mrlLiwE7y|}l47Rb2vBBGTmiKzUJ9F(> zJ#U*gugZMV_4B-WbC>ho<(zYuCy@;?Jw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urVzT-33l7Z{8cmS@D zGiQVxb8D_ZuLp3MEZ193Cd`;a47_$$P2uv!*;RJyG zVigG<53x_IddZTk^4;#_0_Ch625k7(rHIPs0yHjD@5rLjYJz;Qw{8D{1G&2&&8nqO zuL7ps-5MsQOXpNL5}?>gMfhnx`GW3LNSl0*LsmhkPVt^W;k3`Ma$UejRp35pBWsaaV9wyH}*>*f}HX3 zaZ{%Zpi6sO8#d0*pE9rtyms;KojXlWiyMIvLzETcn7so4F=#P+-+h;!c>Hn8Hujt= zE#OtdmlBJ6r9BMKww$4%A@x{>l@(f}zyOc&rn|e_ZFP0wNpf(23NMx0x^=55@6jy8 zNivkT&bPJvvbI_HQ`sI2!y{31v z&289fIbw5qq0QiCfI!U1o2X`^3Qf-zE;CdvQDsGbZx-dn4aP7=AnalHOsg$&%56?M z+QEe@vvlbABu!4|o}H+!^3%rK!nCft@TqsC6`}xdF-RQvlkn z{sg`HkN&LBp4hdCx;knM<>Ta%iI`9wzkc1+)QxUlb{_8S?UnEg9}vb#1CrWM_K|{rHDZs8{^& z)DaLf8{Ldpe>Y+byIY;CK$KZ%y903qPPg9nwtGiTI& z33#m)6fqK%iPlys2!o5&%R=A9*&_trSfaneVFdKswQE;VYE#jxsP@+mZ%j-S{63U^ z=)ngao$Ja6vEv0Vy)zOt)_v7~?NAG|3SeIXUWNxUO97CB!5qZcS?@0fJhz?$l=5Vo zlQZg0!?Wa+>P%>^^Qm5dC&{rAgj&TSIVR!Ou|u!HbIa6=n8zYH9>yX$9>yX$9>yX$ z9)>5$@zR@d-Gt}J(H?^=HZqU-c@3V6bLgn*eqMto`wtw0T+`cY`WU2HfP9>y v!vZ0W`MIrkCOjvQfR$sAW|4W!&ujQU;SBaV9;JW%00000NkvXXu0mjf#Zq3r diff --git a/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockRight.png b/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockRight.png deleted file mode 100644 index 3e90ce2b4c9790f167833c003bdbba4a0c1b7a91..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 755 zcmVWdLnuav(A_AZ=lCATls8IUq4NIy5ypF*qPAFflMNOJBQ`00007bV*G` z2iXG|5HBM?32*HH000SaNLh0L01FZT01FZU(%pXi00004XF*Lt006O%3;baP0006? zNklq;E0|CkFPyocb#|4;IJ4i+*ul*>fBy!m`8%6}XyAOC3bi3U^$q9nX z5DO9@RBgs1xPR{!djjotJ8*Kj$t^V^s`q3<$K6sK<_#D9em`(>vEkpIh9ux(`~`PR zH?V~J8&6mtZduxkN$Ej3G`vHtV&Qq>)5-tD$002ovPDHLkV1j$8Mw0*l diff --git a/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockRightHover.png b/src/Libraries/AvalonDock/Resources/images/Aero/AeroDockRightHover.png deleted file mode 100644 index 1015ec89acc684b0ce6050772ef644727b6cfb49..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1183 zcmV;Q1YrA#P)WdLnuav(A_AZ=lCATls8IUq4NIy5*sG&UeBFflMNrhY{o00007bV*G` z2iXG|5HSTgMb*y$000SaNLh0L01FZT01FZU(%pXi00004XF*Lt006O%3;baP000B_ zNkl@IjmNmRsIigKUz9jm2~a5?xZc~_`=KE4Uylz}-!bL4 zarB76{;dLAXkxbj@-*g11G<;6+Ntm|6lrXLCXG!R>oopdH~48pKvr+#s}tp)#qh1$ z=JMPiK0Rtsgg{O@z(j=|ol%j2fbmKfWtfmbtnIUijDCF6;FHpCkYA2Pc=cU@ytb@2 zS`>i(Ctm$|g_dlzb%sR@VO^Sfl zHa3b-a-0j&CZ2XyI1!C_h9oo=$T$qX=gJVNl?0wmONE`#N=Uc#EZ}h9e#P3^OGdpy zuth-8?1)s-%K|NZE7f70YsWa}J5pIl=oC2HSFRknFGzahiAWy;p2+pzNB({|RYy;k zSYd72^P>|rX0>`-v0s}fpkgFVBA*kOex&f-%}1E{YZj%vY$NeJs#5Ant`OjMsVxbX z`NbI5f0)F-4{F#;t-00BG6J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8a|EY_^#S^HO&t^Rgqwv=MZThqqEWH8 zxJo>d=ABlR_Bh=;eM9Tw|Ih34~oTE|= zX_mAr*D$vzw@+p(E0Yc6dFE}(8oqt`+R{gE3x4zjX+Sb3_cYE^= zgB=w+-tUy`ytONMS8KgRef4hA?t0j zufM;t32jm~jUGrkaOInTZ`zyfns>EuS}G30LFK_G-==(f<51|K&cocp&EJ`SxAh3? zNO>#LI=^+SEu(FqJ)ynt=!~PC9bO$rzPJB=?=j6w@a-(u02P7 zaQ)#(uUl{HW%tYNS3ItC^iAtK(eKlL`f9+{bJzISE?u8_z3;~C8@FyI-5j_jy7l;W z_U#vU3hqqYU3!mrul&B+{ptt$59)uk{;_4iZQ%G|z+lhASr6|H35TBkl>gI*;nGLU zN7W-nBaM%pA0HbH8olyl&XeJ%vZoWz%6?Y=dFykl=imL}`%BMQ{Mhgd`HRoLu6e2R za__6DuR6yg#~-}Tc|Gx_{H@O0eebyMy5GmWADJlpK>kqk(fVV@r_fLLKIeS?{4e)} z^ZO;zpECde00d`2O+f$vv5tKEQIh}w03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(` z>RI+y?e7jKeZ#YO-C07OYdK~#9!V*LOAKLe?Nkz!3Jj;>%}U|_&z3ZsQ}1VK%V zP@(@LRTIwex3G?2#Ag!&k}Zr#nivLH6R`jQ009600{}RGQ|DtzxEKHc002ovPDHLk FV1h<5Xs7@H diff --git a/src/Libraries/AvalonDock/Resources/images/Classic/PinAutoHideSelected.png b/src/Libraries/AvalonDock/Resources/images/Classic/PinAutoHideSelected.png deleted file mode 100644 index 87cad42141477a80388a95ddce23382ebc3b32ae..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2838 zcmV+x3+eQUP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7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^JA86v({H5aB!kjoO6 zc9$1ZZKsN-Zl8L~mE{`ly3)1N^`o1+o7}D0ZPeY&J;i;i`%NyJ8_8Y6J?}yE@b_5a zam?eLr<8@mESk|3$_SkmS{wQ>%qC18))9_|&j{ZT zes8AvOzF(F2#DZEY>2oYX&IRp`F#{ADl)1r>QS^)ba8a|EY_^#S^HO&t^Rgqwv=MZThqqEWH8 zxJo>d=ABlR_Bh=;eM9Tw|Ih34~oTE|= zX_mAr*D$vzw@+p(E0Yc6dFE}(8oqt`+R{gE3x4zjX+Sb3_cYE^= zgB=w+-tUy`ytONMS8KgRef4hA?t0j zufM;t32jm~jUGrkaOInTZ`zyfns>EuS}G30LFK_G-==(f<51|K&cocp&EJ`SxAh3? zNO>#LI=^+SEu(FqJ)ynt=!~PC9bO$rzPJB=?=j6w@a-(u02P7 zaQ)#(uUl{HW%tYNS3ItC^iAtK(eKlL`f9+{bJzISE?u8_z3;~C8@FyI-5j_jy7l;W z_U#vU3hqqYU3!mrul&B+{ptt$59)uk{;_4iZQ%G|z+lhASr6|H35TBkl>gI*;nGLU zN7W-nBaM%pA0HbH8olyl&XeJ%vZoWz%6?Y=dFykl=imL}`%BMQ{Mhgd`HRoLu6e2R za__6DuR6yg#~-}Tc|Gx_{H@O0eebyMy5GmWADJlpK>kqk(fVV@r_fLLKIeS?{4e)} z^ZO;zpECde00d`2O+f$vv5tKEQIh}w03c&XQcVB=dL;k=fP(-4`Tqa_faw4Lbua(` z>RI+y?e7jKeZ#YO-C05eHMK~#9!V*LOAKLe?Nky@ItnZihnCPp*^Mw}*m;m=4+ oJpD(vVQ^`}2><{90RR6309j2n=XTgnhX4Qo07*qoM6N<$f^Rrt*8l(j diff --git a/src/Libraries/AvalonDock/Resources/images/Classic/PinClose.png b/src/Libraries/AvalonDock/Resources/images/Classic/PinClose.png deleted file mode 100644 index 3e8c611a2c3779e4b07ac6ae62c3f6f842ecba7f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2865 z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XXu0mjfnf-1V diff --git a/src/Libraries/AvalonDock/Resources/images/Classic/PinCloseSelected.png b/src/Libraries/AvalonDock/Resources/images/Classic/PinCloseSelected.png deleted file mode 100644 index a15868156a39e4170dae62a3edff3efa2fce91fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2856 zcmV+@3)l3CP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz@B062qXfFfD`NpUW5?BY=V%GM_5c)L#QR}BeW8_2v-S%gfYS= zB9o|3v?Y2H`NVi)In3rTB8+ej^> zQ=~r95NVuDChL%G$=>7$vVg20myx%S50Foi`^m%Pw-h?Xh~i8Mq9jtJloCocWk2Nv zrJpiFnV_ms&8eQ$2&#xWpIS+6pmtC%Q-`S&GF4Q#^mhymh7E(qNMa}%YZ-ePrx>>xFPTiH1=E+A$W$=bG8>s^ zm=Bn5Rah$aDtr}@$`X}2l~$F0m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05nNNK~#9!V*LOAKLe?NacF5GWC9~DoBrd|fX{jVacLmr pr~lYA48b6$ohASP009600|51uD(BxPAbJ1*002ovPDHLkV1gQ^WjO!< diff --git a/src/Libraries/AvalonDock/Resources/images/DockBottom.PNG b/src/Libraries/AvalonDock/Resources/images/DockBottom.PNG deleted file mode 100644 index cdc7c06ebdad41ed7d5fa2ca2fc1cd41f15f7764..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 701 zcmV;u0z&j6!UFrRW5!#CJLtK z;S_Y`{_Ej8lNWFK&tHE&;PyFOPfj{V`_JC%b9j4BTsze7?(B0BYw30F>mJ-|J+r6N z(bM72WHNwAl2qjif{@GQ3WWl4ujt><1odnD!%tt}$JpC%Bh%~NsjpXGmR&EF2Yp4y zsjOK>-(Qe_F2<)u-GY!eYU1k=u(Y$!OZ$vZEw14(^gGQZ>ajYJ|yn`;C00004XF*Lt006O% z3;baP0007TNklWy5~PX&OJho@RHTYVB3^3H#u|;c;H_GgX$UssK6+)YA4ZAq<&4+`}+d$t(MrcIOSVfKV&$@%77XSN3d zfo)qV0EnU(3WXw(NR+p*-Q$7vcs!m?r?b4p0ATO1F3WPBw-^8f23v>mo({j~-Xzw= zJ1p8>iUYoaxFPjk z%i27tE_VWea5xNxIbg_N9vm;ZCn}`r)%i#}?fZIsOtIh3AG-VL;4OK-SL(i+v3k;^ z_g+ZsIsbn5V65ZpI{*YhKuF91ujf>(>6kW?D2tg&Se}pN7n4dYr+t@8Kd@Fdk|qJg zV6rS`>i{YP;LjV`UuhDc1(PM_!H4IbjjPCNdug%HY!W~opo*wW z0VtSzfX#N%u7z&e(-RR9aotN}m{%&Vv+z?vkp5D~zv*tcIyKP;bLtyonpX8Pr4VtS zrvG*FdO2vt0~!^xnX29g|Arlh^MKl?&DHQk!$FGU6rbCahG#Oa0${X%Icj*Tz%k8N fjB5*iwod*6m105#MH!5000000NkvXXu0mjfKRG*e diff --git a/src/Libraries/AvalonDock/Resources/images/DockPane.PNG b/src/Libraries/AvalonDock/Resources/images/DockPane.PNG deleted file mode 100644 index 0377b966e23a237fcbdf71d4e246b0cf5a0ac833..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2790 zcmVl7yuYzVSQf>wdZTC}^CY*t7!(>>+>s=B(Xd-^rI zRoy+ZKWM6_AJzST{dZM${a@8EssQKCo#SO+^VqRttO{FOwlBarC&q?to1B~!X`|6d z+;0-suV1%qW-6=`oP}ny87v_BPDEt{gHRB=Y11Z}n3%Bc#Z|!?!Fthf;lhPIhYlV3 zP~VSzAQx7k1U6J9$~${OTC^;U5~_W*W1=} z{B^ml;}MJ$$ARF!_h4M_A+h(*)AI5%?b@|Vydifa!5~g}vA2G0dip*uIg@q#zZX}? z9dH`(fh1XYGe{c$8SGf`wRzm>sxz9JJfb@OaYB3C`!*K9-*UXNlmn z&*UV)gChjSns{8)Z!9c>HCN@D$JY%O2@VNZSy?$TJw5$)=8d3|3(5eGN{>L!S?Ik2 z;r`$nTq}TUSPEP9;88w*n?YX$i={=@)Am=7vU*sq6glXblfN;N)(Mq7ZuAFl-@aXZ z#%|ucnVvrVXL{=oKQxyA14mz_Q%~-u+1Xjzwrv|NEG$&kAAD!_5!MKw6Kok{MKE6d zal_aUtjHZVlC2Z0_X+3q52xYyi8rV}IVqN&w;Vt5+wvINAdC>4#hcz1UQbx)zEkf} zcY2DtQ+J7_C(A-;lmFO`V%FrSNq5MzPXCeS@81#_+-RB*<+-BVOEdb*_dX~H>vY;a!5i17(fj8`#Tl>Y;ty2V z2fJX01<_$(r7C|LtV#R7_E2DOx7!z~O`|U^UK9DZTk@mBwmwaNpeF505*;SKJG#L* z8L3U9e|Bn*(bp1q;Apx&txWq83I6Uq@_=SzKy9z+fVZQJg1iagb!Zq=6!_pw@!CJr z=qqdV^B2$36HlM?($~H8VG+c9{_GEOQ+2#LKkuGKd7!v20HixU@jZ{|eqTO-o+$og zx&7M0@cB8_Ig_%3c%A3h116)miW~rB0U)nPs*aZr=d7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b/src/Libraries/AvalonDock/Resources/images/DockRight.PNG deleted file mode 100644 index 067b3f0632630ddf405cb988242bc0c8bc8532c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 691 zcmV;k0!;mhP)C00004XF*Lt006O% z3;baP0007NNklW+w*yVTe*OAwY6GYRz<>cd9cXxvie@k#|6a`oy}plSE+-NRzR+`YeN?)<*s zz#j++;ZENAwRgj(_Eqm2mcFi>_q=$<Mr|NUGOPC2ejbm z(W5{+uv<_%=V{T*C*^aWLr4fWZ`z~m$q&-{?LaiZZo@5j0z&V+E79jEg zI1ZpWnfRgt=s?O5&KeC^kzTlP;n1N&Koyh#oOLp!)dIAJ!uAo)Rt2z{rY?XsTYwbp Z003ukLQG-h*UbO`002ovPDHLkV1gzvHH!cM diff --git a/src/Libraries/AvalonDock/Resources/images/DockTop.PNG b/src/Libraries/AvalonDock/Resources/images/DockTop.PNG deleted file mode 100644 index b14b818c7dc6d1b699dc7f0dcfa384efacf76a6a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 719 zcmV;=0xPx#1ZP1_K>z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBU!O-V#SR7gwhmfLF+K@`UI{}QB%0ZU^`sZ^wjMj~2k(8d~#x8SYb zeF&(9)C$rE`{YXuk}hl^S;URGZ&w@H*d!$-w)7(6gF^ew%x(;tbnLK#4<5dpe0%2X zkC|nYnXTb)c+1}iaAjGJ#bS!0ys;_BT=4-kkw|1RnVd~waxqgtbzLvm6ebs|$3(&O z-yVm~-F!ZDZS3@w(8-IBkNbjd?}NjhJAM5(dfkEULl^e+`PzHEEIWEUJGut8JCAK^ zcXzjiG))7eTpgZR3XFd~|Fr6TQXU8v-S<8o9DdL8 zzN=c#2Aw{uW!JM|V^Ns_Sc=G=%{hF+Ztf#?qxas0j+Mp^fn}%MdP&X^fq=zbnI_V_h zaPy^={OoFemSm0j60}0aj8$Q6R-MDuD__LK=b{5>fxOZ0VofwS^A*Le{d-)@XoJ-V z&KI{awL*(_V74f)Sy4~p{~>hF_)Y5D(v zT^f5ehQ*@gK95rc(87nQmgf>|{kDX8-ocmcu?|hnSd{OUeFgvk002ovPDHLkV1kG% BMpb%$) zM`SSr12<5bTZr+}-MT+OL6&q!Uq=Rpjs4tz5?O)#y`CXf8orD$p;?kZH0{JUuP{yElj=9_hMESx&QWQ)|K zBRp=07gWitzkPL%Bp3H)q3Q@@FmclXTspFJ`c1!?(T0b;*^Bdm?kzBm@Y4 w-Q>~!Cd2K_kKGSt)4NUo1bzKKef=+n-K)}-PDva50D6SM)78&qol`;+0M?O!p8x;= diff --git a/src/Libraries/AvalonDock/Resources/images/Locked.png b/src/Libraries/AvalonDock/Resources/images/Locked.png deleted file mode 100644 index b8f6ced2df26aa988dd3087712d62e9168c4351d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJx0U~c5>$3n-Iwh_VCC){ui6xo&c?uz!xv31f ziA4%VCJJE6z`#<$(A3Jr+{)NoLEFI4z#y|OdL>XFdx@v7EBj4m2|fdbqj5K{0fjgV zJR*x37`TN%nDNrxx<5ccmUKs7M+SzC{oH>NS%LgLo-U3d6}M#jbomY$Fto;>6qzP( z&Y~#6)7LY9^&6hu2Ta;M@ppmi?D0cO7$zBdEetd$<=xK z=Mv4O2A^#B%j!K2>}Yxa+lr&<*1FeOhjmsqYIG&=yB$$EWN@Wz;#IqA=PlTiHCqG% zyc$zwu4xNK^jQB8d&|WXspnYk9x>;+=#>xCr7g~}tj*(p^S43OrO`syaPHZK(!O`{ s!>8ecOsb+Okyp0=FX~R)=lZi#66g;GPgg&ebxsLQ07P4TjsO4v diff --git a/src/Libraries/AvalonDock/Resources/images/PinAutoHide.png b/src/Libraries/AvalonDock/Resources/images/PinAutoHide.png deleted file mode 100644 index 7a968a25eaa72a54e18ec873a57e0c93c4a7a6bd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 99 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uAB#T}@sR2@2o-U3d6}OU86qpTyyf4=~y(-8| vaxqRgl6gq1NFwXw(aZHQpPHS8{TLX+ZTR_4&-N$>>SFM8^>bP0l+XkK*m@l0 diff --git a/src/Libraries/AvalonDock/Resources/images/PinClose.png b/src/Libraries/AvalonDock/Resources/images/PinClose.png deleted file mode 100644 index 1bd384e1142c268302f39d65197f6c9e0ef40256..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 108 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uAB#T}@sR2^Po-U3d6}OU86qpTyR=u>BYYuoK z@zL{20-l$p00i_>zopr E01vewjQ{`u diff --git a/src/Libraries/AvalonDock/Resources/images/PinDocMenu.png b/src/Libraries/AvalonDock/Resources/images/PinDocMenu.png deleted file mode 100644 index 35b3fef68e18e9cbad978fa2da452116f76a9d83..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 99 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uAB#T}@sR2@2o-U3d6}OU86qpV8W-R-EWX1BX wWsdLEYosI%C0I<19zA(*p<`iN-9mN-w?sC+EfdQ4fVvnwUHx3vIVCg!0QDaofdBvi diff --git a/src/Libraries/AvalonDock/Resources/images/PinMenu.png b/src/Libraries/AvalonDock/Resources/images/PinMenu.png deleted file mode 100644 index ebad71bee8796c6ccfa67ec43943075c4a1e0c93..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 99 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uAB#T}@sR2@2o-U3d6}OU86qpV8bbbGK2KJv_ v_Wy^;gW`MjF;W~qU)t-LI_sRsT+YexxtWFU{qv%eKwS);u6{1-oD!M<9+MxI diff --git a/src/Libraries/AvalonDock/Resources/images/VTabGroup.png b/src/Libraries/AvalonDock/Resources/images/VTabGroup.png deleted file mode 100644 index c3f279f7d7ac7b6ef8381388fb79afd790dd8d65..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 403 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1SBVD?P>#3Iwh_VCC){ui6xo&c?uz!xv31f ziA4%VCJJE6z`#<$(A>(%#LCoCLEFI4z+ldYw-rEr>?NMQuIx9NB?Kh-yvvSu0EIXU zJR*x37`TN%nDNrxx<5ccmUKs7M+SzC{oH>NS%Lglo-U3d6}NIP82T|g@~{S|&zdCS zu_dNi`a(c(U_ju7C66RJq7@Vsv-})R$_j{j-B^+^@y6Euxo=nmF7|Bgo&T>Y#ed!V z=`LR^f2`WRZu`~t()Xt~KRztwec|fMgKsaV>_2`_YO|!%>=_qlx4-+(a4UrQz1;lT z?R|cFvn-b0t%~glxhl4t;opfKwsVrcI!q_;HOHJ~zm_pOLV@XQTyIFN2!C!;=XMJd zyB#z7_jGRCutIC|ah?M%ovQbLO4D{H?=?Pol;GCnVx*>@_?*9@MnelF{r5}E*8VV&6k diff --git a/src/Libraries/AvalonDock/WindowInteropWrapper.cs b/src/Libraries/AvalonDock/WindowInteropWrapper.cs deleted file mode 100644 index b02519263d..0000000000 --- a/src/Libraries/AvalonDock/WindowInteropWrapper.cs +++ /dev/null @@ -1,146 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Interop; -using System.Runtime.InteropServices; -using System.Diagnostics; - -namespace AvalonDock -{ - class WindowInteropWrapper : IDisposable - { - public WindowInteropWrapper() - { - } - - DependencyObject _attachedObject; - - public DependencyObject AttachedObject - { - get {return _attachedObject;} - set - { - if (_attachedObject != value) - { - if (_attachedObject != null) - { - _hwndSrc.RemoveHook(_hwndSrcHook); - //_hwndSrc.Dispose(); - _hwndSrc = null; - _hwndSrcHook = null; - } - - _attachedObject = value; - - if (_attachedObject != null) - { - _hwndSrc = HwndSource.FromDependencyObject(value) as HwndSource; - _hwndSrcHook = new HwndSourceHook(this.HookHandler); - _hwndSrc.AddHook(_hwndSrcHook); - } - } - } - } - - HwndSource _hwndSrc = null; - HwndSourceHook _hwndSrcHook = null; - - #region interop funtions and consts - const int WM_NCACTIVATE = 0x86; - const int WM_ACTIVATEAPP = 0x1c; - const int WM_ACTIVATE = 6; - const int WM_WINDOWPOSCHANGING = 70; - const int WM_WINDOWPOSCHANGED = 0x47; - const int WM_MOVE = 0x0003; - const int WM_SIZE = 0x0005; - const int WM_NCMOUSEMOVE = 0xa0; - const int WM_NCLBUTTONDOWN = 0xA1; - const int WM_NCLBUTTONUP = 0xA2; - const int WM_NCLBUTTONDBLCLK = 0xA3; - const int WM_NCRBUTTONDOWN = 0xA4; - const int WM_NCRBUTTONUP = 0xA5; - const int HTCAPTION = 2; - const int SC_MOVE = 0xF010; - const int WM_SYSCOMMAND = 0x0112; - - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - public static extern IntPtr SendMessage(HandleRef hWnd, int msg, IntPtr wParam, IntPtr lParam); - - [DllImport("user32.dll")] - public static extern bool LockWindowUpdate(IntPtr hWndLock); - - #endregion - - private IntPtr HookHandler( - IntPtr hwnd, - int msg, - IntPtr wParam, - IntPtr lParam, - ref bool handled - ) - { - handled = false; - - switch (msg) - { - case SC_MOVE: - case WM_WINDOWPOSCHANGING: - SafeFireEvent(OnWindowPosChanging, EventArgs.Empty); - break; - } - - return IntPtr.Zero; - } - - public event EventHandler OnWindowPosChanging; - - - void SafeFireEvent(EventHandler eventToFireup, EventArgs e) - { - if (AttachedObject != null && - PresentationSource.FromDependencyObject(AttachedObject) != null) - { - if (eventToFireup != null) - eventToFireup(this, e); - } - } - - - #region IDisposable Members - - public void Dispose() - { - AttachedObject = null; - GC.SuppressFinalize(this); - } - - #endregion - } -} diff --git a/src/Libraries/AvalonDock/WpfApplication.cs b/src/Libraries/AvalonDock/WpfApplication.cs deleted file mode 100644 index 193b970f45..0000000000 --- a/src/Libraries/AvalonDock/WpfApplication.cs +++ /dev/null @@ -1,96 +0,0 @@ -//Copyright (c) 2007-2009, Adolfo Marinucci -//All rights reserved. - -//Redistribution and use in source and binary forms, with or without modification, -//are permitted provided that the following conditions are met: -// -//* Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -//* Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -//* Neither the name of Adolfo Marinucci nor the names of its contributors may -// be used to endorse or promote products derived from this software without -// specific prior written permission. -// -//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -//AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -//IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -//HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -//OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -//EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Windows; -using System.Windows.Threading; - - - -namespace AvalonDock -{ - - /// - /// Designates a Windows Presentation Foundation application model with added functionalities. - /// - class WpfApplication : Application - { - - private static DispatcherOperationCallback exitFrameCallback = new - DispatcherOperationCallback(ExitFrame); - - - - /// - /// Processes all UI messages currently in the message queue. - /// - public static void DoEvents() - { - - // Create new nested message pump. - DispatcherFrame nestedFrame = new DispatcherFrame(); - - - - // Dispatch a callback to the current message queue, when getting called, - // this callback will end the nested message loop. - // note that the priority of this callback should be lower than the that of UI event messages. - DispatcherOperation exitOperation = Dispatcher.CurrentDispatcher.BeginInvoke( - DispatcherPriority.Background, exitFrameCallback, nestedFrame); - - - - // pump the nested message loop, the nested message loop will - // immediately process the messages left inside the message queue. - Dispatcher.PushFrame(nestedFrame); - - - - // If the "exitFrame" callback doesn't get finished, Abort it. - if (exitOperation.Status != DispatcherOperationStatus.Completed) - { - exitOperation.Abort(); - } - - } - - - - private static Object ExitFrame(Object state) - { - DispatcherFrame frame = state as DispatcherFrame; - - - // Exit the nested message loop. - frame.Continue = false; - - return null; - - } - - } - -} - diff --git a/src/Libraries/AvalonDock/doc/AvalonDock.shfb b/src/Libraries/AvalonDock/doc/AvalonDock.shfb deleted file mode 100644 index 23e6041ab1..0000000000 --- a/src/Libraries/AvalonDock/doc/AvalonDock.shfb +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - Summary, Parameter, Returns, AutoDocumentCtors, Namespace, TypeParameter - InheritedMembers, InheritedFrameworkMembers, Protected, SealedProtected - - - .\Help\ - - - True - True - - HtmlHelp1x - False - 3.5 - False - False - False - - AvalonDock Library Documentation - AvalonDock - en-US - http://www.codeplex.com/AvalonDock/license - (C)2008 Adolfo Marinucci - - - - - Local - Msdn - Blank - Prototype - Guid - Standard - False - True - False - Hierarchical - True - ms.vsipcc+, ms.vsexpresscc+ - 1.0.0.0 - AboveNamespaces - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/themes/aero.normalcolor.brushes.xaml b/src/Libraries/AvalonDock/themes/aero.normalcolor.brushes.xaml deleted file mode 100644 index 673e70395e..0000000000 --- a/src/Libraries/AvalonDock/themes/aero.normalcolor.brushes.xaml +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/themes/aero.normalcolor.xaml b/src/Libraries/AvalonDock/themes/aero.normalcolor.xaml deleted file mode 100644 index e1bdd0dc5f..0000000000 --- a/src/Libraries/AvalonDock/themes/aero.normalcolor.xaml +++ /dev/null @@ -1,621 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/themes/classic.brushes.xaml b/src/Libraries/AvalonDock/themes/classic.brushes.xaml deleted file mode 100644 index 45b2989ca3..0000000000 --- a/src/Libraries/AvalonDock/themes/classic.brushes.xaml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/themes/classic.xaml b/src/Libraries/AvalonDock/themes/classic.xaml deleted file mode 100644 index b925e76c86..0000000000 --- a/src/Libraries/AvalonDock/themes/classic.xaml +++ /dev/null @@ -1,548 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/themes/classic2.xaml b/src/Libraries/AvalonDock/themes/classic2.xaml deleted file mode 100644 index 9f17426088..0000000000 --- a/src/Libraries/AvalonDock/themes/classic2.xaml +++ /dev/null @@ -1,548 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Libraries/AvalonDock/themes/generic.xaml b/src/Libraries/AvalonDock/themes/generic.xaml deleted file mode 100644 index 6e2f3c6cfe..0000000000 --- a/src/Libraries/AvalonDock/themes/generic.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/Libraries/AvalonDock/themes/luna.normalcolor.xaml b/src/Libraries/AvalonDock/themes/luna.normalcolor.xaml deleted file mode 100644 index b51c454551..0000000000 --- a/src/Libraries/AvalonDock/themes/luna.normalcolor.xaml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file