diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d3214a7
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,26 @@
+build/
+*.suo
+*.user
+_ReSharper*
+*.csproj.user
+*.resharper.user
+*.userprefs
+*.suo
+*.cache
+*.trx
+*.pidb
+Thumbs.db
+[Bb]in
+[Dd]ebug
+[Oo]bj
+[Rr]elease
+[Tt]est[Rr]esult*
+_UpgradeReport_Files
+*[Pp]ublish.xml
+*.project
+*.metadata
+logs
+*.generated.cs
+T4MVC.cs
+/SharpSnmpLib/sharpsnmplib.snk
+/packages
\ No newline at end of file
diff --git a/WinFormsUI/Docking/DockContentHandler.cs b/WinFormsUI/Docking/DockContentHandler.cs
index 42c45e9..6362cc2 100644
--- a/WinFormsUI/Docking/DockContentHandler.cs
+++ b/WinFormsUI/Docking/DockContentHandler.cs
@@ -258,6 +258,7 @@ namespace WeifenLuo.WinFormsUI.Docking
Form.FormBorderStyle = FormBorderStyle.None;
Form.ShowInTaskbar = false;
Form.WindowState = FormWindowState.Normal;
+ if (!Win32Helper.IsRunningOnMono())
NativeMethods.SetWindowPos(Form.Handle, IntPtr.Zero, 0, 0, 0, 0,
Win32.FlagsSetWindowPos.SWP_NOACTIVATE |
Win32.FlagsSetWindowPos.SWP_NOMOVE |
@@ -513,6 +514,7 @@ namespace WeifenLuo.WinFormsUI.Docking
if (Form.ContainsFocus)
if (DockState == DockState.Hidden || DockState == DockState.Unknown)
+ if (!Win32Helper.IsRunningOnMono())
DockPanel.ContentFocusManager.GiveUpFocus(Content);
SetPaneAndVisible(Pane);
@@ -533,8 +535,10 @@ namespace WeifenLuo.WinFormsUI.Docking
{
if (DockState == DockState.Hidden || DockState == DockState.Unknown ||
DockHelper.IsDockStateAutoHide(DockState))
+ if (!Win32Helper.IsRunningOnMono())
DockPanel.ContentFocusManager.RemoveFromList(Content);
else
+ if (!Win32Helper.IsRunningOnMono())
DockPanel.ContentFocusManager.AddToList(Content);
OnDockStateChanged(EventArgs.Empty);
@@ -641,12 +645,14 @@ namespace WeifenLuo.WinFormsUI.Docking
DockPanel.ActiveAutoHideContent = Content;
if (!Form.ContainsFocus)
+ if (!Win32Helper.IsRunningOnMono())
DockPanel.ContentFocusManager.Activate(Content);
}
}
public void GiveUpFocus()
{
+ if (!Win32Helper.IsRunningOnMono())
DockPanel.ContentFocusManager.GiveUpFocus(Content);
}
@@ -725,6 +731,7 @@ namespace WeifenLuo.WinFormsUI.Docking
{
//Suggested as a fix for a memory leak by bugreports
if (value == null && !IsFloat)
+ if (!Win32Helper.IsRunningOnMono())
DockPanel.ContentFocusManager.GiveUpFocus(this.Content);
else
{
diff --git a/WinFormsUI/Docking/DockPane.cs b/WinFormsUI/Docking/DockPane.cs
index 6f0977f..6d902db 100644
--- a/WinFormsUI/Docking/DockPane.cs
+++ b/WinFormsUI/Docking/DockPane.cs
@@ -911,6 +911,7 @@ namespace WeifenLuo.WinFormsUI.Docking
FloatWindow = DockPanel.FloatWindowFactory.CreateFloatWindow(DockPanel, this);
if (contentFocused != null)
+ if (!Win32Helper.IsRunningOnMono())
DockPanel.ContentFocusManager.Activate(contentFocused);
ResumeRefreshStateChange(oldContainer, oldDockState);
diff --git a/WinFormsUI/Docking/DockPanel.AutoHideWindow.cs b/WinFormsUI/Docking/DockPanel.AutoHideWindow.cs
index b3afc20..5a5375c 100644
--- a/WinFormsUI/Docking/DockPanel.AutoHideWindow.cs
+++ b/WinFormsUI/Docking/DockPanel.AutoHideWindow.cs
@@ -102,6 +102,7 @@ namespace WeifenLuo.WinFormsUI.Docking
if (m_activeContent != null)
{
if (m_activeContent.DockHandler.Form.ContainsFocus)
+ if (!Win32Helper.IsRunningOnMono())
DockPanel.ContentFocusManager.GiveUpFocus(m_activeContent);
AnimateWindow(false);
}
diff --git a/WinFormsUI/Docking/DockPanel.DragHandler.cs b/WinFormsUI/Docking/DockPanel.DragHandler.cs
index c77fbd6..580c28e 100644
--- a/WinFormsUI/Docking/DockPanel.DragHandler.cs
+++ b/WinFormsUI/Docking/DockPanel.DragHandler.cs
@@ -45,6 +45,7 @@ namespace WeifenLuo.WinFormsUI.Docking
StartMousePosition = Control.MousePosition;
+ if (!Win32Helper.IsRunningOnMono())
if (!NativeMethods.DragDetect(DragControl.Handle, StartMousePosition))
return false;
diff --git a/WinFormsUI/Docking/DockPanel.FocusManager.cs b/WinFormsUI/Docking/DockPanel.FocusManager.cs
index 66771f9..df4470d 100644
--- a/WinFormsUI/Docking/DockPanel.FocusManager.cs
+++ b/WinFormsUI/Docking/DockPanel.FocusManager.cs
@@ -124,6 +124,10 @@ namespace WeifenLuo.WinFormsUI.Docking
public FocusManagerImpl(DockPanel dockPanel)
{
m_dockPanel = dockPanel;
+
+ if (Win32Helper.IsRunningOnMono())
+ return;
+
m_localWindowsHook = new LocalWindowsHook(Win32.HookType.WH_CALLWNDPROCRET);
m_hookEventHandler = new LocalWindowsHook.HookEventHandler(HookEventHandler);
m_localWindowsHook.HookInvoked += m_hookEventHandler;
@@ -143,6 +147,7 @@ namespace WeifenLuo.WinFormsUI.Docking
{
if (!m_disposed && disposing)
{
+ if (!Win32Helper.IsRunningOnMono())
m_localWindowsHook.Dispose();
m_disposed = true;
}
@@ -172,11 +177,13 @@ namespace WeifenLuo.WinFormsUI.Docking
if (handler.Form.IsDisposed)
return; // Should not reach here, but better than throwing an exception
if (ContentContains(content, handler.ActiveWindowHandle))
+ if (!Win32Helper.IsRunningOnMono())
NativeMethods.SetFocus(handler.ActiveWindowHandle);
if (!handler.Form.ContainsFocus)
{
if (!handler.Form.SelectNextControl(handler.Form.ActiveControl, true, true, true, true))
// Since DockContent Form is not selectalbe, use Win32 SetFocus instead
+ if (!Win32Helper.IsRunningOnMono())
NativeMethods.SetFocus(handler.Form.Handle);
}
}
@@ -285,6 +292,7 @@ namespace WeifenLuo.WinFormsUI.Docking
public void SuspendFocusTracking()
{
m_countSuspendFocusTracking++;
+ if (!Win32Helper.IsRunningOnMono())
m_localWindowsHook.HookInvoked -= m_hookEventHandler;
}
@@ -300,6 +308,7 @@ namespace WeifenLuo.WinFormsUI.Docking
Activate(ContentActivating);
ContentActivating = null;
}
+ if (!Win32Helper.IsRunningOnMono())
m_localWindowsHook.HookInvoked += m_hookEventHandler;
if (!InRefreshActiveWindow)
RefreshActiveWindow();
@@ -390,7 +399,7 @@ namespace WeifenLuo.WinFormsUI.Docking
private void SetActivePane()
{
- DockPane value = GetPaneFromHandle(NativeMethods.GetFocus());
+ DockPane value = Win32Helper.IsRunningOnMono() ? null : GetPaneFromHandle(NativeMethods.GetFocus());
if (m_activePane == value)
return;
diff --git a/WinFormsUI/Docking/DockPanel.MdiClientController.cs b/WinFormsUI/Docking/DockPanel.MdiClientController.cs
index 2bba932..001cdef 100644
--- a/WinFormsUI/Docking/DockPanel.MdiClientController.cs
+++ b/WinFormsUI/Docking/DockPanel.MdiClientController.cs
@@ -87,6 +87,8 @@ namespace WeifenLuo.WinFormsUI.Docking
// "Adding designable borders to user controls".
// http://www.codeproject.com/cs/miscctrl/CsAddingBorders.asp
+ if (!Win32Helper.IsRunningOnMono())
+ {
// Get styles using Win32 calls
int style = NativeMethods.GetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_STYLE);
int exStyle = NativeMethods.GetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_EXSTYLE);
@@ -113,7 +115,7 @@ namespace WeifenLuo.WinFormsUI.Docking
// Set the styles using Win32 calls
NativeMethods.SetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_STYLE, style);
NativeMethods.SetWindowLong(MdiClient.Handle, (int)Win32.GetWindowLongIndex.GWL_EXSTYLE, exStyle);
-
+ }
// Cause an update of the non-client area.
UpdateStyles();
}
@@ -232,6 +234,7 @@ namespace WeifenLuo.WinFormsUI.Docking
// If AutoScroll is set to false, hide the scrollbars when the control
// calculates its non-client area.
if (!AutoScroll)
+ if (!Win32Helper.IsRunningOnMono())
NativeMethods.ShowScrollBar(m.HWnd, (int)Win32.ScrollBars.SB_BOTH, 0 /*false*/);
break;
}
@@ -320,6 +323,7 @@ namespace WeifenLuo.WinFormsUI.Docking
// To show style changes, the non-client area must be repainted. Using the
// control's Invalidate method does not affect the non-client area.
// Instead use a Win32 call to signal the style has changed.
+ if (!Win32Helper.IsRunningOnMono())
NativeMethods.SetWindowPos(MdiClient.Handle, IntPtr.Zero, 0, 0, 0, 0,
Win32.FlagsSetWindowPos.SWP_NOACTIVATE |
Win32.FlagsSetWindowPos.SWP_NOMOVE |
diff --git a/WinFormsUI/Docking/DockPanel.Persistor.cs b/WinFormsUI/Docking/DockPanel.Persistor.cs
index 264b861..9006a97 100644
--- a/WinFormsUI/Docking/DockPanel.Persistor.cs
+++ b/WinFormsUI/Docking/DockPanel.Persistor.cs
@@ -252,8 +252,11 @@ namespace WeifenLuo.WinFormsUI.Docking
xmlOut.WriteAttributeString("DockRightPortion", dockPanel.DockRightPortion.ToString(CultureInfo.InvariantCulture));
xmlOut.WriteAttributeString("DockTopPortion", dockPanel.DockTopPortion.ToString(CultureInfo.InvariantCulture));
xmlOut.WriteAttributeString("DockBottomPortion", dockPanel.DockBottomPortion.ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteAttributeString("ActiveDocumentPane", dockPanel.Panes.IndexOf(dockPanel.ActiveDocumentPane).ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteAttributeString("ActivePane", dockPanel.Panes.IndexOf(dockPanel.ActivePane).ToString(CultureInfo.InvariantCulture));
+ if (!Win32Helper.IsRunningOnMono())
+ {
+ xmlOut.WriteAttributeString("ActiveDocumentPane", dockPanel.Panes.IndexOf(dockPanel.ActiveDocumentPane).ToString(CultureInfo.InvariantCulture));
+ xmlOut.WriteAttributeString("ActivePane", dockPanel.Panes.IndexOf(dockPanel.ActivePane).ToString(CultureInfo.InvariantCulture));
+ }
// Contents
xmlOut.WriteStartElement("Contents");
diff --git a/WinFormsUI/Docking/DockPanel.cs b/WinFormsUI/Docking/DockPanel.cs
index fbaff89..5f0ca6a 100644
--- a/WinFormsUI/Docking/DockPanel.cs
+++ b/WinFormsUI/Docking/DockPanel.cs
@@ -170,24 +170,47 @@ namespace WeifenLuo.WinFormsUI.Docking
set { AutoHideWindow.ActiveContent = value; }
}
- private bool m_allowEndUserDocking = true;
+ private bool m_allowEndUserDocking = !Win32Helper.IsRunningOnMono();
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockPanel_AllowEndUserDocking_Description")]
[DefaultValue(true)]
public bool AllowEndUserDocking
{
- get { return m_allowEndUserDocking; }
- set { m_allowEndUserDocking = value; }
+ get
+ {
+ if (Win32Helper.IsRunningOnMono() && m_allowEndUserDocking)
+ m_allowEndUserDocking = false;
+
+ return m_allowEndUserDocking;
+ }
+ set
+ {
+ if (Win32Helper.IsRunningOnMono() && value)
+ throw new InvalidOperationException("AllowEndUserDocking can only be false if running on Mono");
+
+ m_allowEndUserDocking = value;
+ }
}
- private bool m_allowEndUserNestedDocking = true;
+ private bool m_allowEndUserNestedDocking = !Win32Helper.IsRunningOnMono();
[LocalizedCategory("Category_Docking")]
[LocalizedDescription("DockPanel_AllowEndUserNestedDocking_Description")]
[DefaultValue(true)]
public bool AllowEndUserNestedDocking
{
- get { return m_allowEndUserNestedDocking; }
- set { m_allowEndUserNestedDocking = value; }
+ get
+ {
+ if (Win32Helper.IsRunningOnMono() && m_allowEndUserDocking)
+ m_allowEndUserDocking = false;
+ return m_allowEndUserNestedDocking;
+ }
+ set
+ {
+ if (Win32Helper.IsRunningOnMono() && value)
+ throw new InvalidOperationException("AllowEndUserNestedDocking can only be false if running on Mono");
+
+ m_allowEndUserNestedDocking = value;
+ }
}
private DockContentCollection m_contents = new DockContentCollection();
@@ -1038,4 +1061,4 @@ namespace WeifenLuo.WinFormsUI.Docking
handler(this, e);
}
}
-}
\ No newline at end of file
+}
diff --git a/WinFormsUI/Docking/DragForm.cs b/WinFormsUI/Docking/DragForm.cs
index 085df4f..a0e70fd 100644
--- a/WinFormsUI/Docking/DragForm.cs
+++ b/WinFormsUI/Docking/DragForm.cs
@@ -58,6 +58,7 @@ namespace WeifenLuo.WinFormsUI.Docking
if (bActivate)
Show();
else
+ if (!Win32Helper.IsRunningOnMono())
NativeMethods.ShowWindow(Handle, (int)Win32.ShowWindowStyles.SW_SHOWNOACTIVATE);
}
}
diff --git a/WinFormsUI/Docking/FloatWindow.cs b/WinFormsUI/Docking/FloatWindow.cs
index 2384ae9..616de65 100644
--- a/WinFormsUI/Docking/FloatWindow.cs
+++ b/WinFormsUI/Docking/FloatWindow.cs
@@ -176,7 +176,7 @@ namespace WeifenLuo.WinFormsUI.Docking
if (IsDisposed)
return;
- uint result = NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
+ uint result = Win32Helper.IsRunningOnMono() ? 0 : NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
if (result == 2 && DockPanel.AllowEndUserDocking && this.AllowEndUserDocking) // HITTEST_CAPTION
{
Activate();
@@ -189,7 +189,7 @@ namespace WeifenLuo.WinFormsUI.Docking
}
else if (m.Msg == (int)Win32.Msgs.WM_NCRBUTTONDOWN)
{
- uint result = NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
+ uint result = Win32Helper.IsRunningOnMono() ? 0 : NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
if (result == 2) // HITTEST_CAPTION
{
DockPane theOnlyPane = (VisibleNestedPanes.Count == 1) ? VisibleNestedPanes[0] : null;
@@ -234,7 +234,7 @@ namespace WeifenLuo.WinFormsUI.Docking
}
else if (m.Msg == (int)Win32.Msgs.WM_NCLBUTTONDBLCLK)
{
- uint result = NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
+ uint result = Win32Helper.IsRunningOnMono() ? 0: NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
if (result != 2) // HITTEST_CAPTION
{
base.WndProc(ref m);
@@ -314,6 +314,7 @@ namespace WeifenLuo.WinFormsUI.Docking
Point ptMouse = Control.MousePosition;
uint lParam = Win32Helper.MakeLong(ptMouse.X, ptMouse.Y);
+ if (!Win32Helper.IsRunningOnMono())
if (NativeMethods.SendMessage(Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, lParam) == (uint)Win32.HitTest.HTCAPTION)
dockOutline.Show(VisibleNestedPanes[0], -1);
}
diff --git a/WinFormsUI/Docking/Helpers/DockHelper.cs b/WinFormsUI/Docking/Helpers/DockHelper.cs
index 624fe17..4f7c399 100644
--- a/WinFormsUI/Docking/Helpers/DockHelper.cs
+++ b/WinFormsUI/Docking/Helpers/DockHelper.cs
@@ -74,6 +74,7 @@ namespace WeifenLuo.WinFormsUI.Docking
public static DockPane PaneAtPoint(Point pt, DockPanel dockPanel)
{
+ if (!Win32Helper.IsRunningOnMono())
for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent)
{
IDockContent content = control as IDockContent;
@@ -90,6 +91,7 @@ namespace WeifenLuo.WinFormsUI.Docking
public static FloatWindow FloatWindowAtPoint(Point pt, DockPanel dockPanel)
{
+ if (!Win32Helper.IsRunningOnMono())
for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent)
{
FloatWindow floatWindow = control as FloatWindow;
diff --git a/WinFormsUI/Docking/Helpers/Win32Helper.cs b/WinFormsUI/Docking/Helpers/Win32Helper.cs
index bc54d03..89d2a88 100644
--- a/WinFormsUI/Docking/Helpers/Win32Helper.cs
+++ b/WinFormsUI/Docking/Helpers/Win32Helper.cs
@@ -4,16 +4,21 @@ using System.Windows.Forms;
namespace WeifenLuo.WinFormsUI.Docking
{
- internal static class Win32Helper
+ public static class Win32Helper
{
- public static Control ControlAtPoint(Point pt)
- {
- return Control.FromChildHandle(NativeMethods.WindowFromPoint(pt));
+ internal static Control ControlAtPoint(Point pt)
+ {
+ return Control.FromChildHandle(NativeMethods.WindowFromPoint(pt));
}
- public static uint MakeLong(int low, int high)
+ internal static uint MakeLong(int low, int high)
{
return (uint)((high << 16) + low);
}
+
+ public static bool IsRunningOnMono()
+ {
+ return Type.GetType ("Mono.Runtime") != null;
+ }
}
}
diff --git a/WinFormsUI/Docking/NestedPaneCollection.cs b/WinFormsUI/Docking/NestedPaneCollection.cs
index 2118808..55307e1 100644
--- a/WinFormsUI/Docking/NestedPaneCollection.cs
+++ b/WinFormsUI/Docking/NestedPaneCollection.cs
@@ -56,6 +56,7 @@ namespace WeifenLuo.WinFormsUI.Docking
{
FloatWindow floatWindow = (FloatWindow)Container;
if (!floatWindow.Disposing && !floatWindow.IsDisposed)
+ if (!Win32Helper.IsRunningOnMono())
NativeMethods.PostMessage(((FloatWindow)Container).Handle, FloatWindow.WM_CHECKDISPOSE, 0, 0);
}
}
diff --git a/WinFormsUI/Docking/Resources.resx b/WinFormsUI/Docking/Resources.resx
index bd5a077..fa16395 100644
--- a/WinFormsUI/Docking/Resources.resx
+++ b/WinFormsUI/Docking/Resources.resx
@@ -125,13 +125,13 @@
Resources\DockIndicator_PaneDiamond_Bottom.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
- Resources\DockIndicator_PaneDiamond_Fill.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+ Resources\Dockindicator_PaneDiamond_Fill.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
- Resources\DockIndicator_PaneDiamond_HotSpot.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+ Resources\DockIndicator_PaneDiamond_Hotspot.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
- Resources\DockIndicator_PaneDiamond_HotSpotIndex.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+ Resources\DockIndicator_PaneDiamond_HotspotIndex.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Resources\DockIndicator_PaneDiamond_Left.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
@@ -187,4 +187,4 @@
Resources\DockPane_OptionOverflow.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
\ No newline at end of file
+
diff --git a/WinFormsUI/WinFormsUI.csproj b/WinFormsUI/WinFormsUI.csproj
index 62e15f3..877209e 100644
--- a/WinFormsUI/WinFormsUI.csproj
+++ b/WinFormsUI/WinFormsUI.csproj
@@ -1,4 +1,5 @@
-
+
+
Debug
AnyCPU
@@ -9,9 +10,10 @@
Properties
WeifenLuo.WinFormsUI
WeifenLuo.WinFormsUI.Docking
- false
-
-
+ true
+ dockpanelsuite.snk
+ False
+ File
true
@@ -180,6 +182,7 @@
+
Always
@@ -194,7 +197,7 @@
-
+
-
\ No newline at end of file
+
diff --git a/WinFormsUI/dockpanelsuite.snk b/WinFormsUI/dockpanelsuite.snk
new file mode 100644
index 0000000..39a8b18
Binary files /dev/null and b/WinFormsUI/dockpanelsuite.snk differ