diff --git a/AddIns/ICSharpCode.SharpDevelop.addin b/AddIns/ICSharpCode.SharpDevelop.addin
index 547495fc42..e8cd20223a 100644
--- a/AddIns/ICSharpCode.SharpDevelop.addin
+++ b/AddIns/ICSharpCode.SharpDevelop.addin
@@ -74,73 +74,84 @@
title = "${res:MainWindow.Windows.ProjectScoutLabel}"
icon = "PadIcons.ProjectBrowser"
shortcut = "Control|Alt|L"
- class = "ICSharpCode.SharpDevelop.Project.ProjectBrowserPad"/>
+ class = "ICSharpCode.SharpDevelop.Project.ProjectBrowserPad"
+ defaultPosition = "Left" />
+ class = "ICSharpCode.SharpDevelop.Gui.ClassBrowser.ClassBrowserPad"
+ defaultPosition = "Right" />
+ class = "ICSharpCode.SharpDevelop.Gui.ToolsPad"
+ defaultPosition = "Left" />
+ class = "ICSharpCode.SharpDevelop.Gui.ErrorListPad"
+ defaultPosition = "Bottom" />
+ class = "ICSharpCode.SharpDevelop.Gui.TaskListPad"
+ defaultPosition = "Bottom" />
+ class = "ICSharpCode.SharpDevelop.Gui.CompilerMessageView"
+ defaultPosition = "Bottom" />
+ class = "ICSharpCode.SharpDevelop.Gui.PropertyPad"
+ defaultPosition = "Right" />
+ class = "ICSharpCode.SharpDevelop.Gui.FileScout"
+ defaultPosition = "Left, Hidden" />
+ class = "SearchAndReplace.SearchResultPanel"
+ defaultPosition = "Bottom, Hidden" />
+ class = "ICSharpCode.SharpDevelop.Bookmarks.BookmarkPad"
+ defaultPosition = "Bottom, Hidden" />
+ class = "ICSharpCode.SharpDevelop.Gui.DefinitionViewPad"
+ defaultPosition = "Bottom, Hidden" />
@@ -943,7 +954,7 @@
-
+
@@ -1432,7 +1443,11 @@
class = "ICSharpCode.SharpDevelop.Project.Commands.PublishProject"/>-->
-
+
-
+
-
+
diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.fsproj b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.fsproj
index ffc8d8dfe5..bf7bdc848b 100644
--- a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.fsproj
+++ b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.fsproj
@@ -39,10 +39,19 @@
3.5
False
+
..\..\..\..\..\Libraries\Mono.Cecil\Mono.Cecil.dll
False
+
+
+ 3.0
+ False
+
+
+ 3.0
+
False
@@ -50,9 +59,17 @@
3.5
False
+
False
+
+ 3.0
+
+
+ 3.0
+
+
@@ -75,11 +92,6 @@
-
- {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}
- WinFormsUI
- False
-
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}
ICSharpCode.TextEditor
diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsolePad.cs b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsolePad.cs
index 19bbbcf6c7..221cae2b9b 100644
--- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsolePad.cs
+++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonConsolePad.cs
@@ -29,7 +29,7 @@ namespace ICSharpCode.PythonBinding
host.Run();
}
- public override Control Control {
+ public override object Content {
get { return textEditorControl; }
}
diff --git a/src/AddIns/BackendBindings/WixBinding/Project/Src/Commands/AddWixExtensionToProject.cs b/src/AddIns/BackendBindings/WixBinding/Project/Src/Commands/AddWixExtensionToProject.cs
index dbb5bfc748..2f728de1b8 100644
--- a/src/AddIns/BackendBindings/WixBinding/Project/Src/Commands/AddWixExtensionToProject.cs
+++ b/src/AddIns/BackendBindings/WixBinding/Project/Src/Commands/AddWixExtensionToProject.cs
@@ -25,7 +25,7 @@ namespace ICSharpCode.WixBinding
// Display file dialog.
using (OpenFileDialog fileDialog = CreateOpenFileDialog()) {
- if (DialogResult.OK == fileDialog.ShowDialog(WorkbenchSingleton.MainForm)) {
+ if (DialogResult.OK == fileDialog.ShowDialog(WorkbenchSingleton.MainWin32Window)) {
// Add files to project.
WixProject project = ((WixProject)folderNode.Project);
project.AddWixExtensions(fileDialog.FileNames);
diff --git a/src/AddIns/BackendBindings/WixBinding/Project/Src/Commands/AddWixItemToProjectBaseCommand.cs b/src/AddIns/BackendBindings/WixBinding/Project/Src/Commands/AddWixItemToProjectBaseCommand.cs
index 10a2271874..8d50a5c021 100644
--- a/src/AddIns/BackendBindings/WixBinding/Project/Src/Commands/AddWixItemToProjectBaseCommand.cs
+++ b/src/AddIns/BackendBindings/WixBinding/Project/Src/Commands/AddWixItemToProjectBaseCommand.cs
@@ -39,7 +39,7 @@ namespace ICSharpCode.WixBinding
// Display file dialog.
using (OpenFileDialog fileDialog = CreateOpenFileDialog(FileFilter)) {
- if (DialogResult.OK == fileDialog.ShowDialog(WorkbenchSingleton.MainForm)) {
+ if (DialogResult.OK == fileDialog.ShowDialog(WorkbenchSingleton.MainWin32Window)) {
// Add files to project.
WixProject project = ((WixProject)folderNode.Project);
AddFiles(project, fileDialog.FileNames);
diff --git a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/PackageFilesView.cs b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/PackageFilesView.cs
index 0aa75495fc..83f371669d 100644
--- a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/PackageFilesView.cs
+++ b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/PackageFilesView.cs
@@ -31,7 +31,7 @@ namespace ICSharpCode.WixBinding
WixProject project;
bool reload;
- public override Control Control {
+ public override object Content {
get {
return packageFilesControl;
}
diff --git a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/SetupDialogListPad.cs b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/SetupDialogListPad.cs
index faa71eef00..bee47ccfcc 100644
--- a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/SetupDialogListPad.cs
+++ b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/SetupDialogListPad.cs
@@ -45,7 +45,7 @@ namespace ICSharpCode.WixBinding
}
}
- public override Control Control {
+ public override object Content {
get {
return setupDialogListView;
}
diff --git a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesigner.cs b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesigner.cs
index 3d3b831c19..51c6899e28 100644
--- a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesigner.cs
+++ b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesigner.cs
@@ -314,7 +314,7 @@ namespace ICSharpCode.WixBinding
}
- public override System.Windows.Forms.Control ToolsControl {
+ public override object ToolsContent {
get {
return SetupDialogControlsToolBox;
}
diff --git a/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.addin b/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.addin
index b048039a79..38222765cc 100644
--- a/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.addin
+++ b/src/AddIns/BackendBindings/WixBinding/Project/WixBinding.addin
@@ -161,7 +161,8 @@
category = "Setup"
title = "${res:ICSharpCode.WixBinding.SetupDialogListPad.Title}"
icon = "Setup.Icons.16x16.SetupDialogsPad"
- class = "ICSharpCode.WixBinding.SetupDialogListPad"/>
+ class = "ICSharpCode.WixBinding.SetupDialogListPad"
+ defaultPosition = "Bottom, Hidden" />
diff --git a/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/ClassDiagramAddin.addin b/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/ClassDiagramAddin.addin
index fced2940ba..2f0d49b127 100644
--- a/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/ClassDiagramAddin.addin
+++ b/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/ClassDiagramAddin.addin
@@ -143,7 +143,8 @@
category = "Tools"
title = "Class Editor"
class = "ClassDiagramAddin.ClassEditorPad"
- icon = "ClassDiagram.ClassEditor" />
+ icon = "ClassDiagram.ClassEditor"
+ defaultPosition = "Right, Hidden" />
diff --git a/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/Src/ClassDiagramCommand.cs b/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/Src/ClassDiagramCommand.cs
index 2012feaa71..7d9cc133ec 100644
--- a/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/Src/ClassDiagramCommand.cs
+++ b/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/Src/ClassDiagramCommand.cs
@@ -18,7 +18,7 @@ namespace ClassDiagramAddin
{
protected ClassCanvas Canvas
{
- get { return (ClassCanvas)((ClassDiagramViewContent)this.Owner).Control; }
+ get { return (ClassCanvas)((ClassDiagramViewContent)this.Owner).Content; }
}
}
diff --git a/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/Src/ClassDiagramViewContent.cs b/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/Src/ClassDiagramViewContent.cs
index afaad0990a..b7aae61459 100644
--- a/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/Src/ClassDiagramViewContent.cs
+++ b/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/Src/ClassDiagramViewContent.cs
@@ -44,8 +44,7 @@ namespace ClassDiagramAddin
canvas.CanvasItemSelected += HandleItemSelected;
}
- public override Control Control
- {
+ public override object Content {
get { return canvas; }
}
@@ -138,13 +137,6 @@ namespace ClassDiagramAddin
}
}
- public override void RedrawContent()
- {
- // TODO: Refresh the whole view control here, renew all resource strings
- // Note that you do not need to recreate the control.
- base.RedrawContent();
- }
-
public override void Dispose()
{
ParserService.ParseInformationUpdated -= OnParseInformationUpdated;
@@ -165,7 +157,7 @@ namespace ClassDiagramAddin
PadDescriptor padDesc = WorkbenchSingleton.Workbench.GetPad(typeof(ClassEditorPad));
if (padDesc != null)
{
- ((ClassEditor)padDesc.PadContent.Control).SetClass(cci.RepresentedClassType);
+ ((ClassEditor)padDesc.PadContent.Content).SetClass(cci.RepresentedClassType);
}
}
}
diff --git a/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/Src/ClassEditorPad.cs b/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/Src/ClassEditorPad.cs
index 6502b4f2a9..6d7e0b4f6b 100644
--- a/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/Src/ClassEditorPad.cs
+++ b/src/AddIns/DisplayBindings/ClassDiagram/ClassDiagramAddin/Src/ClassEditorPad.cs
@@ -157,20 +157,11 @@ namespace ClassDiagramAddin
///
/// The representing the pad
///
- public override Control Control
+ public override object Content
{
get { return editor; }
}
- ///
- /// Refreshes the pad
- ///
- public override void RedrawContent()
- {
- // TODO: Refresh the whole pad control here, renew all resource strings whatever
- // Note that you do not need to recreate the control.
- }
-
///
/// Cleans up all used resources
///
diff --git a/src/AddIns/DisplayBindings/ClassDiagram/ClassWizard/Src/AddNewClassCommand.cs b/src/AddIns/DisplayBindings/ClassDiagram/ClassWizard/Src/AddNewClassCommand.cs
index 9299dd9f96..a718c52d78 100644
--- a/src/AddIns/DisplayBindings/ClassDiagram/ClassWizard/Src/AddNewClassCommand.cs
+++ b/src/AddIns/DisplayBindings/ClassDiagram/ClassWizard/Src/AddNewClassCommand.cs
@@ -27,7 +27,7 @@ namespace ClassWizard
using (AddClassForm form = new AddClassForm())
{
form.Owner = (Form) WorkbenchSingleton.Workbench;
- form.ShowDialog(WorkbenchSingleton.MainForm);
+ form.ShowDialog(WorkbenchSingleton.MainWin32Window);
}
}
}
diff --git a/src/AddIns/DisplayBindings/ClassDiagram/ClassWizard/Src/ClassesList.cs b/src/AddIns/DisplayBindings/ClassDiagram/ClassWizard/Src/ClassesList.cs
index 40fcc7f319..47a16ba9aa 100644
--- a/src/AddIns/DisplayBindings/ClassDiagram/ClassWizard/Src/ClassesList.cs
+++ b/src/AddIns/DisplayBindings/ClassDiagram/ClassWizard/Src/ClassesList.cs
@@ -7,14 +7,14 @@
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
+using ICSharpCode.SharpDevelop.Gui;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
-
using ICSharpCode.SharpDevelop;
-using ICSharpCode.SharpDevelop.Project;
-using ICSharpCode.SharpDevelop.Gui.XmlForms;
using ICSharpCode.SharpDevelop.Dom;
+using ICSharpCode.SharpDevelop.Gui.XmlForms;
+using ICSharpCode.SharpDevelop.Project;
namespace ClassWizard
{
@@ -147,7 +147,7 @@ namespace ClassWizard
initialized = true;
}
- classesList.ShowDialog();
+ classesList.ShowDialog(WorkbenchSingleton.MainWin32Window);
return classesList.DialogResult == DialogResult.OK;
}
diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Commands/SideBarCommands.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Commands/SideBarCommands.cs
index 1a93f32039..a1ab90ec07 100644
--- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Commands/SideBarCommands.cs
+++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Commands/SideBarCommands.cs
@@ -17,7 +17,7 @@ namespace ICSharpCode.FormsDesigner
public override void Run()
{
using (ConfigureSideBarDialog configureSideBarDialog = new ConfigureSideBarDialog()) {
- if (configureSideBarDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (configureSideBarDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
ToolboxProvider.ReloadSideTabs(true);
}
}
diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs
index f0f6c66c91..8cd3d2911c 100644
--- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs
+++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs
@@ -110,7 +110,7 @@ namespace ICSharpCode.FormsDesigner
// This is required on Vista, I don't know why it works correctly in XP
p.Font = Control.DefaultFont;
- this.UserControl = this.p;
+ this.UserContent = this.p;
this.resourceStore = new ResourceStore(this);
@@ -702,7 +702,7 @@ namespace ICSharpCode.FormsDesigner
UpdatePropertyPad();
}
- public virtual Control ToolsControl {
+ public virtual object ToolsContent {
get { return ToolboxProvider.FormsDesignerSideBar; }
}
diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/FormKeyHandler.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/FormKeyHandler.cs
index 06c0dc7f15..8a4bf520fb 100644
--- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/FormKeyHandler.cs
+++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/FormKeyHandler.cs
@@ -70,16 +70,13 @@ namespace ICSharpCode.FormsDesigner
return false;
}
- if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow == null ||
- !WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ActiveViewContent.Control.ContainsFocus) {
- return false;
- }
-
- FormsDesignerViewContent formDesigner = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ActiveViewContent as FormsDesignerViewContent;
+ FormsDesignerViewContent formDesigner = WorkbenchSingleton.Workbench.ActiveContent as FormsDesignerViewContent;
if (formDesigner == null || formDesigner.Host == null) {
return false;
}
+ if (!((Control)formDesigner.Content).ContainsFocus)
+ return false;
Keys keyPressed = (Keys)m.WParam.ToInt32() | Control.ModifierKeys;
diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs
index 57fa62526a..a03a250d8a 100644
--- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs
+++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Gui/AddComponentsDialog.cs
@@ -221,7 +221,7 @@ namespace ICSharpCode.FormsDesigner.Gui
fdiag.Multiselect = true;
fdiag.CheckFileExists = true;
- if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
ControlDictionary["fileNameTextBox"].Text = string.Join(";", fdiag.FileNames);
}
}
diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/UIService.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/UIService.cs
index f4b5e89042..d84fbe9ca5 100644
--- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/UIService.cs
+++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/UIService.cs
@@ -52,7 +52,7 @@ namespace ICSharpCode.FormsDesigner.Services
#region Dialog functions
public IWin32Window GetDialogOwnerWindow()
{
- return WorkbenchSingleton.MainForm;
+ return WorkbenchSingleton.MainWin32Window;
}
public DialogResult ShowDialog(Form form)
diff --git a/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditView.cs b/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditView.cs
index 2b33388003..96deff7979 100644
--- a/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditView.cs
+++ b/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditView.cs
@@ -28,7 +28,7 @@ namespace HexEditor.View
file.ForceInitializeView(this);
}
- public override System.Windows.Forms.Control Control {
+ public override object Content {
get { return hexEditContainer; }
}
diff --git a/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/Src/IconViewContent.cs b/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/Src/IconViewContent.cs
index aa2250fc4a..4dcbee55a8 100644
--- a/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/Src/IconViewContent.cs
+++ b/src/AddIns/DisplayBindings/IconEditor/IconEditorAddIn/Src/IconViewContent.cs
@@ -19,7 +19,7 @@ namespace ICSharpCode.IconEditorAddIn
{
EditorPanel editor = new EditorPanel();
- public override Control Control {
+ public override object Content {
get {
return editor;
}
diff --git a/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/Commands/AddNewFileCommand.cs b/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/Commands/AddNewFileCommand.cs
index 8a31ef65e5..bfc2bc6017 100644
--- a/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/Commands/AddNewFileCommand.cs
+++ b/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/Commands/AddNewFileCommand.cs
@@ -32,7 +32,7 @@ namespace ResourceEditor
fdiag.Multiselect = true;
fdiag.CheckFileExists = true;
- if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
foreach (string filename in fdiag.FileNames) {
string oresname = Path.ChangeExtension(Path.GetFileName(filename), null);
if (oresname == "") oresname = "new";
diff --git a/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/Commands/SaveEntryAsCommand.cs b/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/Commands/SaveEntryAsCommand.cs
index de892119f6..4a4aab2a92 100644
--- a/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/Commands/SaveEntryAsCommand.cs
+++ b/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/Commands/SaveEntryAsCommand.cs
@@ -52,7 +52,7 @@ namespace ResourceEditor
return;
}
- DialogResult dr = sdialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
+ DialogResult dr = sdialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window);
sdialog.Dispose();
if (dr != DialogResult.OK) {
return;
diff --git a/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/DisplayDefinition.cs b/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/DisplayDefinition.cs
index 311a0de24a..32ca64dc41 100644
--- a/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/DisplayDefinition.cs
+++ b/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/DisplayDefinition.cs
@@ -57,15 +57,11 @@ namespace ResourceEditor
public ResourceEditWrapper(OpenedFile file)
{
this.TabPageText = "Resource editor";
- base.UserControl = resourceEditor;
+ base.UserContent = resourceEditor;
resourceEditor.ResourceList.Changed += new EventHandler(SetDirty);
this.Files.Add(file);
}
- public override void RedrawContent()
- {
- }
-
public override void Dispose()
{
base.Dispose();
diff --git a/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/BitmapView.cs b/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/BitmapView.cs
index c93f2ea515..deda2caf34 100644
--- a/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/BitmapView.cs
+++ b/src/AddIns/DisplayBindings/ResourceEditor/Project/Src/ResourceEdit/BitmapView.cs
@@ -42,7 +42,7 @@ namespace ResourceEditor
fileDialog.Filter = "All files (*.*)|*.*";
fileDialog.CheckFileExists = true;
- if(fileDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if(fileDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
try {
bitmap = new Bitmap(fileDialog.FileName);
} catch {
diff --git a/src/AddIns/DisplayBindings/SettingsEditor/Project/SettingsViewContent.cs b/src/AddIns/DisplayBindings/SettingsEditor/Project/SettingsViewContent.cs
index cfc5d8219a..86f15e0353 100644
--- a/src/AddIns/DisplayBindings/SettingsEditor/Project/SettingsViewContent.cs
+++ b/src/AddIns/DisplayBindings/SettingsEditor/Project/SettingsViewContent.cs
@@ -36,7 +36,7 @@ namespace ICSharpCode.SettingsEditor
};
}
- public override Control Control {
+ public override object Content {
get {
return view;
}
diff --git a/src/AddIns/DisplayBindings/WorkflowDesigner/Project/Src/PrimaryView/PrimaryViewContent.cs b/src/AddIns/DisplayBindings/WorkflowDesigner/Project/Src/PrimaryView/PrimaryViewContent.cs
index ad3f56e6c1..074ca33daa 100644
--- a/src/AddIns/DisplayBindings/WorkflowDesigner/Project/Src/PrimaryView/PrimaryViewContent.cs
+++ b/src/AddIns/DisplayBindings/WorkflowDesigner/Project/Src/PrimaryView/PrimaryViewContent.cs
@@ -37,7 +37,7 @@ namespace WorkflowDesigner
}
- public override System.Windows.Forms.Control Control {
+ public override object Content {
get {
return control;
}
@@ -75,7 +75,7 @@ namespace WorkflowDesigner
}
#endregion
- System.Windows.Forms.Control IToolsHost.ToolsControl {
+ object IToolsHost.ToolsContent {
get {
return WorkflowSideTabService.WorkflowSideBar;
}
diff --git a/src/AddIns/DisplayBindings/WorkflowDesigner/Project/Src/SecondaryView/SecondaryViewContent.cs b/src/AddIns/DisplayBindings/WorkflowDesigner/Project/Src/SecondaryView/SecondaryViewContent.cs
index a706803424..bbe55af222 100644
--- a/src/AddIns/DisplayBindings/WorkflowDesigner/Project/Src/SecondaryView/SecondaryViewContent.cs
+++ b/src/AddIns/DisplayBindings/WorkflowDesigner/Project/Src/SecondaryView/SecondaryViewContent.cs
@@ -34,7 +34,7 @@ namespace WorkflowDesigner
#endregion
#region Property Accessors
- public override Control Control {
+ public override object Content {
get {
return control;
}
@@ -58,7 +58,7 @@ namespace WorkflowDesigner
control.UnloadWorkflow();
}
- System.Windows.Forms.Control IToolsHost.ToolsControl {
+ object IToolsHost.ToolsContent {
get {
return WorkflowSideTabService.WorkflowSideBar;
}
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/GetBitmapExtension.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/GetBitmapExtension.cs
deleted file mode 100644
index b8a978a140..0000000000
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/GetBitmapExtension.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Windows;
-using System.Windows.Interop;
-using System.Windows.Markup;
-using System.Windows.Media.Imaging;
-
-using ICSharpCode.Core.WinForms;
-
-namespace ICSharpCode.WpfDesign.AddIn
-{
- class GetBitmapExtension : MarkupExtension
- {
- public GetBitmapExtension(string key)
- {
- this.key = key;
- }
-
- static Dictionary cache = new Dictionary();
-
- protected string key;
-
- public override object ProvideValue(IServiceProvider sp)
- {
- lock (cache) {
- BitmapSource result;
- if (!cache.TryGetValue(key, out result)) {
- result = GetBitmapSource();
- result.Freeze();
- cache[key] = result;
- }
- return result;
- }
- }
-
- BitmapSource GetBitmapSource()
- {
- Bitmap bitmap = WinFormsResourceService.GetBitmap(key);
- return Imaging.CreateBitmapSourceFromHBitmap(bitmap.GetHbitmap(), IntPtr.Zero,
- Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
- }
- }
-}
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/SharpDevelopElementHost.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/SharpDevelopElementHost.cs
deleted file mode 100644
index f835a0319b..0000000000
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/SharpDevelopElementHost.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-//
-//
-//
-//
-// $Revision$
-//
-
-using System;
-using System.Windows;
-using System.Windows.Forms.Integration;
-using System.Windows.Input;
-using System.Windows.Threading;
-using ICSharpCode.SharpDevelop.Gui;
-
-namespace ICSharpCode.WpfDesign.AddIn
-{
- ///
- /// Hosts a WPF element inside a Windows.Forms application.
- ///
- public class SharpDevelopElementHost : ElementHost, IUndoHandler, IClipboardHandler
- {
- [ThreadStatic]
- static bool registeredErrorHandler;
-
- public SharpDevelopElementHost(WpfViewContent viewContent, UIElement child)
- {
- if (!registeredErrorHandler) {
- registeredErrorHandler = true;
- Dispatcher.CurrentDispatcher.UnhandledException += CurrentDispatcher_UnhandledException;
- }
-
- this.viewContent = viewContent;
- this.Child = child;
- }
-
- WpfViewContent viewContent;
-
- static void CurrentDispatcher_UnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
- {
- ICSharpCode.Core.MessageService.ShowError(e.Exception, "Unhandled WPF exception");
- e.Handled = true;
- }
-
- bool IsEnabled(RoutedCommand command)
- {
- if (command.CanExecute(null, null)) return true;
- return command.CanExecute(null, viewContent.DesignSurface);
- }
-
- void Run(RoutedCommand command)
- {
- if (command.CanExecute(null, null)) {
- command.Execute(null, null);
- } else {
- command.Execute(null, viewContent.DesignSurface);
- }
- }
-
- public bool EnableUndo {
- get { return IsEnabled(ApplicationCommands.Undo); }
- }
-
- public bool EnableRedo {
- get { return IsEnabled(ApplicationCommands.Redo); }
- }
-
- public void Undo()
- {
- Run(ApplicationCommands.Undo);
- }
-
- public void Redo()
- {
- Run(ApplicationCommands.Redo);
- }
-
- public bool EnableCut {
- get { return IsEnabled(ApplicationCommands.Undo); }
- }
-
- public bool EnableCopy {
- get { return IsEnabled(ApplicationCommands.Copy); }
- }
-
- public bool EnablePaste {
- get { return IsEnabled(ApplicationCommands.Paste); }
- }
-
- public bool EnableDelete {
- get { return IsEnabled(ApplicationCommands.Delete); }
- }
-
- public bool EnableSelectAll {
- get { return IsEnabled(ApplicationCommands.SelectAll); }
- }
-
- public void Cut()
- {
- Run(ApplicationCommands.Cut);
- }
-
- public void Copy()
- {
- Run(ApplicationCommands.Copy);
- }
-
- public void Paste()
- {
- Run(ApplicationCommands.Paste);
- }
-
- public void Delete()
- {
- Run(ApplicationCommands.Delete);
- }
-
- public void SelectAll()
- {
- Run(ApplicationCommands.SelectAll);
- }
- }
-}
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfViewContent.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfViewContent.cs
index 0ffc938a3d..66cab2a203 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfViewContent.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfViewContent.cs
@@ -9,8 +9,6 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
-using System.Windows.Forms;
-using System.Windows.Forms.Integration;
using System.Windows.Markup;
using System.Xml;
@@ -40,7 +38,6 @@ namespace ICSharpCode.WpfDesign.AddIn
this.editor = file.RegisteredViewContents[0] as TextEditorDisplayBindingWrapper;
}
- ElementHost wpfHost;
DesignSurface designer;
List tasks = new List();
@@ -63,8 +60,7 @@ namespace ICSharpCode.WpfDesign.AddIn
// initialize designer on first load
DragDropExceptionHandler.HandleException = ICSharpCode.Core.MessageService.ShowError;
designer = new DesignSurface();
- wpfHost = new SharpDevelopElementHost(this, designer);
- this.UserControl = wpfHost;
+ this.UserContent = designer;
InitPropertyEditor();
}
using (XmlTextReader r = new XmlTextReader(stream)) {
@@ -134,14 +130,12 @@ namespace ICSharpCode.WpfDesign.AddIn
#region Property editor / SelectionChanged
- ElementHost propertyEditorHost;
PropertyGridView propertyGridView;
void InitPropertyEditor()
{
propertyGridView = new PropertyGridView();
- propertyEditorHost = new SharpDevelopElementHost(this, propertyGridView);
- propertyContainer.PropertyGridReplacementControl = propertyEditorHost;
+ propertyContainer.PropertyGridReplacementContent = propertyGridView;
}
ICollection oldItems = new DesignItem[0];
@@ -177,7 +171,7 @@ namespace ICSharpCode.WpfDesign.AddIn
}
#endregion
- public Control ToolsControl {
+ public object ToolsContent {
get { return WpfToolbox.Instance.ToolboxControl; }
}
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj
index ae5a9cc0ee..d41220c48b 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/WpfDesign.AddIn.csproj
@@ -59,14 +59,12 @@
-
ObjectEditor.xaml
-
@@ -89,6 +87,11 @@
ICSharpCode.Core
False
+
+ {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}
+ ICSharpCode.Core.Presentation
+ False
+
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}
ICSharpCode.Core.WinForms
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Configuration/AssemblyInfo.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Configuration/AssemblyInfo.cs
index ac57010a8d..e4bd7bac8e 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Configuration/AssemblyInfo.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Configuration/AssemblyInfo.cs
@@ -41,10 +41,10 @@ using System.Windows.Markup;
// app, or any theme specific resource dictionaries)
)]
-[assembly: XmlnsPrefix("http://sharpdevelop.net", "sd")]
+[assembly: XmlnsPrefix("http://icsharpcode.net/sharpdevelop/wpfdesigner", "wpfdesigner")]
-[assembly: XmlnsDefinition("http://sharpdevelop.net", "ICSharpCode.WpfDesign.Designer")]
-[assembly: XmlnsDefinition("http://sharpdevelop.net", "ICSharpCode.WpfDesign.Designer.Controls")]
-[assembly: XmlnsDefinition("http://sharpdevelop.net", "ICSharpCode.WpfDesign.Designer.PropertyGrid")]
-[assembly: XmlnsDefinition("http://sharpdevelop.net", "ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors")]
+[assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/wpfdesigner", "ICSharpCode.WpfDesign.Designer")]
+[assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/wpfdesigner", "ICSharpCode.WpfDesign.Designer.Controls")]
+[assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/wpfdesigner", "ICSharpCode.WpfDesign.Designer.PropertyGrid")]
+[assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/wpfdesigner", "ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors")]
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/AssignStylesheetCommand.cs b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/AssignStylesheetCommand.cs
index 3d0db5c9a1..fba80cdd21 100644
--- a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/AssignStylesheetCommand.cs
+++ b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/AssignStylesheetCommand.cs
@@ -52,7 +52,7 @@ namespace ICSharpCode.XmlEditor
dialog.FilterIndex = 1;
}
- if (dialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (dialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
return dialog.FileName;
}
}
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XPathQueryPad.cs b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XPathQueryPad.cs
index 8ec5025b6c..7468df1668 100644
--- a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XPathQueryPad.cs
+++ b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XPathQueryPad.cs
@@ -38,7 +38,7 @@ namespace ICSharpCode.XmlEditor
///
/// The representing the pad.
///
- public override Control Control {
+ public override object Content {
get {
return xPathQueryControl;
}
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlTreeView.cs b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlTreeView.cs
index c2c3875f6e..3d5fa0a32f 100644
--- a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlTreeView.cs
+++ b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlTreeView.cs
@@ -44,7 +44,7 @@ namespace ICSharpCode.XmlEditor
treeViewContainer.TreeView.ContextMenuStrip = treeViewContextMenuStrip;
}
- public override Control Control {
+ public override object Content {
get {
return treeViewContainer;
}
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs
index 5517adb80a..083e71c45d 100644
--- a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs
+++ b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs
@@ -547,7 +547,7 @@ namespace ICSharpCode.XmlEditor
#region AbstractViewContent implementation
- public override Control Control {
+ public override object Content {
get {
return xmlEditor;
}
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XslOutputView.cs b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XslOutputView.cs
index fcb0cfd9f4..4c35aea070 100644
--- a/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XslOutputView.cs
+++ b/src/AddIns/DisplayBindings/XmlEditor/Project/Src/XslOutputView.cs
@@ -27,7 +27,6 @@ namespace ICSharpCode.XmlEditor
foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection) {
if (content is XslOutputView) {
LoggingService.Debug("XslOutputView instance exists.");
- LoggingService.Debug("XslOutputView.IsDisposed=" + content.Control.IsDisposed.ToString());
return (XslOutputView)content;
}
}
diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
index d6f6eeb254..4876f58d68 100644
--- a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
+++ b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
@@ -169,7 +169,8 @@
icon = "PadIcons.XPathQuery"
title = "${res:ICSharpCode.XmlEditor.XPathQueryPad.Title}"
insertafter = "UnitTestingPad"
- class = "ICSharpCode.XmlEditor.XPathQueryPad"/>
+ class = "ICSharpCode.XmlEditor.XPathQueryPad"
+ defaultPosition = "Bottom, Hidden" />
diff --git a/src/AddIns/Misc/AddInManager/Project/Src/ManagerForm.cs b/src/AddIns/Misc/AddInManager/Project/Src/ManagerForm.cs
index 84f1efe2ed..7d0f345916 100644
--- a/src/AddIns/Misc/AddInManager/Project/Src/ManagerForm.cs
+++ b/src/AddIns/Misc/AddInManager/Project/Src/ManagerForm.cs
@@ -32,10 +32,11 @@ namespace ICSharpCode.AddInManager
{
if (instance == null) {
instance = new ManagerForm();
- #if !STANDALONE
- instance.Owner = ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm;
- #endif
+ #if STANDALONE
instance.Show();
+ #else
+ instance.Show(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window);
+ #endif
} else {
instance.Activate();
}
diff --git a/src/AddIns/Misc/AddinScout/Project/Src/AddInScoutViewContent.cs b/src/AddIns/Misc/AddinScout/Project/Src/AddInScoutViewContent.cs
index 40b4d7c3e2..2e860f4ce9 100644
--- a/src/AddIns/Misc/AddinScout/Project/Src/AddInScoutViewContent.cs
+++ b/src/AddIns/Misc/AddinScout/Project/Src/AddInScoutViewContent.cs
@@ -16,7 +16,7 @@ namespace AddInScout
{
Control control = null;
- public override Control Control {
+ public override object Content {
get {
return control;
}
diff --git a/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.addin b/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.addin
index e0562c7211..b06aa6452b 100644
--- a/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.addin
+++ b/src/AddIns/Misc/CodeCoverage/Project/CodeCoverage.addin
@@ -20,7 +20,8 @@
insertbefore = "DefinitionView"
icon = "CodeCoverage.Icons.16x16.Pad"
shortcut = "Control|Alt|G"
- class = "ICSharpCode.CodeCoverage.CodeCoveragePad"/>
+ class = "ICSharpCode.CodeCoverage.CodeCoveragePad"
+ defaultPosition = "Bottom, Hidden" />
diff --git a/src/AddIns/Misc/CodeCoverage/Project/Src/CodeCoveragePad.cs b/src/AddIns/Misc/CodeCoverage/Project/Src/CodeCoveragePad.cs
index 54ad5f6aaa..b12882941a 100644
--- a/src/AddIns/Misc/CodeCoverage/Project/Src/CodeCoveragePad.cs
+++ b/src/AddIns/Misc/CodeCoverage/Project/Src/CodeCoveragePad.cs
@@ -38,7 +38,7 @@ namespace ICSharpCode.CodeCoverage
}
}
- public override Control Control {
+ public override object Content {
get {
return codeCoverageControl;
}
diff --git a/src/AddIns/Misc/ComponentInspector/ComponentInspector.AddIn/Src/ComponentInspectorView.cs b/src/AddIns/Misc/ComponentInspector/ComponentInspector.AddIn/Src/ComponentInspectorView.cs
index a565e09185..47a4c171c9 100644
--- a/src/AddIns/Misc/ComponentInspector/ComponentInspector.AddIn/Src/ComponentInspectorView.cs
+++ b/src/AddIns/Misc/ComponentInspector/ComponentInspector.AddIn/Src/ComponentInspectorView.cs
@@ -45,7 +45,7 @@ namespace ICSharpCode.ComponentInspector.AddIn
}
}
- public override Control Control {
+ public override object Content {
get {
return objectBrowser;
}
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.addin b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.addin
index ff34f78a4d..60da32f2e6 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.addin
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.addin
@@ -52,42 +52,48 @@
title = "${res:MainWindow.Windows.Debug.Breakpoints}"
icon = "PadIcons.BreakPoints"
shortcut = "Control|Alt|P"
- class = "ICSharpCode.SharpDevelop.Gui.Pads.BreakPointsPad"/>
+ class = "ICSharpCode.SharpDevelop.Gui.Pads.BreakPointsPad"
+ defaultPosition = "Bottom, Hidden" />
+ class = "ICSharpCode.SharpDevelop.Gui.Pads.CallStackPad"
+ defaultPosition = "Bottom, Hidden" />
+ class = "ICSharpCode.SharpDevelop.Gui.Pads.LoadedModulesPad"
+ defaultPosition = "Bottom, Hidden" />
+ class = "ICSharpCode.SharpDevelop.Gui.Pads.RunningThreadsPad"
+ defaultPosition = "Bottom, Hidden" />
+ class = "ICSharpCode.SharpDevelop.Gui.Pads.LocalVarPad"
+ defaultPosition = "Bottom, Hidden" />
+ class = "ICSharpCode.SharpDevelop.Gui.Pads.ConsolePad"
+ defaultPosition = "Bottom, Hidden" />
4096
false
Always
- v2.0
+ v3.0
+ "C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\Misc\SourceAnalysis\Settings.SourceAnalysis"
C:\Dokumente und Einstellungen\HP\Anwendungsdaten\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis
@@ -40,11 +41,20 @@
..\..\..\..\..\..\bin\SharpDevelop.exe
+
+ 3.0
+
+
+ 3.0
+
+
+ 3.0
+
@@ -190,11 +200,6 @@
ICSharpCode.Core.WinForms
False
-
- {80318B5F-A25D-45AB-8A95-EF31D2370A4C}
- ICSharpCode.SharpDevelop.Sda
- False
-
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs
index ae51a35a9d..ebbfab3363 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs
@@ -58,7 +58,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
ColumnHeader name = new ColumnHeader();
ColumnHeader language = new ColumnHeader();
- public override Control Control {
+ public override object Content {
get {
return callStackList;
}
@@ -81,9 +81,10 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
language.Width = 50;
RedrawContent();
+ ResourceService.LanguageChanged += delegate { RedrawContent(); };
}
- public override void RedrawContent()
+ public void RedrawContent()
{
name.Text = ResourceService.GetString("Global.Name");
language.Text = ResourceService.GetString("MainWindow.Windows.Debug.CallStack.Language");
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LoadedModulesPad.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LoadedModulesPad.cs
index e0ffbf0e80..63cf216596 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LoadedModulesPad.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LoadedModulesPad.cs
@@ -59,7 +59,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
ColumnHeader information = new ColumnHeader();
- public override Control Control {
+ public override object Content {
get {
return loadedModulesList;
}
@@ -86,9 +86,10 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
information.Width = 130;
RedrawContent();
+ ResourceService.LanguageChanged += delegate { RedrawContent(); };
}
- public override void RedrawContent()
+ public void RedrawContent()
{
name.Text = StringParser.Parse("${res:Global.Name}");
address.Text = StringParser.Parse("${res:MainWindow.Windows.Debug.Modules.AddressColumn}");
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs
index 5846ec6fd7..7f63418f7d 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs
@@ -61,7 +61,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
///
/// This is not used anywhere, but it is neccessary to be overridden in children of AbstractPadContent.
///
- public override Control Control {
+ public override object Content {
get {
return localVarList;
}
@@ -100,9 +100,10 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
localVarList.AutoRowHeight = true;
RedrawContent();
+ ResourceService.LanguageChanged += delegate { RedrawContent(); };
}
- public override void RedrawContent()
+ public void RedrawContent()
{
nameColumn.Header = ResourceService.GetString("Global.Name");
nameColumn.Width = 250;
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/RunningThreadsPad.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/RunningThreadsPad.cs
index e0a9a39920..50b7ba3d5a 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/RunningThreadsPad.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/RunningThreadsPad.cs
@@ -56,7 +56,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
ColumnHeader priority = new ColumnHeader();
ColumnHeader breaked = new ColumnHeader();
- public override Control Control {
+ public override object Content {
get {
return runningThreadsList;
}
@@ -82,9 +82,10 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
breaked.Width = 80;
RedrawContent();
+ ResourceService.LanguageChanged += delegate { RedrawContent(); };
}
- public override void RedrawContent()
+ public void RedrawContent()
{
id.Text = ResourceService.GetString("Global.ID");
name.Text = ResourceService.GetString("Global.Name");
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPad.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPad.cs
index 49b7f3b892..4d0a7dd719 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPad.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPad.cs
@@ -104,7 +104,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
///
/// This is not used anywhere, but it is neccessary to be overridden in children of AbstractPadContent.
///
- public override Control Control {
+ public override object Content {
get {
return watchList;
}
@@ -148,7 +148,8 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
watches = new List();
- RedrawContent();
+ ResourceService.LanguageChanged += delegate { OnLanguageChanged(); };
+ OnLanguageChanged();
}
void watchList_DoubleClick(object sender, EventArgs e)
@@ -177,7 +178,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
watchList.EndUpdate();
}
- public override void RedrawContent()
+ void OnLanguageChanged()
{
nameColumn.Header = ResourceService.GetString("Global.Name");
nameColumn.Width = 250;
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPadCommands.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPadCommands.cs
index 9704a5f446..03068b5099 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPadCommands.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/WatchPadCommands.cs
@@ -26,15 +26,15 @@ namespace Debugger.AddIn
if (this.Owner is WatchPad) {
WatchPad pad = (WatchPad)this.Owner;
- ((TreeViewAdv)pad.Control).BeginUpdate();
+ ((TreeViewAdv)pad.Content).BeginUpdate();
TextNode text = new TextNode(MessageService.ShowInputBox(StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.AddWatch}"),
StringParser.Parse("${res:MainWindow.Windows.Debug.Watch.EnterExpression}"),
""));
- TreeViewVarNode node = new TreeViewVarNode(pad.Process, (TreeViewAdv)pad.Control, text);
+ TreeViewVarNode node = new TreeViewVarNode(pad.Process, (TreeViewAdv)pad.Content, text);
pad.Watches.Add(text);
- ((TreeViewAdv)pad.Control).Root.Children.Add(node);
- ((TreeViewAdv)pad.Control).EndUpdate();
+ ((TreeViewAdv)pad.Content).Root.Children.Add(node);
+ ((TreeViewAdv)pad.Content).EndUpdate();
((WatchPad)this.Owner).RefreshPad();
}
@@ -50,18 +50,18 @@ namespace Debugger.AddIn
// TODO : Implement remove
- TreeNodeAdv node = ((TreeViewAdv)pad.Control).SelectedNode;
+ TreeNodeAdv node = ((TreeViewAdv)pad.Content).SelectedNode;
if (node == null)
return;
- while (node.Parent != ((TreeViewAdv)pad.Control).Root)
+ while (node.Parent != ((TreeViewAdv)pad.Content).Root)
{
node = node.Parent;
}
pad.Watches.RemoveAt(node.Index);
- ((TreeViewAdv)pad.Control).Root.Children.Remove(node);
+ ((TreeViewAdv)pad.Content).Root.Children.Remove(node);
((WatchPad)this.Owner).RefreshPad();
}
@@ -85,10 +85,10 @@ namespace Debugger.AddIn
if (this.Owner is WatchPad) {
WatchPad pad = (WatchPad)this.Owner;
- ((TreeViewAdv)pad.Control).BeginUpdate();
+ ((TreeViewAdv)pad.Content).BeginUpdate();
pad.Watches.Clear();
- ((TreeViewAdv)pad.Control).Root.Children.Clear();
- ((TreeViewAdv)pad.Control).EndUpdate();
+ ((TreeViewAdv)pad.Content).Root.Children.Clear();
+ ((TreeViewAdv)pad.Content).EndUpdate();
}
}
}
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebugeeExceptionForm.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebugeeExceptionForm.cs
index d7c43398f6..b272afd359 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebugeeExceptionForm.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebugeeExceptionForm.cs
@@ -137,7 +137,7 @@ namespace ICSharpCode.SharpDevelop.Services
form.exceptionDetails.Refresh();
form.buttonContinue.Enabled = canContinue;
- form.ShowDialog(Gui.WorkbenchSingleton.MainForm);
+ form.ShowDialog(Gui.WorkbenchSingleton.MainWin32Window);
return form.result;
}
}
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggerEventForm.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggerEventForm.cs
index a69cc4dbbd..6ab99efa0d 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggerEventForm.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggerEventForm.cs
@@ -81,7 +81,7 @@ namespace ICSharpCode.SharpDevelop.Services
form.textBox.Text = message;
form.pictureBox.Image = icon;
form.buttonContinue.Enabled = canContinue;
- form.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
+ form.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window);
return form.result;
}
}
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
index 68c467cb1d..de47b9ecc9 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
@@ -189,7 +189,7 @@ namespace ICSharpCode.SharpDevelop.Services
public void ShowAttachDialog()
{
using (AttachToProcessForm attachForm = new AttachToProcessForm()) {
- if (attachForm.ShowDialog() == DialogResult.OK) {
+ if (attachForm.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
Attach(attachForm.Process);
}
}
@@ -727,7 +727,7 @@ namespace ICSharpCode.SharpDevelop.Services
public void JumpToCurrentLine()
{
- WorkbenchSingleton.MainForm.Activate();
+ WorkbenchSingleton.MainWindow.Activate();
DebuggerService.RemoveCurrentLineMarker();
if (debuggedProcess != null) {
SourcecodeSegment nextStatement = debuggedProcess.NextStatement;
diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/ErrorNode.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/ErrorNode.cs
index 86b9c3d645..926e5e1778 100644
--- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/ErrorNode.cs
+++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/ErrorNode.cs
@@ -10,7 +10,6 @@ using System.Collections.Generic;
using System.Windows.Forms;
using ICSharpCode.Core;
-using ICSharpCode.SharpDevelop.Sda;
using Debugger;
using Debugger.Expressions;
@@ -48,9 +47,7 @@ namespace Debugger.AddIn.TreeModel
showError.Text = StringParser.Parse("${res:MainWindow.Windows.Debug.LocalVariables.ShowFullError}");
showError.Checked = false;
showError.Click += delegate {
- using (ExceptionBox box = new ExceptionBox(error, null, false)) {
- box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
- }
+ MessageService.ShowError(error, null);
};
menu.Items.AddRange(new ToolStripItem[] {
diff --git a/src/AddIns/Misc/HighlightingEditor/Project/Src/ColorButton.cs b/src/AddIns/Misc/HighlightingEditor/Project/Src/ColorButton.cs
index b3b317d216..cec616ad99 100644
--- a/src/AddIns/Misc/HighlightingEditor/Project/Src/ColorButton.cs
+++ b/src/AddIns/Misc/HighlightingEditor/Project/Src/ColorButton.cs
@@ -58,7 +58,7 @@ namespace ICSharpCode.SharpDevelop.Gui
p = PointToScreen(p);
using (ColorPaletteDialog clDlg = new ColorPaletteDialog(p.X, p.Y)) {
- clDlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
+ clDlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window);
if (clDlg.DialogResult == DialogResult.OK) {
CenterColor = clDlg.Color;
}
diff --git a/src/AddIns/Misc/HighlightingEditor/Project/Src/ColorDialog.cs b/src/AddIns/Misc/HighlightingEditor/Project/Src/ColorDialog.cs
index 9d0a247ccf..294346cb06 100644
--- a/src/AddIns/Misc/HighlightingEditor/Project/Src/ColorDialog.cs
+++ b/src/AddIns/Misc/HighlightingEditor/Project/Src/ColorDialog.cs
@@ -133,7 +133,7 @@ namespace ICSharpCode.SharpDevelop.Gui
{
using (ColorDialog colDialog = new ColorDialog()) {
colDialog.FullOpen = true;
- if (colDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (colDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
selectedColor = colDialog.Color;
DialogResult = DialogResult.OK;
}
diff --git a/src/AddIns/Misc/HighlightingEditor/Project/Src/EditHighlightingPanel.cs b/src/AddIns/Misc/HighlightingEditor/Project/Src/EditHighlightingPanel.cs
index 69d681516f..6dfc2dfa03 100644
--- a/src/AddIns/Misc/HighlightingEditor/Project/Src/EditHighlightingPanel.cs
+++ b/src/AddIns/Misc/HighlightingEditor/Project/Src/EditHighlightingPanel.cs
@@ -182,7 +182,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
HighlightItem item = (HighlightItem)userList.SelectedItem;
using (EditHighlightingDialog dlg = new EditHighlightingDialog(item.Node)) {
- DialogResult res = dlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
+ DialogResult res = dlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window);
if (res == DialogResult.OK) {
using (XmlTextWriter writer = new XmlTextWriter(item.FileName, Encoding.UTF8)) {
diff --git a/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.DynamicHelp.addin b/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.DynamicHelp.addin
index 5f8f665470..88b4919146 100644
--- a/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.DynamicHelp.addin
+++ b/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.DynamicHelp.addin
@@ -15,7 +15,8 @@
category = "Help2"
title = "${res:AddIns.HtmlHelp2.DynamicHelp}"
icon = "HtmlHelp2.16x16.DynamicHelp"
- class = "HtmlHelp2.HtmlHelp2DynamicHelpPad"/>
+ class = "HtmlHelp2.HtmlHelp2DynamicHelpPad"
+ defaultPosition = "Right, Hidden" />
diff --git a/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin b/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin
index cb63b2fea0..1c4145ff0d 100644
--- a/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin
+++ b/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin
@@ -24,22 +24,26 @@
category = "Help2"
title = "${res:AddIns.HtmlHelp2.Contents}"
icon = "HtmlHelp2.16x16.Toc"
- class = "HtmlHelp2.HtmlHelp2TocPad"/>
+ class = "HtmlHelp2.HtmlHelp2TocPad"
+ defaultPosition = "Right, Hidden" />
+ class = "HtmlHelp2.HtmlHelp2IndexPad"
+ defaultPosition = "Right, Hidden" />
+ class = "HtmlHelp2.HtmlHelp2SearchPad"
+ defaultPosition = "Right, Hidden" />
+ class = "HtmlHelp2.HtmlHelp2IndexResultsPad"
+ defaultPosition = "Bottom, Hidden" />
diff --git a/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/DynamicHelpPad.cs b/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/DynamicHelpPad.cs
index 0e51d4c345..161b588420 100644
--- a/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/DynamicHelpPad.cs
+++ b/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/DynamicHelpPad.cs
@@ -43,16 +43,11 @@ namespace HtmlHelp2
private string debugPreElement = String.Empty;
private bool enableDebugInfo = HtmlHelp2Environment.Config.DynamicHelpDebugInfos;
- public override Control Control
+ public override object Content
{
get { return dynamicHelpBrowser; }
}
- public override void RedrawContent()
- {
- dynamicHelpBrowser.RedrawContent();
- }
-
[PermissionSet(SecurityAction.LinkDemand, Name="Execution")]
public HtmlHelp2DynamicHelpPad()
{
@@ -65,6 +60,7 @@ namespace HtmlHelp2
ProjectService.SolutionClosed += new EventHandler(this.SolutionClosed);
HtmlHelp2Environment.NamespaceReloaded += new EventHandler(this.NamespaceReloaded);
+ ResourceService.LanguageChanged += delegate { dynamicHelpBrowser.RedrawContent(); };
}
#region Dynamic Help Calls
diff --git a/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexPad.cs b/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexPad.cs
index e8278362da..796c04d52c 100644
--- a/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexPad.cs
+++ b/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexPad.cs
@@ -33,7 +33,7 @@ namespace HtmlHelp2
{
MSHelp2IndexControl help2IndexControl;
- public override Control Control
+ public override object Content
{
get { return help2IndexControl; }
}
@@ -43,14 +43,10 @@ namespace HtmlHelp2
help2IndexControl.Dispose();
}
- public override void RedrawContent()
- {
- help2IndexControl.RedrawContent();
- }
-
public HtmlHelp2IndexPad()
{
help2IndexControl = new MSHelp2IndexControl();
+ ResourceService.LanguageChanged += delegate { help2IndexControl.RedrawContent(); };
}
}
diff --git a/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexResultsPad.cs b/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexResultsPad.cs
index 9e4ed57701..e3eacb573a 100644
--- a/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexResultsPad.cs
+++ b/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/IndexResultsPad.cs
@@ -32,16 +32,11 @@ namespace HtmlHelp2
ColumnHeader title = new ColumnHeader();
ColumnHeader location = new ColumnHeader();
- public override Control Control
+ public override object Content
{
get { return listView; }
}
- public override void RedrawContent()
- {
- this.SetListViewHeader();
- }
-
public ListView IndexResultsListView
{
get { return listView; }
@@ -50,6 +45,8 @@ namespace HtmlHelp2
public HtmlHelp2IndexResultsPad()
{
this.SetListViewHeader();
+ ResourceService.LanguageChanged += delegate { SetListViewHeader(); };
+
listView.Columns.Add(title);
listView.Columns.Add(location);
diff --git a/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/SearchPad.cs b/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/SearchPad.cs
index d0e44196e8..ec90ca6478 100644
--- a/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/SearchPad.cs
+++ b/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/SearchPad.cs
@@ -47,7 +47,7 @@ namespace HtmlHelp2
Label label2 = new Label();
bool searchIsBusy;
- public override Control Control
+ public override object Content
{
get { return mainPanel; }
}
@@ -57,11 +57,6 @@ namespace HtmlHelp2
searchTerm.Focus();
}
- public override void RedrawContent()
- {
- this.RedrawContentInternal();
- }
-
void RedrawContentInternal()
{
searchButton.Text = StringParser.Parse("${res:AddIns.HtmlHelp2.Search}");
@@ -83,6 +78,7 @@ namespace HtmlHelp2
{
this.InitializeComponents();
this.UpdateControls();
+ ResourceService.LanguageChanged += delegate { RedrawContentInternal(); };
HtmlHelp2Environment.FilterQueryChanged += new EventHandler(FilterQueryChanged);
HtmlHelp2Environment.NamespaceReloaded += new EventHandler(NamespaceReloaded);
diff --git a/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs b/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs
index f3e46ee6d1..9e69a9455c 100644
--- a/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs
+++ b/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs
@@ -34,7 +34,7 @@ namespace HtmlHelp2
{
MSHelp2TocControl help2TocControl;
- public override Control Control
+ public override object Content
{
get { return help2TocControl; }
}
@@ -44,14 +44,10 @@ namespace HtmlHelp2
help2TocControl.Dispose();
}
- public override void RedrawContent()
- {
- help2TocControl.RedrawContent();
- }
-
public HtmlHelp2TocPad()
{
help2TocControl = new MSHelp2TocControl();
+ ResourceService.LanguageChanged += delegate { help2TocControl.RedrawContent(); };
}
public void SyncToc(string topic)
diff --git a/src/AddIns/Misc/PInvokeAddIn/Project/Src/InsertPInvokeSignaturesCommand.cs b/src/AddIns/Misc/PInvokeAddIn/Project/Src/InsertPInvokeSignaturesCommand.cs
index 79c033985e..1658d20d37 100644
--- a/src/AddIns/Misc/PInvokeAddIn/Project/Src/InsertPInvokeSignaturesCommand.cs
+++ b/src/AddIns/Misc/PInvokeAddIn/Project/Src/InsertPInvokeSignaturesCommand.cs
@@ -7,6 +7,7 @@
using System;
using ICSharpCode.Core;
+using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.PInvokeAddIn
{
@@ -15,7 +16,7 @@ namespace ICSharpCode.PInvokeAddIn
/// insert one or more of them into the code.
///
public class InsertPInvokeSignaturesCommand : AbstractMenuCommand
- {
+ {
///
/// Starts the command.
///
@@ -23,7 +24,7 @@ namespace ICSharpCode.PInvokeAddIn
{
// Show PInvoke dialog.
using(InsertPInvokeSignaturesForm form = new InsertPInvokeSignaturesForm()) {
- form.ShowDialog();
+ form.ShowDialog(WorkbenchSingleton.MainWin32Window);
}
}
}
diff --git a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/TextEditorContextMenuCommand.cs b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/TextEditorContextMenuCommand.cs
index 6f17d11383..1eedb42996 100644
--- a/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/TextEditorContextMenuCommand.cs
+++ b/src/AddIns/Misc/ReflectorAddIn/ReflectorAddIn/Project/Src/TextEditorContextMenuCommand.cs
@@ -137,7 +137,7 @@ namespace ReflectorAddIn
Application.DoEvents();
Cursor.Current = Cursors.WaitCursor;
- ReflectorController.TryGoTo(element, WorkbenchSingleton.MainForm);
+ ReflectorController.TryGoTo(element, WorkbenchSingleton.MainWin32Window);
} finally {
Cursor.Current = Cursors.Default;
diff --git a/src/AddIns/Misc/RegExpTk/Project/Src/Commands/MenuCommand.cs b/src/AddIns/Misc/RegExpTk/Project/Src/Commands/MenuCommand.cs
index 1773c0d109..0c1e51edee 100644
--- a/src/AddIns/Misc/RegExpTk/Project/Src/Commands/MenuCommand.cs
+++ b/src/AddIns/Misc/RegExpTk/Project/Src/Commands/MenuCommand.cs
@@ -7,17 +7,16 @@
using System;
using ICSharpCode.Core;
+using ICSharpCode.SharpDevelop.Gui;
namespace Plugins.RegExpTk {
public class RegExpTkCommand : AbstractMenuCommand
{
-
public override void Run()
{
RegExpTkDialog dialog = new RegExpTkDialog();
- dialog.Owner = ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm;
- dialog.Show();
+ dialog.Show(WorkbenchSingleton.MainWin32Window);
}
}
}
diff --git a/src/AddIns/Misc/RegExpTk/Project/Src/Dialogs/MainWindow.cs b/src/AddIns/Misc/RegExpTk/Project/Src/Dialogs/MainWindow.cs
index 15a65d5b9a..bb3cc1ea55 100644
--- a/src/AddIns/Misc/RegExpTk/Project/Src/Dialogs/MainWindow.cs
+++ b/src/AddIns/Misc/RegExpTk/Project/Src/Dialogs/MainWindow.cs
@@ -131,7 +131,7 @@ namespace Plugins.RegExpTk {
void showGroupForm(Match match)
{
GroupForm groupform = new GroupForm(match);
- groupform.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
+ groupform.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window);
}
void GroupListView_MouseUp(object sender, MouseEventArgs e)
@@ -253,7 +253,7 @@ namespace Plugins.RegExpTk {
sfd.DefaultExt = "dll";
sfd.CheckPathExists = true;
- if (sfd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (sfd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
((TextBox)ControlDictionary["AssemblyFileCompileFileTextBox"]).Text = sfd.FileName;
}
}
diff --git a/src/AddIns/Misc/ResourceToolkit/Project/Src/CodeCompletion/NewResourceCodeCompletionData.cs b/src/AddIns/Misc/ResourceToolkit/Project/Src/CodeCompletion/NewResourceCodeCompletionData.cs
index fb54c1e626..adf93845b3 100644
--- a/src/AddIns/Misc/ResourceToolkit/Project/Src/CodeCompletion/NewResourceCodeCompletionData.cs
+++ b/src/AddIns/Misc/ResourceToolkit/Project/Src/CodeCompletion/NewResourceCodeCompletionData.cs
@@ -48,7 +48,7 @@ namespace Hornung.ResourceToolkit.CodeCompletion
EditStringResourceDialog dialog = new EditStringResourceDialog(this.content, this.preEnteredName, null, true);
dialog.Text = this.Description;
- if (dialog.ShowDialog(WorkbenchSingleton.MainForm) != DialogResult.OK) {
+ if (dialog.ShowDialog(WorkbenchSingleton.MainWin32Window) != DialogResult.OK) {
return false;
}
diff --git a/src/AddIns/Misc/ResourceToolkit/Project/Src/Commands/TextEditorContextMenuBuilder.cs b/src/AddIns/Misc/ResourceToolkit/Project/Src/Commands/TextEditorContextMenuBuilder.cs
index 10f9554fb4..e7949eb6db 100644
--- a/src/AddIns/Misc/ResourceToolkit/Project/Src/Commands/TextEditorContextMenuBuilder.cs
+++ b/src/AddIns/Misc/ResourceToolkit/Project/Src/Commands/TextEditorContextMenuBuilder.cs
@@ -100,7 +100,7 @@ namespace Hornung.ResourceToolkit.Commands
if (svalue == null) {
dialog.Text = String.Format(CultureInfo.CurrentCulture, StringParser.Parse("${res:Hornung.ResourceToolkit.CodeCompletion.AddNewDescription}"), result.ResourceFileContent.FileName);
}
- if (dialog.ShowDialog(WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (dialog.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
if (svalue == null) {
// Add new resource.
result.ResourceFileContent.Add(dialog.Key, dialog.Value);
diff --git a/src/AddIns/Misc/ResourceToolkit/Project/Src/Gui/UnusedResourceKeysViewContent.cs b/src/AddIns/Misc/ResourceToolkit/Project/Src/Gui/UnusedResourceKeysViewContent.cs
index 0205473941..19fddc7744 100644
--- a/src/AddIns/Misc/ResourceToolkit/Project/Src/Gui/UnusedResourceKeysViewContent.cs
+++ b/src/AddIns/Misc/ResourceToolkit/Project/Src/Gui/UnusedResourceKeysViewContent.cs
@@ -28,7 +28,7 @@ namespace Hornung.ResourceToolkit.Gui
ListView listView;
ToolStrip toolStrip;
- public override System.Windows.Forms.Control Control {
+ public override object Content {
get {
return this.panel;
}
diff --git a/src/AddIns/Misc/SearchAndReplace/Project/Commands/SearchToolbarCommands.cs b/src/AddIns/Misc/SearchAndReplace/Project/Commands/SearchToolbarCommands.cs
index 4c515e790b..e5a9e11b1c 100644
--- a/src/AddIns/Misc/SearchAndReplace/Project/Commands/SearchToolbarCommands.cs
+++ b/src/AddIns/Misc/SearchAndReplace/Project/Commands/SearchToolbarCommands.cs
@@ -6,9 +6,9 @@
//
using System;
-using System.Windows.Forms;
+using System.Windows.Controls;
using ICSharpCode.Core;
-using ICSharpCode.Core.WinForms;
+using System.Windows.Input;
namespace SearchAndReplace
{
@@ -18,6 +18,7 @@ namespace SearchAndReplace
public class FindComboBox : AbstractComboBoxCommand
{
ComboBox comboBox;
+
public FindComboBox()
{
}
@@ -31,9 +32,9 @@ namespace SearchAndReplace
comboBox.Text = SearchOptions.FindPattern;
}
- void OnKeyPress(object sender, KeyPressEventArgs e)
+ void OnKeyPress(object sender, KeyEventArgs e)
{
- if (e.KeyChar == '\r') {
+ if (e.Key == Key.Enter) {
CommitSearch();
e.Handled = true;
}
@@ -60,10 +61,10 @@ namespace SearchAndReplace
protected override void OnOwnerChanged(EventArgs e)
{
base.OnOwnerChanged(e);
- ToolBarComboBox toolbarItem = (ToolBarComboBox)Owner;
- comboBox = toolbarItem.ComboBox;
- comboBox.DropDownStyle = ComboBoxStyle.DropDown;
- comboBox.KeyPress += OnKeyPress;
+ comboBox = (ComboBox)Owner;
+ comboBox.IsEditable = true;
+ comboBox.KeyDown += OnKeyPress;
+ comboBox.Width = 130;
SearchOptions.Properties.PropertyChanged += new PropertyChangedEventHandler(SearchOptionsChanged);
RefreshComboBox();
diff --git a/src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchReplaceManager.cs b/src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchReplaceManager.cs
index daf014d8e6..b8cb6d186c 100644
--- a/src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchReplaceManager.cs
+++ b/src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchReplaceManager.cs
@@ -365,7 +365,7 @@ namespace SearchAndReplace
if (monitor != null && monitor.IsCancelled)
return;
if (monitor != null) monitor.ShowingDialog = true;
- MessageBox.Show(WorkbenchSingleton.MainForm,
+ MessageBox.Show(WorkbenchSingleton.MainWin32Window,
ResourceService.GetString("Dialog.NewProject.SearchReplace.SearchStringNotFound"),
ResourceService.GetString("Dialog.NewProject.SearchReplace.SearchStringNotFound.Title"),
MessageBoxButtons.OK,
diff --git a/src/AddIns/Misc/SearchAndReplace/Project/Gui/SearchAndReplaceDialog.cs b/src/AddIns/Misc/SearchAndReplace/Project/Gui/SearchAndReplaceDialog.cs
index 8c08a303a2..0e83d92e64 100644
--- a/src/AddIns/Misc/SearchAndReplace/Project/Gui/SearchAndReplaceDialog.cs
+++ b/src/AddIns/Misc/SearchAndReplace/Project/Gui/SearchAndReplaceDialog.cs
@@ -36,7 +36,7 @@ namespace SearchAndReplace
{
if (Instance == null) {
Instance = new SearchAndReplaceDialog(searchAndReplaceMode);
- Instance.Show(WorkbenchSingleton.MainForm);
+ Instance.Show(WorkbenchSingleton.MainWin32Window);
} else {
if (searchAndReplaceMode == SearchAndReplaceMode.Search) {
Instance.searchButton.PerformClick();
@@ -54,7 +54,6 @@ namespace SearchAndReplace
public SearchAndReplaceDialog(SearchAndReplaceMode searchAndReplaceMode)
{
- this.Owner = WorkbenchSingleton.MainForm;
this.FormBorderStyle = FormBorderStyle.FixedToolWindow;
this.ShowInTaskbar = false;
this.TopMost = false;
diff --git a/src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.csproj b/src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.csproj
index dd89831c99..43bcba59e6 100644
--- a/src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.csproj
+++ b/src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.csproj
@@ -36,6 +36,12 @@
+
+ 3.0
+
+
+ 3.0
+
3.5
@@ -44,6 +50,9 @@
+
+ 3.0
+
diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryView.cs b/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryView.cs
index c999c8b2b3..af1e577407 100644
--- a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryView.cs
+++ b/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryView.cs
@@ -15,7 +15,7 @@ namespace ICSharpCode.Svn
{
HistoryViewPanel historyViewPanel;
- public override Control Control {
+ public override object Content {
get {
return historyViewPanel;
}
diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/SvnGuiWrapper.cs b/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/SvnGuiWrapper.cs
index 592ae8c10b..ec893f3dbc 100644
--- a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/SvnGuiWrapper.cs
+++ b/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/SvnGuiWrapper.cs
@@ -11,6 +11,7 @@ using System.Text;
using System.Windows.Forms;
using ICSharpCode.Core;
+using ICSharpCode.SharpDevelop.Gui;
using Microsoft.Win32;
namespace ICSharpCode.Svn
@@ -46,7 +47,7 @@ namespace ICSharpCode.Svn
string path = GetPathFromRegistry("ProcPath");
if (path == null) {
using (TortoiseSvnNotFoundForm form = new TortoiseSvnNotFoundForm()) {
- form.ShowDialog();
+ form.ShowDialog(WorkbenchSingleton.MainWin32Window);
}
} else {
try {
diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Src/SvnClientWrapper.cs b/src/AddIns/Misc/SubversionAddIn/Project/Src/SvnClientWrapper.cs
index 51cb611f87..27e778f41c 100644
--- a/src/AddIns/Misc/SubversionAddIn/Project/Src/SvnClientWrapper.cs
+++ b/src/AddIns/Misc/SubversionAddIn/Project/Src/SvnClientWrapper.cs
@@ -225,7 +225,7 @@ namespace ICSharpCode.Svn
LoggingService.Debug("PasswordPrompt");
try {
using (LoginDialog loginDialog = new LoginDialog(realm.Value, username.Value, maySave)) {
- if (WorkbenchSingleton.SafeThreadFunction
diff --git a/src/Libraries/AvalonDock/AvalonDock.dll b/src/Libraries/AvalonDock/AvalonDock.dll
new file mode 100644
index 0000000000..44af72fa6a
Binary files /dev/null and b/src/Libraries/AvalonDock/AvalonDock.dll differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/AboutDialog.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/AboutDialog.Designer.cs
deleted file mode 100644
index f4f4a832bd..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/AboutDialog.Designer.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-namespace DockSample
-{
- partial class AboutDialog
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.buttonOK = new System.Windows.Forms.Button();
- this.label1 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.labelLibVersion = new System.Windows.Forms.Label();
- this.labelAppVersion = new System.Windows.Forms.Label();
- this.SuspendLayout();
- //
- // buttonOK
- //
- this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.buttonOK.Location = new System.Drawing.Point(240, 184);
- this.buttonOK.Name = "buttonOK";
- this.buttonOK.Size = new System.Drawing.Size(75, 23);
- this.buttonOK.TabIndex = 0;
- this.buttonOK.Text = "OK";
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(24, 59);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(109, 16);
- this.label1.TabIndex = 1;
- this.label1.Text = "DockSample Version:";
- //
- // label2
- //
- this.label2.Location = new System.Drawing.Point(24, 119);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(272, 32);
- this.label2.TabIndex = 2;
- this.label2.Text = "Copyright 2007, Weifen Luo";
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(24, 81);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(128, 13);
- this.label3.TabIndex = 3;
- this.label3.Text = "DockPanel Suite Version:";
- //
- // labelLibVersion
- //
- this.labelLibVersion.Location = new System.Drawing.Point(148, 81);
- this.labelLibVersion.Name = "labelLibVersion";
- this.labelLibVersion.Size = new System.Drawing.Size(97, 13);
- this.labelLibVersion.TabIndex = 4;
- //
- // labelAppVersion
- //
- this.labelAppVersion.Location = new System.Drawing.Point(129, 59);
- this.labelAppVersion.Name = "labelAppVersion";
- this.labelAppVersion.Size = new System.Drawing.Size(97, 13);
- this.labelAppVersion.TabIndex = 5;
- //
- // AboutDialog
- //
- this.AcceptButton = this.buttonOK;
- this.CancelButton = this.buttonOK;
- this.ClientSize = new System.Drawing.Size(322, 215);
- this.Controls.Add(this.labelAppVersion);
- this.Controls.Add(this.labelLibVersion);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.buttonOK);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "AboutDialog";
- this.ShowInTaskbar = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.Text = "About";
- this.Load += new System.EventHandler(this.AboutDialog_Load);
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
- #endregion
-
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Button buttonOK;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Label labelLibVersion;
- private System.Windows.Forms.Label labelAppVersion;
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/AboutDialog.cs b/src/Libraries/DockPanel_Src/DockSample/AboutDialog.cs
deleted file mode 100644
index c84735c1d6..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/AboutDialog.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using System.Reflection;
-using WeifenLuo.WinFormsUI.Docking;
-
-namespace DockSample
-{
- public partial class AboutDialog : Form
- {
- public AboutDialog()
- {
- InitializeComponent();
- }
-
- private void AboutDialog_Load(object sender, EventArgs e)
- {
- labelAppVersion.Text = typeof(MainForm).Assembly.GetName().Version.ToString();
- labelLibVersion.Text = typeof(DockPanel).Assembly.GetName().Version.ToString();
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/AboutDialog.resx b/src/Libraries/DockPanel_Src/DockSample/AboutDialog.resx
deleted file mode 100644
index 19dc0dd8b3..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/AboutDialog.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/DockHelper.cs b/src/Libraries/DockPanel_Src/DockSample/Customization/DockHelper.cs
deleted file mode 100644
index f5fbf3c50f..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Customization/DockHelper.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-using System;
-using System.Drawing;
-using System.Windows.Forms;
-using WeifenLuo.WinFormsUI.Docking;
-
-namespace DockSample.Customization
-{
- internal class DockHelper
- {
- public static bool IsDockStateAutoHide(DockState dockState)
- {
- if (dockState == DockState.DockLeftAutoHide ||
- dockState == DockState.DockRightAutoHide ||
- dockState == DockState.DockTopAutoHide ||
- dockState == DockState.DockBottomAutoHide)
- return true;
- else
- return false;
- }
-
- public static bool IsDockStateDocked(DockState dockState)
- {
- return (dockState == DockState.DockLeft ||
- dockState == DockState.DockRight ||
- dockState == DockState.DockTop ||
- dockState == DockState.DockBottom);
- }
-
- public static bool IsDockBottom(DockState dockState)
- {
- return (dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide) ? true : false;
- }
-
- public static bool IsDockLeft(DockState dockState)
- {
- return (dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide) ? true : false;
- }
-
- public static bool IsDockRight(DockState dockState)
- {
- return (dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide) ? true : false;
- }
-
- public static bool IsDockTop(DockState dockState)
- {
- return (dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide ) ? true : false;
- }
-
- public static bool IsDockStateValid(DockState dockState, DockAreas dockableAreas)
- {
- if (((dockableAreas & DockAreas.Float) == 0) &&
- (dockState == DockState.Float))
- return false;
- else if (((dockableAreas & DockAreas.Document) == 0) &&
- (dockState == DockState.Document))
- return false;
- else if (((dockableAreas & DockAreas.DockLeft) == 0) &&
- (dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide))
- return false;
- else if (((dockableAreas & DockAreas.DockRight) == 0) &&
- (dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide))
- return false;
- else if (((dockableAreas & DockAreas.DockTop) == 0) &&
- (dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide))
- return false;
- else if (((dockableAreas & DockAreas.DockBottom) == 0) &&
- (dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide))
- return false;
- else
- return true;
- }
-
- public static bool IsDockWindowState(DockState state)
- {
- if (state == DockState.DockTop || state == DockState.DockBottom || state == DockState.DockLeft ||
- state == DockState.DockRight || state == DockState.Document)
- return true;
- else
- return false;
- }
-
- public static bool IsValidRestoreState(DockState state)
- {
- if (state == DockState.DockLeft || state == DockState.DockRight || state == DockState.DockTop ||
- state == DockState.DockBottom || state == DockState.Document)
- return true;
- else
- return false;
- }
-
- public static DockState ToggleAutoHideState(DockState state)
- {
- if (state == DockState.DockLeft)
- return DockState.DockLeftAutoHide;
- else if (state == DockState.DockRight)
- return DockState.DockRightAutoHide;
- else if (state == DockState.DockTop)
- return DockState.DockTopAutoHide;
- else if (state == DockState.DockBottom)
- return DockState.DockBottomAutoHide;
- else if (state == DockState.DockLeftAutoHide)
- return DockState.DockLeft;
- else if (state == DockState.DockRightAutoHide)
- return DockState.DockRight;
- else if (state == DockState.DockTopAutoHide)
- return DockState.DockTop;
- else if (state == DockState.DockBottomAutoHide)
- return DockState.DockBottom;
- else
- return state;
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Extender.cs b/src/Libraries/DockPanel_Src/DockSample/Customization/Extender.cs
deleted file mode 100644
index 180ecb84f1..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Customization/Extender.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System;
-using System.Drawing;
-using WeifenLuo.WinFormsUI.Docking;
-
-namespace DockSample.Customization
-{
- public class Extender
- {
- public enum Schema
- {
- VS2005,
- VS2003
- }
-
- private class VS2003DockPaneStripFactory : DockPanelExtender.IDockPaneStripFactory
- {
- public DockPaneStripBase CreateDockPaneStrip(DockPane pane)
- {
- return new VS2003DockPaneStrip(pane);
- }
- }
-
- private class VS2003AutoHideStripFactory : DockPanelExtender.IAutoHideStripFactory
- {
- public AutoHideStripBase CreateAutoHideStrip(DockPanel panel)
- {
- return new VS2003AutoHideStrip(panel);
- }
- }
-
- private class VS2003DockPaneCaptionFactory : DockPanelExtender.IDockPaneCaptionFactory
- {
- public DockPaneCaptionBase CreateDockPaneCaption(DockPane pane)
- {
- return new VS2003DockPaneCaption(pane);
- }
- }
-
- public static void SetSchema(DockPanel dockPanel, Extender.Schema schema)
- {
- if (schema == Extender.Schema.VS2005)
- {
- dockPanel.Extender.AutoHideStripFactory = null;
- dockPanel.Extender.DockPaneCaptionFactory = null;
- dockPanel.Extender.DockPaneStripFactory = null;
- }
- else if (schema == Extender.Schema.VS2003)
- {
- dockPanel.Extender.DockPaneCaptionFactory = new VS2003DockPaneCaptionFactory();
- dockPanel.Extender.AutoHideStripFactory = new VS2003AutoHideStripFactory();
- dockPanel.Extender.DockPaneStripFactory = new VS2003DockPaneStripFactory();
- }
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/InertButton.cs b/src/Libraries/DockPanel_Src/DockSample/Customization/InertButton.cs
deleted file mode 100644
index 6846fee140..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Customization/InertButton.cs
+++ /dev/null
@@ -1,619 +0,0 @@
-using System;
-using System.Drawing;
-using System.Drawing.Imaging;
-using System.Windows.Forms;
-using System.ComponentModel;
-
-namespace DockSample.Customization
-{
- internal class InertButton : Button
- {
- private enum RepeatClickStatus
- {
- Disabled,
- Started,
- Repeating,
- Stopped
- }
-
- private class RepeatClickEventArgs : EventArgs
- {
- private static RepeatClickEventArgs _empty;
-
- static RepeatClickEventArgs()
- {
- _empty = new RepeatClickEventArgs();
- }
-
- public new static RepeatClickEventArgs Empty
- {
- get { return _empty; }
- }
- }
-
- private IContainer components = new Container();
- private int m_borderWidth = 1;
- private bool m_mouseOver = false;
- private bool m_mouseCapture = false;
- private bool m_isPopup = false;
- private Image m_imageEnabled = null;
- private Image m_imageDisabled = null;
- private int m_imageIndexEnabled = -1;
- private int m_imageIndexDisabled = -1;
- private bool m_monochrom = true;
- private ToolTip m_toolTip = null;
- private string m_toolTipText = "";
- private Color m_borderColor = Color.Empty;
-
- public InertButton()
- {
- InternalConstruct(null, null);
- }
-
- public InertButton(Image imageEnabled)
- {
- InternalConstruct(imageEnabled, null);
- }
-
- public InertButton(Image imageEnabled, Image imageDisabled)
- {
- InternalConstruct(imageEnabled, imageDisabled);
- }
-
- private void InternalConstruct(Image imageEnabled, Image imageDisabled)
- {
- // Remember parameters
- ImageEnabled = imageEnabled;
- ImageDisabled = imageDisabled;
-
- // Prevent drawing flicker by blitting from memory in WM_PAINT
- SetStyle(ControlStyles.ResizeRedraw, true);
- SetStyle(ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.AllPaintingInWmPaint, true);
-
- // Prevent base class from trying to generate double click events and
- // so testing clicks against the double click time and rectangle. Getting
- // rid of this allows the user to press then release button very quickly.
- //SetStyle(ControlStyles.StandardDoubleClick, false);
-
- // Should not be allowed to select this control
- SetStyle(ControlStyles.Selectable, false);
-
- m_timer = new Timer();
- m_timer.Enabled = false;
- m_timer.Tick += new EventHandler(Timer_Tick);
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- if (components != null)
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- public Color BorderColor
- {
- get { return m_borderColor; }
- set
- {
- if (m_borderColor != value)
- {
- m_borderColor = value;
- Invalidate();
- }
- }
- }
-
- private bool ShouldSerializeBorderColor()
- {
- return (m_borderColor != Color.Empty);
- }
-
- public int BorderWidth
- {
- get { return m_borderWidth; }
-
- set
- {
- if (value < 1)
- value = 1;
- if (m_borderWidth != value)
- {
- m_borderWidth = value;
- Invalidate();
- }
- }
- }
-
- public Image ImageEnabled
- {
- get
- {
- if (m_imageEnabled != null)
- return m_imageEnabled;
-
- try
- {
- if (ImageList == null || ImageIndexEnabled == -1)
- return null;
- else
- return ImageList.Images[m_imageIndexEnabled];
- }
- catch
- {
- return null;
- }
- }
-
- set
- {
- if (m_imageEnabled != value)
- {
- m_imageEnabled = value;
- Invalidate();
- }
- }
- }
-
- private bool ShouldSerializeImageEnabled()
- {
- return (m_imageEnabled != null);
- }
-
- public Image ImageDisabled
- {
- get
- {
- if (m_imageDisabled != null)
- return m_imageDisabled;
-
- try
- {
- if (ImageList == null || ImageIndexDisabled == -1)
- return null;
- else
- return ImageList.Images[m_imageIndexDisabled];
- }
- catch
- {
- return null;
- }
- }
-
- set
- {
- if (m_imageDisabled != value)
- {
- m_imageDisabled = value;
- Invalidate();
- }
- }
- }
-
- public int ImageIndexEnabled
- {
- get { return m_imageIndexEnabled; }
- set
- {
- if (m_imageIndexEnabled != value)
- {
- m_imageIndexEnabled = value;
- Invalidate();
- }
- }
- }
-
- public int ImageIndexDisabled
- {
- get { return m_imageIndexDisabled; }
- set
- {
- if (m_imageIndexDisabled != value)
- {
- m_imageIndexDisabled = value;
- Invalidate();
- }
- }
- }
-
- public bool IsPopup
- {
- get { return m_isPopup; }
-
- set
- {
- if (m_isPopup != value)
- {
- m_isPopup = value;
- Invalidate();
- }
- }
- }
-
- public bool Monochrome
- {
- get { return m_monochrom; }
- set
- {
- if (value != m_monochrom)
- {
- m_monochrom = value;
- Invalidate();
- }
- }
- }
-
- public bool RepeatClick
- {
- get { return (ClickStatus != RepeatClickStatus.Disabled); }
- set { ClickStatus = RepeatClickStatus.Stopped; }
- }
-
- private RepeatClickStatus m_clickStatus = RepeatClickStatus.Disabled;
- private RepeatClickStatus ClickStatus
- {
- get { return m_clickStatus; }
- set
- {
- if (m_clickStatus == value)
- return;
-
- m_clickStatus = value;
- if (ClickStatus == RepeatClickStatus.Started)
- {
- Timer.Interval = RepeatClickDelay;
- Timer.Enabled = true;
- }
- else if (ClickStatus == RepeatClickStatus.Repeating)
- Timer.Interval = RepeatClickInterval;
- else
- Timer.Enabled = false;
- }
- }
-
- private int m_repeatClickDelay = 500;
- public int RepeatClickDelay
- {
- get { return m_repeatClickDelay; }
- set { m_repeatClickDelay = value; }
- }
-
- private int m_repeatClickInterval = 100;
- public int RepeatClickInterval
- {
- get { return m_repeatClickInterval; }
- set { m_repeatClickInterval = value; }
- }
-
- private Timer m_timer;
- private Timer Timer
- {
- get { return m_timer; }
- }
-
- public string ToolTipText
- {
- get { return m_toolTipText; }
- set
- {
- if (m_toolTipText != value)
- {
- if (m_toolTip == null)
- m_toolTip = new ToolTip(this.components);
- m_toolTipText = value;
- m_toolTip.SetToolTip(this, value);
- }
- }
- }
-
- private void Timer_Tick(object sender, EventArgs e)
- {
- if (m_mouseCapture && m_mouseOver)
- OnClick(RepeatClickEventArgs.Empty);
- if (ClickStatus == RepeatClickStatus.Started)
- ClickStatus = RepeatClickStatus.Repeating;
- }
-
- ///
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
-
- if (e.Button != MouseButtons.Left)
- return;
-
- if (m_mouseCapture == false || m_mouseOver == false)
- {
- m_mouseCapture = true;
- m_mouseOver = true;
-
- //Redraw to show button state
- Invalidate();
- }
-
- if (RepeatClick)
- {
- OnClick(RepeatClickEventArgs.Empty);
- ClickStatus = RepeatClickStatus.Started;
- }
- }
-
- ///
- protected override void OnClick(EventArgs e)
- {
- if (RepeatClick && !(e is RepeatClickEventArgs))
- return;
-
- base.OnClick (e);
- }
-
- ///
- protected override void OnMouseUp(MouseEventArgs e)
- {
- base.OnMouseUp(e);
-
- if (e.Button != MouseButtons.Left)
- return;
-
- if (m_mouseOver == true || m_mouseCapture == true)
- {
- m_mouseOver = false;
- m_mouseCapture = false;
-
- // Redraw to show button state
- Invalidate();
- }
-
- if (RepeatClick)
- ClickStatus = RepeatClickStatus.Stopped;
- }
-
- ///
- protected override void OnMouseMove(MouseEventArgs e)
- {
- base.OnMouseMove(e);
-
- // Is mouse point inside our client rectangle
- bool over = this.ClientRectangle.Contains(new Point(e.X, e.Y));
-
- // If entering the button area or leaving the button area...
- if (over != m_mouseOver)
- {
- // Update state
- m_mouseOver = over;
-
- // Redraw to show button state
- Invalidate();
- }
- }
-
- ///
- protected override void OnMouseEnter(EventArgs e)
- {
- // Update state to reflect mouse over the button area
- if (!m_mouseOver)
- {
- m_mouseOver = true;
-
- // Redraw to show button state
- Invalidate();
- }
-
- base.OnMouseEnter(e);
- }
-
- ///
- protected override void OnMouseLeave(EventArgs e)
- {
- // Update state to reflect mouse not over the button area
- if (m_mouseOver)
- {
- m_mouseOver = false;
-
- // Redraw to show button state
- Invalidate();
- }
-
- base.OnMouseLeave(e);
- }
-
- ///
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- DrawBackground(e.Graphics);
- DrawImage(e.Graphics);
- DrawText(e.Graphics);
- DrawBorder(e.Graphics);
- }
-
- private void DrawBackground(Graphics g)
- {
- using (SolidBrush brush = new SolidBrush(BackColor))
- {
- g.FillRectangle(brush, ClientRectangle);
- }
- }
-
- private void DrawImage(Graphics g)
- {
- Image image = this.Enabled ? ImageEnabled : ((ImageDisabled != null) ? ImageDisabled : ImageEnabled);
- ImageAttributes imageAttr = null;
-
- if (null == image)
- return;
-
- if (m_monochrom)
- {
- imageAttr = new ImageAttributes();
-
- // transform the monochrom image
- // white -> BackColor
- // black -> ForeColor
- ColorMap[] colorMap = new ColorMap[2];
- colorMap[0] = new ColorMap();
- colorMap[0].OldColor = Color.White;
- colorMap[0].NewColor = this.BackColor;
- colorMap[1] = new ColorMap();
- colorMap[1].OldColor = Color.Black;
- colorMap[1].NewColor = this.ForeColor;
- imageAttr.SetRemapTable(colorMap);
- }
-
- Rectangle rect = new Rectangle(0, 0, image.Width, image.Height);
-
- if ((!Enabled) && (null == ImageDisabled))
- {
- using (Bitmap bitmapMono = new Bitmap(image, ClientRectangle.Size))
- {
- if (imageAttr != null)
- {
- using (Graphics gMono = Graphics.FromImage(bitmapMono))
- {
- gMono.DrawImage(image, new Point[3] { new Point(0, 0), new Point(image.Width - 1, 0), new Point(0, image.Height - 1) }, rect, GraphicsUnit.Pixel, imageAttr);
- }
- }
- ControlPaint.DrawImageDisabled(g, bitmapMono, 0, 0, this.BackColor);
- }
- }
- else
- {
- // Three points provided are upper-left, upper-right and
- // lower-left of the destination parallelogram.
- Point[] pts = new Point[3];
- pts[0].X = (Enabled && m_mouseOver && m_mouseCapture) ? 1 : 0;
- pts[0].Y = (Enabled && m_mouseOver && m_mouseCapture) ? 1 : 0;
- pts[1].X = pts[0].X + ClientRectangle.Width;
- pts[1].Y = pts[0].Y;
- pts[2].X = pts[0].X;
- pts[2].Y = pts[1].Y + ClientRectangle.Height;
-
- if (imageAttr == null)
- g.DrawImage(image, pts, rect, GraphicsUnit.Pixel);
- else
- g.DrawImage(image, pts, rect, GraphicsUnit.Pixel, imageAttr);
- }
- }
-
- private void DrawText(Graphics g)
- {
- if (Text == string.Empty)
- return;
-
- Rectangle rect = ClientRectangle;
-
- rect.X += BorderWidth;
- rect.Y += BorderWidth;
- rect.Width -= 2 * BorderWidth;
- rect.Height -= 2 * BorderWidth;
-
- StringFormat stringFormat = new StringFormat();
-
- if (TextAlign == ContentAlignment.TopLeft)
- {
- stringFormat.Alignment = StringAlignment.Near;
- stringFormat.LineAlignment = StringAlignment.Near;
- }
- else if (TextAlign == ContentAlignment.TopCenter)
- {
- stringFormat.Alignment = StringAlignment.Center;
- stringFormat.LineAlignment = StringAlignment.Near;
- }
- else if (TextAlign == ContentAlignment.TopRight)
- {
- stringFormat.Alignment = StringAlignment.Far;
- stringFormat.LineAlignment = StringAlignment.Near;
- }
- else if (TextAlign == ContentAlignment.MiddleLeft)
- {
- stringFormat.Alignment = StringAlignment.Near;
- stringFormat.LineAlignment = StringAlignment.Center;
- }
- else if (TextAlign == ContentAlignment.MiddleCenter)
- {
- stringFormat.Alignment = StringAlignment.Center;
- stringFormat.LineAlignment = StringAlignment.Center;
- }
- else if (TextAlign == ContentAlignment.MiddleRight)
- {
- stringFormat.Alignment = StringAlignment.Far;
- stringFormat.LineAlignment = StringAlignment.Center;
- }
- else if (TextAlign == ContentAlignment.BottomLeft)
- {
- stringFormat.Alignment = StringAlignment.Near;
- stringFormat.LineAlignment = StringAlignment.Far;
- }
- else if (TextAlign == ContentAlignment.BottomCenter)
- {
- stringFormat.Alignment = StringAlignment.Center;
- stringFormat.LineAlignment = StringAlignment.Far;
- }
- else if (TextAlign == ContentAlignment.BottomRight)
- {
- stringFormat.Alignment = StringAlignment.Far;
- stringFormat.LineAlignment = StringAlignment.Far;
- }
-
- using (Brush brush = new SolidBrush(ForeColor))
- {
- g.DrawString(Text, Font, brush, rect, stringFormat);
- }
- }
-
- private void DrawBorder(Graphics g)
- {
- ButtonBorderStyle bs;
-
- // Decide on the type of border to draw around image
- if (!this.Enabled)
- bs = IsPopup ? ButtonBorderStyle.Outset : ButtonBorderStyle.Solid;
- else if (m_mouseOver && m_mouseCapture)
- bs = ButtonBorderStyle.Inset;
- else if (IsPopup || m_mouseOver)
- bs = ButtonBorderStyle.Outset;
- else
- bs = ButtonBorderStyle.Solid;
-
- Color colorLeftTop;
- Color colorRightBottom;
- if (bs == ButtonBorderStyle.Solid)
- {
- colorLeftTop = this.BackColor;
- colorRightBottom = this.BackColor;
- }
- else if (bs == ButtonBorderStyle.Outset)
- {
- colorLeftTop = m_borderColor.IsEmpty ? this.BackColor : m_borderColor;
- colorRightBottom = this.BackColor;
- }
- else
- {
- colorLeftTop = this.BackColor;
- colorRightBottom = m_borderColor.IsEmpty ? this.BackColor : m_borderColor;
- }
- ControlPaint.DrawBorder(g, this.ClientRectangle,
- colorLeftTop, m_borderWidth, bs,
- colorLeftTop, m_borderWidth, bs,
- colorRightBottom, m_borderWidth, bs,
- colorRightBottom, m_borderWidth, bs);
- }
-
- ///
- protected override void OnEnabledChanged(EventArgs e)
- {
- base.OnEnabledChanged(e);
- if (Enabled == false)
- {
- m_mouseOver = false;
- m_mouseCapture = false;
- if (RepeatClick && ClickStatus != RepeatClickStatus.Stopped)
- ClickStatus = RepeatClickStatus.Stopped;
- }
- Invalidate();
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources.Designer.cs
deleted file mode 100644
index 2e92d03e42..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources.Designer.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.42
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace DockSample.Customization {
- 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("DockSample.Customization.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;
- }
- }
-
- internal static System.Drawing.Bitmap DockPaneCaption_AutoHideNo {
- get {
- object obj = ResourceManager.GetObject("DockPaneCaption_AutoHideNo", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPaneCaption_AutoHideYes {
- get {
- object obj = ResourceManager.GetObject("DockPaneCaption_AutoHideYes", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPaneCaption_CloseDisabled {
- get {
- object obj = ResourceManager.GetObject("DockPaneCaption_CloseDisabled", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPaneCaption_CloseEnabled {
- get {
- object obj = ResourceManager.GetObject("DockPaneCaption_CloseEnabled", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPaneStrip_CloseDisabled {
- get {
- object obj = ResourceManager.GetObject("DockPaneStrip_CloseDisabled", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPaneStrip_CloseEnabled {
- get {
- object obj = ResourceManager.GetObject("DockPaneStrip_CloseEnabled", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPaneStrip_ScrollLeftDisabled {
- get {
- object obj = ResourceManager.GetObject("DockPaneStrip_ScrollLeftDisabled", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPaneStrip_ScrollLeftEnabled {
- get {
- object obj = ResourceManager.GetObject("DockPaneStrip_ScrollLeftEnabled", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPaneStrip_ScrollRightDisabled {
- get {
- object obj = ResourceManager.GetObject("DockPaneStrip_ScrollRightDisabled", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPaneStrip_ScrollRightEnabled {
- get {
- object obj = ResourceManager.GetObject("DockPaneStrip_ScrollRightEnabled", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources.resx b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources.resx
deleted file mode 100644
index 37c6946b13..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources.resx
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
-
- Resources\DockPaneCaption_AutoHideNo.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockPaneCaption_AutoHideYes.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockPaneCaption_CloseDisabled.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockPaneCaption_CloseEnabled.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockPaneStrip_CloseDisabled.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockPaneStrip_CloseEnabled.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockPaneStrip_ScrollLeftDisabled.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockPaneStrip_ScrollLeftEnabled.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockPaneStrip_ScrollRightDisabled.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockPaneStrip_ScrollRightEnabled.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond.bmp
deleted file mode 100644
index 70e70e288d..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Bottom.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Bottom.bmp
deleted file mode 100644
index d95ec69720..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Bottom.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Hotspot.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Hotspot.bmp
deleted file mode 100644
index e801d382d7..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Hotspot.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_HotspotIndex.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_HotspotIndex.bmp
deleted file mode 100644
index e5ef472c56..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_HotspotIndex.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Left.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Left.bmp
deleted file mode 100644
index 1fbda61c08..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Left.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Right.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Right.bmp
deleted file mode 100644
index 1de97a0986..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Right.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Top.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Top.bmp
deleted file mode 100644
index 95122a0f31..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PaneDiamond_Top.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelBottom.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelBottom.bmp
deleted file mode 100644
index ad851ea183..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelBottom.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelBottom_Active.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelBottom_Active.bmp
deleted file mode 100644
index 212fb0d366..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelBottom_Active.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelFill.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelFill.bmp
deleted file mode 100644
index 21a1b274d7..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelFill.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelFill_Active.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelFill_Active.bmp
deleted file mode 100644
index d58b00f9df..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelFill_Active.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelLeft.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelLeft.bmp
deleted file mode 100644
index 551fd88624..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelLeft.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelLeft_Active.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelLeft_Active.bmp
deleted file mode 100644
index 5182318ed3..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelLeft_Active.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelRight.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelRight.bmp
deleted file mode 100644
index 003cbb02a6..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelRight.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelRight_Active.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelRight_Active.bmp
deleted file mode 100644
index dad423551d..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelRight_Active.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelTop.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelTop.bmp
deleted file mode 100644
index f6293fd2bc..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelTop.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelTop_Active.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelTop_Active.bmp
deleted file mode 100644
index 563549eba1..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockIndicator_PanelTop_Active.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneCaption_AutoHideNo.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneCaption_AutoHideNo.bmp
deleted file mode 100644
index e952891bd4..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneCaption_AutoHideNo.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneCaption_AutoHideYes.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneCaption_AutoHideYes.bmp
deleted file mode 100644
index 3a35479a4d..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneCaption_AutoHideYes.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneCaption_CloseDisabled.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneCaption_CloseDisabled.bmp
deleted file mode 100644
index 98fb0f8b00..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneCaption_CloseDisabled.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneCaption_CloseEnabled.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneCaption_CloseEnabled.bmp
deleted file mode 100644
index 98fb0f8b00..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneCaption_CloseEnabled.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_CloseDisabled.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_CloseDisabled.bmp
deleted file mode 100644
index 98fb0f8b00..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_CloseDisabled.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_CloseEnabled.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_CloseEnabled.bmp
deleted file mode 100644
index 98fb0f8b00..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_CloseEnabled.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_ScrollLeftDisabled.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_ScrollLeftDisabled.bmp
deleted file mode 100644
index 09fd995749..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_ScrollLeftDisabled.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_ScrollLeftEnabled.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_ScrollLeftEnabled.bmp
deleted file mode 100644
index a1b0adf897..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_ScrollLeftEnabled.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_ScrollRightDisabled.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_ScrollRightDisabled.bmp
deleted file mode 100644
index 8447040537..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_ScrollRightDisabled.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_ScrollRightEnabled.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_ScrollRightEnabled.bmp
deleted file mode 100644
index a2969616b6..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/DockPaneStrip_ScrollRightEnabled.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/Dockindicator_PaneDiamond_Fill.bmp b/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/Dockindicator_PaneDiamond_Fill.bmp
deleted file mode 100644
index cbe0a156ab..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Customization/Resources/Dockindicator_PaneDiamond_Fill.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Strings.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/Customization/Strings.Designer.cs
deleted file mode 100644
index 062531ea21..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Customization/Strings.Designer.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.42
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace DockSample.Customization {
- 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 Strings {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Strings() {
- }
-
- ///
- /// 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("DockSample.Customization.Strings", typeof(Strings).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;
- }
- }
-
- ///
- /// Looks up a localized string similar to Auto Hide.
- ///
- internal static string DockPaneCaption_ToolTipAutoHide {
- get {
- return ResourceManager.GetString("DockPaneCaption_ToolTipAutoHide", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Close.
- ///
- internal static string DockPaneCaption_ToolTipClose {
- get {
- return ResourceManager.GetString("DockPaneCaption_ToolTipClose", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Close.
- ///
- internal static string DockPaneStrip_ToolTipClose {
- get {
- return ResourceManager.GetString("DockPaneStrip_ToolTipClose", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Scroll Left.
- ///
- internal static string DockPaneStrip_ToolTipScrollLeft {
- get {
- return ResourceManager.GetString("DockPaneStrip_ToolTipScrollLeft", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Scroll Right.
- ///
- internal static string DockPaneStrip_ToolTipScrollRight {
- get {
- return ResourceManager.GetString("DockPaneStrip_ToolTipScrollRight", resourceCulture);
- }
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/Strings.resx b/src/Libraries/DockPanel_Src/DockSample/Customization/Strings.resx
deleted file mode 100644
index 72b3d85bd7..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Customization/Strings.resx
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- Auto Hide
-
-
- Close
-
-
- Close
-
-
- Scroll Left
-
-
- Scroll Right
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/VS2003AutoHideStrip.cs b/src/Libraries/DockPanel_Src/DockSample/Customization/VS2003AutoHideStrip.cs
deleted file mode 100644
index 14ce75286e..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Customization/VS2003AutoHideStrip.cs
+++ /dev/null
@@ -1,507 +0,0 @@
-using System;
-using System.Drawing;
-using System.Windows.Forms;
-using System.Drawing.Drawing2D;
-using System.ComponentModel;
-using WeifenLuo.WinFormsUI.Docking;
-
-namespace DockSample.Customization
-{
- ///
- internal class VS2003AutoHideStrip : AutoHideStripBase
- {
- private class TabVS2003 : Tab
- {
- internal TabVS2003(IDockContent content)
- : base(content)
- {
- }
-
- private int m_tabX = 0;
- protected internal int TabX
- {
- get { return m_tabX; }
- set { m_tabX = value; }
- }
-
- private int m_tabWidth = 0;
- protected internal int TabWidth
- {
- get { return m_tabWidth; }
- set { m_tabWidth = value; }
- }
-
- }
-
- private const int _ImageHeight = 16;
- private const int _ImageWidth = 16;
- private const int _ImageGapTop = 2;
- private const int _ImageGapLeft = 4;
- private const int _ImageGapRight = 4;
- private const int _ImageGapBottom = 2;
- private const int _TextGapLeft = 4;
- private const int _TextGapRight = 10;
- private const int _TabGapTop = 3;
- private const int _TabGapLeft = 2;
- private const int _TabGapBetween = 10;
-
- private static Matrix _matrixIdentity;
- private static DockState[] _dockStates;
-
- #region Customizable Properties
- private static StringFormat _stringFormatTabHorizontal = null;
- ///
- protected virtual StringFormat StringFormatTabHorizontal
- {
- get
- {
- if (_stringFormatTabHorizontal == null)
- {
- _stringFormatTabHorizontal = new StringFormat();
- _stringFormatTabHorizontal.Alignment = StringAlignment.Near;
- _stringFormatTabHorizontal.LineAlignment = StringAlignment.Center;
- _stringFormatTabHorizontal.FormatFlags = StringFormatFlags.NoWrap;
- }
- return _stringFormatTabHorizontal;
- }
- }
-
- private static StringFormat _stringFormatTabVertical;
- ///
- protected virtual StringFormat StringFormatTabVertical
- {
- get
- {
- if (_stringFormatTabVertical == null)
- {
- _stringFormatTabVertical = new StringFormat();
- _stringFormatTabVertical.Alignment = StringAlignment.Near;
- _stringFormatTabVertical.LineAlignment = StringAlignment.Center;
- _stringFormatTabVertical.FormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.DirectionVertical;
- }
- return _stringFormatTabVertical;
- }
- }
-
- ///
- protected virtual int ImageHeight
- {
- get { return _ImageHeight; }
- }
-
- ///
- protected virtual int ImageWidth
- {
- get { return _ImageWidth; }
- }
-
- ///
- protected virtual int ImageGapTop
- {
- get { return _ImageGapTop; }
- }
-
- ///
- protected virtual int ImageGapLeft
- {
- get { return _ImageGapLeft; }
- }
-
- ///
- protected virtual int ImageGapRight
- {
- get { return _ImageGapRight; }
- }
-
- ///
- protected virtual int ImageGapBottom
- {
- get { return _ImageGapBottom; }
- }
-
- ///
- protected virtual int TextGapLeft
- {
- get { return _TextGapLeft; }
- }
-
- ///
- protected virtual int TextGapRight
- {
- get { return _TextGapRight; }
- }
-
- ///
- protected virtual int TabGapTop
- {
- get { return _TabGapTop; }
- }
-
- ///
- protected virtual int TabGapLeft
- {
- get { return _TabGapLeft; }
- }
-
- ///
- protected virtual int TabGapBetween
- {
- get { return _TabGapBetween; }
- }
-
- ///
- protected virtual Brush BrushTabBackground
- {
- get { return SystemBrushes.Control; }
- }
-
- ///
- protected virtual Pen PenTabBorder
- {
- get { return SystemPens.GrayText; }
- }
-
- ///
- protected virtual Brush BrushTabText
- {
- get { return SystemBrushes.FromSystemColor(SystemColors.ControlDarkDark); }
- }
- #endregion
-
- private Matrix MatrixIdentity
- {
- get { return _matrixIdentity; }
- }
-
- private DockState[] DockStates
- {
- get { return _dockStates; }
- }
-
- static VS2003AutoHideStrip()
- {
- _matrixIdentity = new Matrix();
-
- _dockStates = new DockState[4];
- _dockStates[0] = DockState.DockLeftAutoHide;
- _dockStates[1] = DockState.DockRightAutoHide;
- _dockStates[2] = DockState.DockTopAutoHide;
- _dockStates[3] = DockState.DockBottomAutoHide;
- }
-
- public VS2003AutoHideStrip(DockPanel panel) : base(panel)
- {
- SetStyle(ControlStyles.ResizeRedraw, true);
- SetStyle(ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.AllPaintingInWmPaint, true);
- BackColor = Color.WhiteSmoke;
- }
-
- ///
- protected override void OnPaint(PaintEventArgs e)
- {
- Graphics g = e.Graphics;
- DrawTabStrip(g);
- }
-
- ///
- protected override void OnLayout(LayoutEventArgs levent)
- {
- CalculateTabs();
- base.OnLayout (levent);
- }
-
- private void DrawTabStrip(Graphics g)
- {
- DrawTabStrip(g, DockState.DockTopAutoHide);
- DrawTabStrip(g, DockState.DockBottomAutoHide);
- DrawTabStrip(g, DockState.DockLeftAutoHide);
- DrawTabStrip(g, DockState.DockRightAutoHide);
- }
-
- private void DrawTabStrip(Graphics g, DockState dockState)
- {
- Rectangle rectTabStrip = GetLogicalTabStripRectangle(dockState);
-
- if (rectTabStrip.IsEmpty)
- return;
-
- Matrix matrixIdentity = g.Transform;
- if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide)
- {
- Matrix matrixRotated = new Matrix();
- matrixRotated.RotateAt(90, new PointF((float)rectTabStrip.X + (float)rectTabStrip.Height / 2,
- (float)rectTabStrip.Y + (float)rectTabStrip.Height / 2));
- g.Transform = matrixRotated;
- }
-
- foreach (Pane pane in GetPanes(dockState))
- {
- foreach (TabVS2003 tab in pane.AutoHideTabs)
- DrawTab(g, tab);
- }
- g.Transform = matrixIdentity;
- }
-
- private void CalculateTabs()
- {
- CalculateTabs(DockState.DockTopAutoHide);
- CalculateTabs(DockState.DockBottomAutoHide);
- CalculateTabs(DockState.DockLeftAutoHide);
- CalculateTabs(DockState.DockRightAutoHide);
- }
-
- private void CalculateTabs(DockState dockState)
- {
- Rectangle rectTabStrip = GetLogicalTabStripRectangle(dockState);
-
- int imageHeight = rectTabStrip.Height - ImageGapTop - ImageGapBottom;
- int imageWidth = ImageWidth;
- if (imageHeight > ImageHeight)
- imageWidth = ImageWidth * (imageHeight/ImageHeight);
-
- using (Graphics g = CreateGraphics())
- {
- int x = TabGapLeft + rectTabStrip.X;
- foreach (Pane pane in GetPanes(dockState))
- {
- int maxWidth = 0;
- foreach (TabVS2003 tab in pane.AutoHideTabs)
- {
- int width = imageWidth + ImageGapLeft + ImageGapRight +
- (int)g.MeasureString(tab.Content.DockHandler.TabText, Font).Width + 1 +
- TextGapLeft + TextGapRight;
- if (width > maxWidth)
- maxWidth = width;
- }
-
- foreach (TabVS2003 tab in pane.AutoHideTabs)
- {
- tab.TabX = x;
- if (tab.Content == pane.DockPane.ActiveContent)
- tab.TabWidth = maxWidth;
- else
- tab.TabWidth = imageWidth + ImageGapLeft + ImageGapRight;
- x += tab.TabWidth;
- }
- x += TabGapBetween;
- }
- }
- }
-
- private void DrawTab(Graphics g, TabVS2003 tab)
- {
- Rectangle rectTab = GetTabRectangle(tab);
- if (rectTab.IsEmpty)
- return;
-
- DockState dockState = tab.Content.DockHandler.DockState;
- IDockContent content = tab.Content;
-
- OnBeginDrawTab(tab);
-
- Brush brushTabBackGround = BrushTabBackground;
- Pen penTabBorder = PenTabBorder;
- Brush brushTabText = BrushTabText;
-
- g.FillRectangle(brushTabBackGround, rectTab);
-
- g.DrawLine(penTabBorder, rectTab.Left, rectTab.Top, rectTab.Left, rectTab.Bottom);
- g.DrawLine(penTabBorder, rectTab.Right, rectTab.Top, rectTab.Right, rectTab.Bottom);
- if (dockState == DockState.DockTopAutoHide || dockState == DockState.DockRightAutoHide)
- g.DrawLine(penTabBorder, rectTab.Left, rectTab.Bottom, rectTab.Right, rectTab.Bottom);
- else
- g.DrawLine(penTabBorder, rectTab.Left, rectTab.Top, rectTab.Right, rectTab.Top);
-
- // Set no rotate for drawing icon and text
- Matrix matrixRotate = g.Transform;
- g.Transform = MatrixIdentity;
-
- // Draw the icon
- Rectangle rectImage = rectTab;
- rectImage.X += ImageGapLeft;
- rectImage.Y += ImageGapTop;
- int imageHeight = rectTab.Height - ImageGapTop - ImageGapBottom;
- int imageWidth = ImageWidth;
- if (imageHeight > ImageHeight)
- imageWidth = ImageWidth * (imageHeight/ImageHeight);
- rectImage.Height = imageHeight;
- rectImage.Width = imageWidth;
- rectImage = GetTransformedRectangle(dockState, rectImage);
- g.DrawIcon(((Form)content).Icon, rectImage);
-
- // Draw the text
- if (content == content.DockHandler.Pane.ActiveContent)
- {
- Rectangle rectText = rectTab;
- rectText.X += ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
- rectText.Width -= ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
- rectText = GetTransformedRectangle(dockState, rectText);
- if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide)
- g.DrawString(content.DockHandler.TabText, Font, brushTabText, rectText, StringFormatTabVertical);
- else
- g.DrawString(content.DockHandler.TabText, Font, brushTabText, rectText, StringFormatTabHorizontal);
- }
-
- // Set rotate back
- g.Transform = matrixRotate;
-
- OnEndDrawTab(tab);
- }
-
- private Rectangle GetLogicalTabStripRectangle(DockState dockState)
- {
- return GetLogicalTabStripRectangle(dockState, false);
- }
-
- private Rectangle GetLogicalTabStripRectangle(DockState dockState, bool transformed)
- {
- if (!DockHelper.IsDockStateAutoHide(dockState))
- return Rectangle.Empty;
-
- int leftPanes = GetPanes(DockState.DockLeftAutoHide).Count;
- int rightPanes = GetPanes(DockState.DockRightAutoHide).Count;
- int topPanes = GetPanes(DockState.DockTopAutoHide).Count;
- int bottomPanes = GetPanes(DockState.DockBottomAutoHide).Count;
-
- int x, y, width, height;
-
- height = MeasureHeight();
- if (dockState == DockState.DockLeftAutoHide && leftPanes > 0)
- {
- x = 0;
- y = (topPanes == 0) ? 0 : height;
- width = Height - (topPanes == 0 ? 0 : height) - (bottomPanes == 0 ? 0 :height);
- }
- else if (dockState == DockState.DockRightAutoHide && rightPanes > 0)
- {
- x = Width - height;
- if (leftPanes != 0 && x < height)
- x = height;
- y = (topPanes == 0) ? 0 : height;
- width = Height - (topPanes == 0 ? 0 : height) - (bottomPanes == 0 ? 0 :height);
- }
- else if (dockState == DockState.DockTopAutoHide && topPanes > 0)
- {
- x = leftPanes == 0 ? 0 : height;
- y = 0;
- width = Width - (leftPanes == 0 ? 0 : height) - (rightPanes == 0 ? 0 : height);
- }
- else if (dockState == DockState.DockBottomAutoHide && bottomPanes > 0)
- {
- x = leftPanes == 0 ? 0 : height;
- y = Height - height;
- if (topPanes != 0 && y < height)
- y = height;
- width = Width - (leftPanes == 0 ? 0 : height) - (rightPanes == 0 ? 0 : height);
- }
- else
- return Rectangle.Empty;
-
- if (!transformed)
- return new Rectangle(x, y, width, height);
- else
- return GetTransformedRectangle(dockState, new Rectangle(x, y, width, height));
- }
-
- private Rectangle GetTabRectangle(TabVS2003 tab)
- {
- return GetTabRectangle(tab, false);
- }
-
- private Rectangle GetTabRectangle(TabVS2003 tab, bool transformed)
- {
- DockState dockState = tab.Content.DockHandler.DockState;
- Rectangle rectTabStrip = GetLogicalTabStripRectangle(dockState);
-
- if (rectTabStrip.IsEmpty)
- return Rectangle.Empty;
-
- int x = tab.TabX;
- int y = rectTabStrip.Y +
- (dockState == DockState.DockTopAutoHide || dockState == DockState.DockRightAutoHide ?
- 0 : TabGapTop);
- int width = tab.TabWidth;
- int height = rectTabStrip.Height - TabGapTop;
-
- if (!transformed)
- return new Rectangle(x, y, width, height);
- else
- return GetTransformedRectangle(dockState, new Rectangle(x, y, width, height));
- }
-
- private Rectangle GetTransformedRectangle(DockState dockState, Rectangle rect)
- {
- if (dockState != DockState.DockLeftAutoHide && dockState != DockState.DockRightAutoHide)
- return rect;
-
- PointF[] pts = new PointF[1];
- // the center of the rectangle
- pts[0].X = (float)rect.X + (float)rect.Width / 2;
- pts[0].Y = (float)rect.Y + (float)rect.Height / 2;
- Rectangle rectTabStrip = GetLogicalTabStripRectangle(dockState);
- Matrix matrix = new Matrix();
- matrix.RotateAt(90, new PointF((float)rectTabStrip.X + (float)rectTabStrip.Height / 2,
- (float)rectTabStrip.Y + (float)rectTabStrip.Height / 2));
- matrix.TransformPoints(pts);
-
- return new Rectangle((int)(pts[0].X - (float)rect.Height / 2 + .5F),
- (int)(pts[0].Y - (float)rect.Width / 2 + .5F),
- rect.Height, rect.Width);
- }
-
- ///
- protected override IDockContent HitTest(Point ptMouse)
- {
- foreach(DockState state in DockStates)
- {
- Rectangle rectTabStrip = GetLogicalTabStripRectangle(state, true);
- if (!rectTabStrip.Contains(ptMouse))
- continue;
-
- foreach(Pane pane in GetPanes(state))
- {
- foreach(TabVS2003 tab in pane.AutoHideTabs)
- {
- Rectangle rectTab = GetTabRectangle(tab, true);
- rectTab.Intersect(rectTabStrip);
- if (rectTab.Contains(ptMouse))
- return tab.Content;
- }
- }
- }
-
- return null;
- }
-
- ///
- protected override int MeasureHeight()
- {
- return Math.Max(ImageGapBottom +
- ImageGapTop + ImageHeight,
- Font.Height) + TabGapTop;
- }
-
- ///
- protected override void OnRefreshChanges()
- {
- CalculateTabs();
- Invalidate();
- }
-
- protected override AutoHideStripBase.Tab CreateTab(IDockContent content)
- {
- return new TabVS2003(content);
- }
-
- ///
- protected virtual void OnBeginDrawTab(Tab tab)
- {
- }
-
- ///
- protected virtual void OnEndDrawTab(Tab tab)
- {
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/VS2003DockPaneCaption.cs b/src/Libraries/DockPanel_Src/DockSample/Customization/VS2003DockPaneCaption.cs
deleted file mode 100644
index b9eb769be0..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Customization/VS2003DockPaneCaption.cs
+++ /dev/null
@@ -1,359 +0,0 @@
-using System;
-using System.Drawing;
-using System.Windows.Forms;
-using System.ComponentModel;
-using WeifenLuo.WinFormsUI.Docking;
-
-namespace DockSample.Customization
-{
- ///
- internal class VS2003DockPaneCaption : DockPaneCaptionBase
- {
- #region consts
- private const int _TextGapTop = 2;
- private const int _TextGapBottom = 0;
- private const int _TextGapLeft = 3;
- private const int _TextGapRight = 3;
- private const int _ButtonGapTop = 2;
- private const int _ButtonGapBottom = 1;
- private const int _ButtonGapBetween = 1;
- private const int _ButtonGapLeft = 1;
- private const int _ButtonGapRight = 2;
- #endregion
-
- private InertButton m_buttonClose;
- private InertButton m_buttonAutoHide;
-
- ///
- protected internal VS2003DockPaneCaption(DockPane pane) : base(pane)
- {
- SuspendLayout();
-
- Font = SystemInformation.MenuFont;
-
- m_buttonClose = new InertButton(ImageCloseEnabled, ImageCloseDisabled);
- m_buttonAutoHide = new InertButton();
-
- m_buttonClose.ToolTipText = ToolTipClose;
- m_buttonClose.Anchor = AnchorStyles.Top | AnchorStyles.Right;
- m_buttonClose.Click += new EventHandler(this.Close_Click);
-
- m_buttonAutoHide.ToolTipText = ToolTipAutoHide;
- m_buttonAutoHide.Anchor = AnchorStyles.Top | AnchorStyles.Right;
- m_buttonAutoHide.Click += new EventHandler(AutoHide_Click);
-
- Controls.AddRange(new Control[] { m_buttonClose, m_buttonAutoHide });
-
- ResumeLayout();
- }
-
- #region Customizable Properties
- ///
- protected virtual int TextGapTop
- {
- get { return _TextGapTop; }
- }
-
- ///
- protected virtual int TextGapBottom
- {
- get { return _TextGapBottom; }
- }
-
- ///
- protected virtual int TextGapLeft
- {
- get { return _TextGapLeft; }
- }
-
- ///
- protected virtual int TextGapRight
- {
- get { return _TextGapRight; }
- }
-
- ///
- protected virtual int ButtonGapTop
- {
- get { return _ButtonGapTop; }
- }
-
- ///
- protected virtual int ButtonGapBottom
- {
- get { return _ButtonGapBottom; }
- }
-
- ///
- protected virtual int ButtonGapLeft
- {
- get { return _ButtonGapLeft; }
- }
-
- ///
- protected virtual int ButtonGapRight
- {
- get { return _ButtonGapRight; }
- }
-
- ///
- protected virtual int ButtonGapBetween
- {
- get { return _ButtonGapBetween; }
- }
-
- private static Image _imageCloseEnabled = null;
- ///
- protected virtual Image ImageCloseEnabled
- {
- get
- {
- if (_imageCloseEnabled == null)
- _imageCloseEnabled = Resources.DockPaneCaption_CloseEnabled;
- return _imageCloseEnabled;
- }
- }
-
- private static Image _imageCloseDisabled = null;
- ///
- protected virtual Image ImageCloseDisabled
- {
- get
- {
- if (_imageCloseDisabled == null)
- _imageCloseDisabled = Resources.DockPaneCaption_CloseDisabled;
- return _imageCloseDisabled;
- }
- }
-
- private static Image _imageAutoHideYes = null;
- ///
- protected virtual Image ImageAutoHideYes
- {
- get
- {
- if (_imageAutoHideYes == null)
- _imageAutoHideYes = Resources.DockPaneCaption_AutoHideYes;
- return _imageAutoHideYes;
- }
- }
-
- private static Image _imageAutoHideNo = null;
- ///
- protected virtual Image ImageAutoHideNo
- {
- get
- {
- if (_imageAutoHideNo == null)
- _imageAutoHideNo = Resources.DockPaneCaption_AutoHideNo;
- return _imageAutoHideNo;
- }
- }
-
- private static string _toolTipClose = null;
- ///
- protected virtual string ToolTipClose
- {
- get
- {
- if (_toolTipClose == null)
- _toolTipClose = Strings.DockPaneCaption_ToolTipClose;
- return _toolTipClose;
- }
- }
-
- private static string _toolTipAutoHide = null;
- ///
- protected virtual string ToolTipAutoHide
- {
- get
- {
- if (_toolTipAutoHide == null)
- _toolTipAutoHide = Strings.DockPaneCaption_ToolTipAutoHide;
- return _toolTipAutoHide;
- }
- }
-
- ///
- protected virtual Color ActiveBackColor
- {
- get { return SystemColors.ActiveCaption; }
- }
-
- ///
- protected virtual Color InactiveBackColor
- {
- get { return SystemColors.Control; }
- }
-
- ///
- protected virtual Color ActiveTextColor
- {
- get { return SystemColors.ActiveCaptionText; }
- }
-
- ///
- protected virtual Color InactiveTextColor
- {
- get { return SystemColors.ControlText; }
- }
-
- ///
- protected virtual Color InactiveBorderColor
- {
- get { return SystemColors.GrayText; }
- }
-
- ///
- protected virtual Color ActiveButtonBorderColor
- {
- get { return ActiveTextColor; }
- }
-
- ///
- protected virtual Color InactiveButtonBorderColor
- {
- get { return Color.Empty; }
- }
-
- private static TextFormatFlags _textFormat =
- TextFormatFlags.SingleLine |
- TextFormatFlags.EndEllipsis |
- TextFormatFlags.VerticalCenter;
- ///
- protected virtual TextFormatFlags TextFormat
- {
- get
- {
- return _textFormat;
- }
- }
-
- #endregion
-
- ///
- protected override int MeasureHeight()
- {
- int height = Font.Height + TextGapTop + TextGapBottom;
-
- if (height < ImageCloseEnabled.Height + ButtonGapTop + ButtonGapBottom)
- height = ImageCloseEnabled.Height + ButtonGapTop + ButtonGapBottom;
-
- return height;
- }
-
- ///
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint (e);
- DrawCaption(e.Graphics);
- }
-
- private void DrawCaption(Graphics g)
- {
- BackColor = DockPane.IsActivated ? ActiveBackColor : InactiveBackColor;
-
- Rectangle rectCaption = ClientRectangle;
-
- if (!DockPane.IsActivated)
- {
- using (Pen pen = new Pen(InactiveBorderColor))
- {
- g.DrawLine(pen, rectCaption.X + 1, rectCaption.Y, rectCaption.X + rectCaption.Width - 2, rectCaption.Y);
- g.DrawLine(pen, rectCaption.X + 1, rectCaption.Y + rectCaption.Height - 1, rectCaption.X + rectCaption.Width - 2, rectCaption.Y + rectCaption.Height - 1);
- g.DrawLine(pen, rectCaption.X, rectCaption.Y + 1, rectCaption.X, rectCaption.Y + rectCaption.Height - 2);
- g.DrawLine(pen, rectCaption.X + rectCaption.Width - 1, rectCaption.Y + 1, rectCaption.X + rectCaption.Width - 1, rectCaption.Y + rectCaption.Height - 2);
- }
- }
-
- m_buttonClose.ForeColor = m_buttonAutoHide.ForeColor = (DockPane.IsActivated ? ActiveTextColor : InactiveTextColor);
- m_buttonClose.BorderColor = m_buttonAutoHide.BorderColor = (DockPane.IsActivated ? ActiveButtonBorderColor : InactiveButtonBorderColor);
-
- Rectangle rectCaptionText = rectCaption;
- rectCaptionText.X += TextGapLeft;
- if (ShouldShowCloseButton && ShouldShowAutoHideButton)
- rectCaptionText.Width = rectCaption.Width - ButtonGapRight
- - ButtonGapLeft - TextGapLeft - TextGapRight -
- (m_buttonAutoHide.Width + ButtonGapBetween + m_buttonClose.Width);
- else if (ShouldShowCloseButton || ShouldShowAutoHideButton)
- rectCaptionText.Width = rectCaption.Width - ButtonGapRight
- - ButtonGapLeft - TextGapLeft - TextGapRight - m_buttonClose.Width;
- else
- rectCaptionText.Width = rectCaption.Width - TextGapLeft - TextGapRight;
- rectCaptionText.Y += TextGapTop;
- rectCaptionText.Height -= TextGapTop + TextGapBottom;
- TextRenderer.DrawText(g, DockPane.CaptionText, Font, rectCaptionText, DockPane.IsActivated ? ActiveTextColor : InactiveTextColor, TextFormat);
- }
-
- ///
- protected override void OnLayout(LayoutEventArgs levent)
- {
- SetButtonsPosition();
- base.OnLayout (levent);
- }
-
- ///
- protected override void OnRefreshChanges()
- {
- SetButtons();
- Invalidate();
- }
-
- private bool ShouldShowCloseButton
- {
- get { return (DockPane.ActiveContent != null)? DockPane.ActiveContent.DockHandler.CloseButton : false; }
- }
-
- private bool ShouldShowAutoHideButton
- {
- get { return !DockPane.IsFloat; }
- }
-
- private void SetButtons()
- {
- m_buttonClose.Visible = ShouldShowCloseButton;
- m_buttonAutoHide.Visible = ShouldShowAutoHideButton;
- m_buttonAutoHide.ImageEnabled = DockPane.IsAutoHide ? ImageAutoHideYes : ImageAutoHideNo;
-
- SetButtonsPosition();
- }
-
- private void SetButtonsPosition()
- {
- // set the size and location for close and auto-hide buttons
- Rectangle rectCaption = ClientRectangle;
- int buttonWidth = ImageCloseEnabled.Width;
- int buttonHeight = ImageCloseEnabled.Height;
- int height = rectCaption.Height - ButtonGapTop - ButtonGapBottom;
- if (buttonHeight < height)
- {
- buttonWidth = buttonWidth * (height / buttonHeight);
- buttonHeight = height;
- }
- m_buttonClose.SuspendLayout();
- m_buttonAutoHide.SuspendLayout();
- Size buttonSize = new Size(buttonWidth, buttonHeight);
- m_buttonClose.Size = m_buttonAutoHide.Size = buttonSize;
- int x = rectCaption.X + rectCaption.Width - 1 - ButtonGapRight - m_buttonClose.Width;
- int y = rectCaption.Y + ButtonGapTop;
- Point point = m_buttonClose.Location = new Point(x, y);
- if (ShouldShowCloseButton)
- point.Offset(-(m_buttonAutoHide.Width + ButtonGapBetween), 0);
- m_buttonAutoHide.Location = point;
- m_buttonClose.ResumeLayout();
- m_buttonAutoHide.ResumeLayout();
- }
-
- private void Close_Click(object sender, EventArgs e)
- {
- DockPane.CloseActiveContent();
- }
-
- private void AutoHide_Click(object sender, EventArgs e)
- {
- DockPane.DockState = DockHelper.ToggleAutoHideState(DockPane.DockState);
- if (!DockPane.IsAutoHide)
- DockPane.Activate();
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/DockSample/Customization/VS2003DockPaneStrip.cs b/src/Libraries/DockPanel_Src/DockSample/Customization/VS2003DockPaneStrip.cs
deleted file mode 100644
index 6761cadb5e..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Customization/VS2003DockPaneStrip.cs
+++ /dev/null
@@ -1,1085 +0,0 @@
-using System;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Windows.Forms;
-using System.ComponentModel;
-using WeifenLuo.WinFormsUI.Docking;
-
-namespace DockSample.Customization
-{
- internal class VS2003DockPaneStrip : DockPaneStripBase
- {
- private class TabVS2003 : Tab
- {
- internal TabVS2003(IDockContent content)
- : base(content)
- {
- }
-
- private int m_tabX;
- protected internal int TabX
- {
- get { return m_tabX; }
- set { m_tabX = value; }
- }
-
- private int m_tabWidth;
- protected internal int TabWidth
- {
- get { return m_tabWidth; }
- set { m_tabWidth = value; }
- }
-
- private int m_maxWidth;
- protected internal int MaxWidth
- {
- get { return m_maxWidth; }
- set { m_maxWidth = value; }
- }
-
- private bool m_flag;
- protected internal bool Flag
- {
- get { return m_flag; }
- set { m_flag = value; }
- }
- }
-
- protected override DockPaneStripBase.Tab CreateTab(IDockContent content)
- {
- return new TabVS2003(content);
- }
-
- private class DocumentButton : Label
- {
- public DocumentButton(Image image)
- {
- Image = image;
- }
-
-
- }
-
- #region consts
- private const int _ToolWindowStripGapLeft = 4;
- private const int _ToolWindowStripGapRight = 3;
- private const int _ToolWindowImageHeight = 16;
- private const int _ToolWindowImageWidth = 16;
- private const int _ToolWindowImageGapTop = 3;
- private const int _ToolWindowImageGapBottom = 1;
- private const int _ToolWindowImageGapLeft = 3;
- private const int _ToolWindowImageGapRight = 2;
- private const int _ToolWindowTextGapRight = 1;
- private const int _ToolWindowTabSeperatorGapTop = 3;
- private const int _ToolWindowTabSeperatorGapBottom = 3;
-
- private const int _DocumentTabMaxWidth = 200;
- private const int _DocumentButtonGapTop = 5;
- private const int _DocumentButtonGapBottom = 5;
- private const int _DocumentButtonGapBetween = 0;
- private const int _DocumentButtonGapRight = 3;
- private const int _DocumentTabGapTop = 3;
- private const int _DocumentTabGapLeft = 3;
- private const int _DocumentTabGapRight = 3;
- private const int _DocumentIconGapLeft = 6;
- private const int _DocumentIconHeight = 16;
- private const int _DocumentIconWidth = 16;
- #endregion
-
- private InertButton m_buttonClose, m_buttonScrollLeft, m_buttonScrollRight;
- private IContainer m_components;
- private ToolTip m_toolTip;
-
- ///
- protected IContainer Components
- {
- get { return m_components; }
- }
-
- private int m_offsetX = 0;
- private int OffsetX
- {
- get { return m_offsetX; }
- set
- {
- m_offsetX = value;
- #if DEBUG
- if (m_offsetX > 0)
- throw new InvalidOperationException();
- #endif
- }
- }
-
- #region Customizable Properties
- ///
- protected virtual int ToolWindowStripGapLeft
- {
- get { return _ToolWindowStripGapLeft; }
- }
-
- ///
- protected virtual int ToolWindowStripGapRight
- {
- get { return _ToolWindowStripGapRight; }
- }
-
- ///
- protected virtual int ToolWindowImageHeight
- {
- get { return _ToolWindowImageHeight; }
- }
-
- ///
- protected virtual int ToolWindowImageWidth
- {
- get { return _ToolWindowImageWidth; }
- }
-
- ///
- protected virtual int ToolWindowImageGapTop
- {
- get { return _ToolWindowImageGapTop; }
- }
-
- ///
- protected virtual int ToolWindowImageGapBottom
- {
- get { return _ToolWindowImageGapBottom; }
- }
-
- ///
- protected virtual int ToolWindowImageGapLeft
- {
- get { return _ToolWindowImageGapLeft; }
- }
-
- ///
- protected virtual int ToolWindowImageGapRight
- {
- get { return _ToolWindowImageGapRight; }
- }
-
- ///
- protected virtual int ToolWindowTextGapRight
- {
- get { return _ToolWindowTextGapRight; }
- }
-
- ///
- protected virtual int ToolWindowTabSeperatorGapTop
- {
- get { return _ToolWindowTabSeperatorGapTop; }
- }
-
- ///
- protected virtual int ToolWindowTabSeperatorGapBottom
- {
- get { return _ToolWindowTabSeperatorGapBottom; }
- }
-
- private static Image _imageCloseEnabled = null;
- ///
- protected virtual Image ImageCloseEnabled
- {
- get
- {
- if (_imageCloseEnabled == null)
- _imageCloseEnabled = Resources.DockPaneStrip_CloseEnabled;
- return _imageCloseEnabled;
- }
- }
-
- private static Image _imageCloseDisabled = null;
- ///
- protected virtual Image ImageCloseDisabled
- {
- get
- {
- if (_imageCloseDisabled == null)
- _imageCloseDisabled = Resources.DockPaneStrip_CloseDisabled;
- return _imageCloseDisabled;
- }
- }
-
- private static Image _imageScrollLeftEnabled = null;
- ///
- protected virtual Image ImageScrollLeftEnabled
- {
- get
- {
- if (_imageScrollLeftEnabled == null)
- _imageScrollLeftEnabled = Resources.DockPaneStrip_ScrollLeftEnabled;
- return _imageScrollLeftEnabled;
- }
- }
-
- private static Image _imageScrollLeftDisabled = null;
- ///
- protected virtual Image ImageScrollLeftDisabled
- {
- get
- {
- if (_imageScrollLeftDisabled == null)
- _imageScrollLeftDisabled = Resources.DockPaneStrip_ScrollLeftDisabled;
- return _imageScrollLeftDisabled;
- }
- }
-
- private static Image _imageScrollRightEnabled = null;
- ///
- protected virtual Image ImageScrollRightEnabled
- {
- get
- {
- if (_imageScrollRightEnabled == null)
- _imageScrollRightEnabled = Resources.DockPaneStrip_ScrollRightEnabled;
- return _imageScrollRightEnabled;
- }
- }
-
- private static Image _imageScrollRightDisabled = null;
- ///
- protected virtual Image ImageScrollRightDisabled
- {
- get
- {
- if (_imageScrollRightDisabled == null)
- _imageScrollRightDisabled = Resources.DockPaneStrip_ScrollRightDisabled;
- return _imageScrollRightDisabled;
- }
- }
-
- private static string _toolTipClose = null;
- ///
- protected virtual string ToolTipClose
- {
- get
- {
- if (_toolTipClose == null)
- _toolTipClose = Strings.DockPaneStrip_ToolTipClose;
- return _toolTipClose;
- }
- }
-
- private static string _toolTipScrollLeft = null;
- ///
- protected virtual string ToolTipScrollLeft
- {
- get
- {
- if (_toolTipScrollLeft == null)
- _toolTipScrollLeft = Strings.DockPaneStrip_ToolTipScrollLeft;
- return _toolTipScrollLeft;
- }
- }
-
- private static string _toolTipScrollRight = null;
- ///
- protected virtual string ToolTipScrollRight
- {
- get
- {
- if (_toolTipScrollRight == null)
- _toolTipScrollRight = Strings.DockPaneStrip_ToolTipScrollRight;
- return _toolTipScrollRight;
- }
- }
-
- private static TextFormatFlags _toolWindowTextFormat =
- TextFormatFlags.EndEllipsis |
- TextFormatFlags.HorizontalCenter |
- TextFormatFlags.SingleLine |
- TextFormatFlags.VerticalCenter;
- ///
- protected virtual TextFormatFlags ToolWindowTextFormat
- {
- get { return _toolWindowTextFormat; }
- }
-
- private static TextFormatFlags _documentTextFormat =
- TextFormatFlags.PathEllipsis |
- TextFormatFlags.SingleLine |
- TextFormatFlags.VerticalCenter;
- ///
- public static TextFormatFlags DocumentTextFormat
- {
- get { return _documentTextFormat; }
- }
-
- ///
- protected virtual int DocumentTabMaxWidth
- {
- get { return _DocumentTabMaxWidth; }
- }
-
- ///
- protected virtual int DocumentButtonGapTop
- {
- get { return _DocumentButtonGapTop; }
- }
-
- ///
- protected virtual int DocumentButtonGapBottom
- {
- get { return _DocumentButtonGapBottom; }
- }
-
- ///
- protected virtual int DocumentButtonGapBetween
- {
- get { return _DocumentButtonGapBetween; }
- }
-
- ///
- protected virtual int DocumentButtonGapRight
- {
- get { return _DocumentButtonGapRight; }
- }
-
- ///
- protected virtual int DocumentTabGapTop
- {
- get { return _DocumentTabGapTop; }
- }
-
- ///
- protected virtual int DocumentTabGapLeft
- {
- get { return _DocumentTabGapLeft; }
- }
-
- ///
- protected virtual int DocumentTabGapRight
- {
- get { return _DocumentTabGapRight; }
- }
-
- ///
- protected virtual int DocumentIconGapLeft
- {
- get { return _DocumentIconGapLeft; }
- }
-
- ///
- protected virtual int DocumentIconWidth
- {
- get { return _DocumentIconWidth; }
- }
-
- ///
- protected virtual int DocumentIconHeight
- {
- get { return _DocumentIconHeight; }
- }
-
- ///
- protected virtual Pen OutlineInnerPen
- {
- get { return SystemPens.ControlText; }
- }
-
- ///
- protected virtual Pen OutlineOuterPen
- {
- get { return SystemPens.ActiveCaptionText; }
- }
-
- ///
- protected virtual Brush ActiveBackBrush
- {
- get { return SystemBrushes.Control; }
- }
-
- ///
- protected virtual Color ActiveTextColor
- {
- get { return SystemColors.ControlText; }
- }
-
- ///
- protected virtual Pen TabSeperatorPen
- {
- get { return SystemPens.GrayText; }
- }
-
- ///
- protected virtual Color InactiveTextColor
- {
- get { return SystemColors.ControlDarkDark; }
- }
- #endregion
-
- public VS2003DockPaneStrip(DockPane pane) : base(pane)
- {
- SetStyle(ControlStyles.ResizeRedraw, true);
- SetStyle(ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.AllPaintingInWmPaint, true);
-
- SuspendLayout();
-
- Font = SystemInformation.MenuFont;
- BackColor = Color.WhiteSmoke;
-
- m_components = new Container();
- m_toolTip = new ToolTip(Components);
-
- m_buttonClose = new InertButton(ImageCloseEnabled, ImageCloseDisabled);
- m_buttonScrollLeft = new InertButton(ImageScrollLeftEnabled, ImageScrollLeftDisabled);
- m_buttonScrollRight = new InertButton(ImageScrollRightEnabled, ImageScrollRightDisabled);
-
- m_buttonClose.ToolTipText = ToolTipClose;
- m_buttonClose.Anchor = AnchorStyles.Top | AnchorStyles.Right;
- m_buttonClose.Click += new EventHandler(Close_Click);
-
- m_buttonScrollLeft.Enabled = false;
- m_buttonScrollLeft.RepeatClick = true;
- m_buttonScrollLeft.ToolTipText = ToolTipScrollLeft;
- m_buttonScrollLeft.Anchor = AnchorStyles.Top | AnchorStyles.Right;
- m_buttonScrollLeft.Click += new EventHandler(ScrollLeft_Click);
-
- m_buttonScrollRight.Enabled = false;
- m_buttonScrollRight.RepeatClick = true;
- m_buttonScrollRight.ToolTipText = ToolTipScrollRight;
- m_buttonScrollRight.Anchor = AnchorStyles.Top | AnchorStyles.Right;
- m_buttonScrollRight.Click += new EventHandler(ScrollRight_Click);
-
- Controls.AddRange(new Control[] { m_buttonClose,
- m_buttonScrollLeft,
- m_buttonScrollRight });
-
- ResumeLayout();
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- Components.Dispose();
- }
- base.Dispose (disposing);
- }
-
- protected override int MeasureHeight()
- {
- if (Appearance == DockPane.AppearanceStyle.ToolWindow)
- return MeasureHeight_ToolWindow();
- else
- return MeasureHeight_Document();
- }
-
- private int MeasureHeight_ToolWindow()
- {
- if (DockPane.IsAutoHide || Tabs.Count <= 1)
- return 0;
-
- int height = Math.Max(Font.Height, ToolWindowImageHeight)
- + ToolWindowImageGapTop + ToolWindowImageGapBottom;
-
- return height;
- }
-
- private int MeasureHeight_Document()
- {
- int height = Math.Max(Font.Height + DocumentTabGapTop,
- ImageCloseEnabled.Height + DocumentButtonGapTop + DocumentButtonGapBottom);
-
- return height;
- }
-
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint (e);
- CalculateTabs();
- DrawTabStrip(e.Graphics);
- }
-
- protected override void OnRefreshChanges()
- {
- CalculateTabs();
- SetInertButtons();
- Invalidate();
- }
-
- protected override GraphicsPath GetOutline(int index)
- {
- Point[] pts = new Point[8];
-
- if (Appearance == DockPane.AppearanceStyle.Document)
- {
- Rectangle rectTab = GetTabRectangle(index);
- rectTab.Intersect(TabsRectangle);
- int y = DockPane.PointToClient(PointToScreen(new Point(0, rectTab.Bottom))).Y;
- Rectangle rectPaneClient = DockPane.ClientRectangle;
- pts[0] = DockPane.PointToScreen(new Point(rectPaneClient.Left, y));
- pts[1] = PointToScreen(new Point(rectTab.Left, rectTab.Bottom));
- pts[2] = PointToScreen(new Point(rectTab.Left, rectTab.Top));
- pts[3] = PointToScreen(new Point(rectTab.Right, rectTab.Top));
- pts[4] = PointToScreen(new Point(rectTab.Right, rectTab.Bottom));
- pts[5] = DockPane.PointToScreen(new Point(rectPaneClient.Right, y));
- pts[6] = DockPane.PointToScreen(new Point(rectPaneClient.Right, rectPaneClient.Bottom));
- pts[7] = DockPane.PointToScreen(new Point(rectPaneClient.Left, rectPaneClient.Bottom));
- }
- else
- {
- Rectangle rectTab = GetTabRectangle(index);
- rectTab.Intersect(TabsRectangle);
- int y = DockPane.PointToClient(PointToScreen(new Point(0, rectTab.Top))).Y;
- Rectangle rectPaneClient = DockPane.ClientRectangle;
- pts[0] = DockPane.PointToScreen(new Point(rectPaneClient.Left, rectPaneClient.Top));
- pts[1] = DockPane.PointToScreen(new Point(rectPaneClient.Right, rectPaneClient.Top));
- pts[2] = DockPane.PointToScreen(new Point(rectPaneClient.Right, y));
- pts[3] = PointToScreen(new Point(rectTab.Right, rectTab.Top));
- pts[4] = PointToScreen(new Point(rectTab.Right, rectTab.Bottom));
- pts[5] = PointToScreen(new Point(rectTab.Left, rectTab.Bottom));
- pts[6] = PointToScreen(new Point(rectTab.Left, rectTab.Top));
- pts[7] = DockPane.PointToScreen(new Point(rectPaneClient.Left, y));
- }
-
- GraphicsPath path = new GraphicsPath();
- path.AddLines(pts);
- return path;
- }
-
- private void CalculateTabs()
- {
- if (Appearance == DockPane.AppearanceStyle.ToolWindow)
- CalculateTabs_ToolWindow();
- else
- CalculateTabs_Document();
- }
-
- private void CalculateTabs_ToolWindow()
- {
- if (Tabs.Count <= 1 || DockPane.IsAutoHide)
- return;
-
- Rectangle rectTabStrip = ClientRectangle;
-
- // Calculate tab widths
- int countTabs = Tabs.Count;
- foreach (TabVS2003 tab in Tabs)
- {
- tab.MaxWidth = GetTabOriginalWidth(Tabs.IndexOf(tab));
- tab.Flag = false;
- }
-
- // Set tab whose max width less than average width
- bool anyWidthWithinAverage = true;
- int totalWidth = rectTabStrip.Width - ToolWindowStripGapLeft - ToolWindowStripGapRight;
- int totalAllocatedWidth = 0;
- int averageWidth = totalWidth / countTabs;
- int remainedTabs = countTabs;
- for (anyWidthWithinAverage=true; anyWidthWithinAverage && remainedTabs>0;)
- {
- anyWidthWithinAverage = false;
- foreach (TabVS2003 tab in Tabs)
- {
- if (tab.Flag)
- continue;
-
- if (tab.MaxWidth <= averageWidth)
- {
- tab.Flag = true;
- tab.TabWidth = tab.MaxWidth;
- totalAllocatedWidth += tab.TabWidth;
- anyWidthWithinAverage = true;
- remainedTabs--;
- }
- }
- if (remainedTabs != 0)
- averageWidth = (totalWidth - totalAllocatedWidth) / remainedTabs;
- }
-
- // If any tab width not set yet, set it to the average width
- if (remainedTabs > 0)
- {
- int roundUpWidth = (totalWidth - totalAllocatedWidth) - (averageWidth * remainedTabs);
- foreach (TabVS2003 tab in Tabs)
- {
- if (tab.Flag)
- continue;
-
- tab.Flag = true;
- if (roundUpWidth > 0)
- {
- tab.TabWidth = averageWidth + 1;
- roundUpWidth --;
- }
- else
- tab.TabWidth = averageWidth;
- }
- }
-
- // Set the X position of the tabs
- int x = rectTabStrip.X + ToolWindowStripGapLeft;
- foreach (TabVS2003 tab in Tabs)
- {
- tab.TabX = x;
- x += tab.TabWidth;
- }
- }
-
- private void CalculateTabs_Document()
- {
- Rectangle rectTabStrip = TabsRectangle;
-
- int totalWidth = 0;
- foreach (TabVS2003 tab in Tabs)
- {
- tab.TabWidth = Math.Min(GetTabOriginalWidth(Tabs.IndexOf(tab)), DocumentTabMaxWidth);
- totalWidth += tab.TabWidth;
- }
-
- if (totalWidth + OffsetX < rectTabStrip.Width && OffsetX < 0)
- OffsetX = Math.Min(0, rectTabStrip.Width - totalWidth);
-
- int x = rectTabStrip.X + OffsetX;
- foreach (TabVS2003 tab in Tabs)
- {
- tab.TabX = x;
- x += tab.TabWidth;
- }
- }
-
- protected override void EnsureTabVisible(IDockContent content)
- {
- if (Appearance != DockPane.AppearanceStyle.Document || !Tabs.Contains(content))
- return;
-
- Rectangle rectTabStrip = TabsRectangle;
- Rectangle rectTab = GetTabRectangle(Tabs.IndexOf(content));
-
- if (rectTab.Right > rectTabStrip.Right)
- {
- OffsetX -= rectTab.Right - rectTabStrip.Right;
- rectTab.X -= rectTab.Right - rectTabStrip.Right;
- }
-
- if (rectTab.Left < rectTabStrip.Left)
- OffsetX += rectTabStrip.Left - rectTab.Left;
-
- OnRefreshChanges();
- }
-
- private int GetTabOriginalWidth(int index)
- {
- if (Appearance == DockPane.AppearanceStyle.ToolWindow)
- return GetTabOriginalWidth_ToolWindow(index);
- else
- return GetTabOriginalWidth_Document(index);
- }
-
- private int GetTabOriginalWidth_ToolWindow(int index)
- {
- IDockContent content = Tabs[index].Content;
- using (Graphics g = CreateGraphics())
- {
- Size sizeString = TextRenderer.MeasureText(g, content.DockHandler.TabText, Font);
- return ToolWindowImageWidth + sizeString.Width + ToolWindowImageGapLeft
- + ToolWindowImageGapRight + ToolWindowTextGapRight;
- }
- }
-
- private int GetTabOriginalWidth_Document(int index)
- {
- IDockContent content = Tabs[index].Content;
-
- int height = GetTabRectangle_Document(index).Height;
-
- using (Graphics g = CreateGraphics())
- {
- Size sizeText;
- if (content == DockPane.ActiveContent && DockPane.IsActiveDocumentPane)
- {
- using (Font boldFont = new Font(this.Font, FontStyle.Bold))
- {
- sizeText = TextRenderer.MeasureText(g, content.DockHandler.TabText, boldFont, new Size(DocumentTabMaxWidth, height), DocumentTextFormat);
- }
- }
- else
- sizeText = TextRenderer.MeasureText(content.DockHandler.TabText, Font, new Size(DocumentTabMaxWidth, height), DocumentTextFormat);
-
- if (DockPane.DockPanel.ShowDocumentIcon)
- return sizeText.Width + DocumentIconWidth + DocumentIconGapLeft;
- else
- return sizeText.Width;
- }
- }
-
- private void DrawTabStrip(Graphics g)
- {
- OnBeginDrawTabStrip();
-
- if (Appearance == DockPane.AppearanceStyle.Document)
- DrawTabStrip_Document(g);
- else
- DrawTabStrip_ToolWindow(g);
-
- OnEndDrawTabStrip();
- }
-
- private void DrawTabStrip_Document(Graphics g)
- {
- int count = Tabs.Count;
- if (count == 0)
- return;
-
- Rectangle rectTabStrip = ClientRectangle;
- g.DrawLine(OutlineOuterPen, rectTabStrip.Left, rectTabStrip.Bottom - 1,
- rectTabStrip.Right, rectTabStrip.Bottom - 1);
-
- // Draw the tabs
- Rectangle rectTabOnly = TabsRectangle;
- Rectangle rectTab = Rectangle.Empty;
- g.SetClip(rectTabOnly);
- for (int i=0; i rectTabOnly.Right;
-
- // show/hide close button
- if (Appearance == DockPane.AppearanceStyle.ToolWindow)
- m_buttonClose.Visible = false;
- else
- {
- bool showCloseButton = DockPane.ActiveContent == null ? true : DockPane.ActiveContent.DockHandler.CloseButton;
- if (m_buttonClose.Visible != showCloseButton)
- {
- m_buttonClose.Visible = showCloseButton;
- PerformLayout();
- }
- }
- }
-
- ///
- protected override void OnLayout(LayoutEventArgs levent)
- {
- Rectangle rectTabStrip = ClientRectangle;
-
- // Set position and size of the buttons
- int buttonWidth = ImageCloseEnabled.Width;
- int buttonHeight = ImageCloseEnabled.Height;
- int height = rectTabStrip.Height - DocumentButtonGapTop - DocumentButtonGapBottom;
- if (buttonHeight < height)
- {
- buttonWidth = buttonWidth * (height / buttonHeight);
- buttonHeight = height;
- }
- Size buttonSize = new Size(buttonWidth, buttonHeight);
- m_buttonClose.Size = m_buttonScrollLeft.Size = m_buttonScrollRight.Size = buttonSize;
- int x = rectTabStrip.X + rectTabStrip.Width - DocumentTabGapLeft
- - DocumentButtonGapRight - buttonWidth;
- int y = rectTabStrip.Y + DocumentButtonGapTop;
- m_buttonClose.Location = new Point(x, y);
- Point point = m_buttonClose.Location;
- bool showCloseButton = DockPane.ActiveContent == null ? true : DockPane.ActiveContent.DockHandler.CloseButton;
- if (showCloseButton)
- point.Offset(-(DocumentButtonGapBetween + buttonWidth), 0);
- m_buttonScrollRight.Location = point;
- point.Offset(-(DocumentButtonGapBetween + buttonWidth), 0);
- m_buttonScrollLeft.Location = point;
-
- OnRefreshChanges();
-
- base.OnLayout (levent);
- }
-
- private void Close_Click(object sender, EventArgs e)
- {
- DockPane.CloseActiveContent();
- }
-
- ///
- protected override int HitTest(Point ptMouse)
- {
- Rectangle rectTabStrip = TabsRectangle;
-
- for (int i=0; i
- protected override void OnMouseMove(MouseEventArgs e)
- {
- int index = HitTest(PointToClient(Control.MousePosition));
- string toolTip = string.Empty;
-
- base.OnMouseMove(e);
-
- if (index != -1)
- {
- Rectangle rectTab = GetTabRectangle(index);
- if (Tabs[index].Content.DockHandler.ToolTipText != null)
- toolTip = Tabs[index].Content.DockHandler.ToolTipText;
- else if (rectTab.Width < GetTabOriginalWidth(index))
- toolTip = Tabs[index].Content.DockHandler.TabText;
- }
-
- if (m_toolTip.GetToolTip(this) != toolTip)
- {
- m_toolTip.Active = false;
- m_toolTip.SetToolTip(this, toolTip);
- m_toolTip.Active = true;
- }
- }
-
- ///
- protected virtual void OnBeginDrawTabStrip()
- {
- }
-
- ///
- protected virtual void OnEndDrawTabStrip()
- {
- }
-
- ///
- protected virtual void OnBeginDrawTab(Tab tab)
- {
- }
-
- ///
- protected virtual void OnEndDrawTab(Tab tab)
- {
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/DockSample/DockSample.csproj b/src/Libraries/DockPanel_Src/DockSample/DockSample.csproj
deleted file mode 100644
index e0234e468a..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DockSample.csproj
+++ /dev/null
@@ -1,324 +0,0 @@
-
-
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {40793A27-478B-4357-B4C3-FC8943131F3D}
- WinExe
- Properties
- DockSample
- DockSample
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
- Form
-
-
- AboutDialog.cs
-
-
- Form
-
-
- MainForm2.cs
-
-
- Form
-
-
- DummyDoc.cs
-
-
- Form
-
-
- DummyOutputWindow.cs
-
-
- Form
-
-
- DummyPropertyWindow.cs
-
-
- Form
-
-
- DummySolutionExplorer.cs
-
-
- Form
-
-
- DummyTaskList.cs
-
-
- Form
-
-
- DummyToolbox.cs
-
-
-
-
- Component
-
-
- Component
-
-
- Component
-
-
- Component
-
-
- Form
-
-
- MainForm.cs
-
-
-
-
- Designer
- AboutDialog.cs
-
-
- Designer
- DummyDoc.cs
-
-
- Designer
- DummyOutputWindow.cs
-
-
- Designer
- DummyPropertyWindow.cs
-
-
- Designer
- DummySolutionExplorer.cs
-
-
- Designer
- DummyTaskList.cs
-
-
- Designer
- DummyToolbox.cs
-
-
- Designer
- MainForm.cs
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- True
- Resources.resx
- True
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
- True
- Settings.settings
- True
-
-
- Resources.resx
- True
- True
-
-
- Strings.resx
- True
- True
-
-
- Form
-
-
- ToolWindow.cs
-
-
-
-
- {C75532C4-765B-418E-B09B-46D36B2ABDB1}
- WinFormsUI
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MainForm2.cs
- Designer
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
-
- ResXFileCodeGenerator
- Strings.Designer.cs
- Designer
-
-
- Designer
- ToolWindow.cs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyDoc.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/DummyDoc.Designer.cs
deleted file mode 100644
index 4c55edf266..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyDoc.Designer.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-namespace DockSample
-{
- partial class DummyDoc
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DummyDoc));
- this.mainMenu = new System.Windows.Forms.MenuStrip();
- this.menuItem1 = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem2 = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemCheckTest = new System.Windows.Forms.ToolStripMenuItem();
- this.contextMenuTabPage = new System.Windows.Forms.ContextMenuStrip(this.components);
- this.menuItem3 = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem4 = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem5 = new System.Windows.Forms.ToolStripMenuItem();
- this.toolTip = new System.Windows.Forms.ToolTip(this.components);
- this.richTextBox1 = new System.Windows.Forms.RichTextBox();
- this.mainMenu.SuspendLayout();
- this.contextMenuTabPage.SuspendLayout();
- this.SuspendLayout();
- //
- // mainMenu
- //
- this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItem1});
- this.mainMenu.Location = new System.Drawing.Point(0, 4);
- this.mainMenu.Name = "mainMenu";
- this.mainMenu.Size = new System.Drawing.Size(448, 24);
- this.mainMenu.TabIndex = 1;
- this.mainMenu.Visible = false;
- //
- // menuItem1
- //
- this.menuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItem2,
- this.menuItemCheckTest});
- this.menuItem1.MergeAction = System.Windows.Forms.MergeAction.Insert;
- this.menuItem1.MergeIndex = 1;
- this.menuItem1.Name = "menuItem1";
- this.menuItem1.Size = new System.Drawing.Size(89, 20);
- this.menuItem1.Text = "&MDI Document";
- //
- // menuItem2
- //
- this.menuItem2.Name = "menuItem2";
- this.menuItem2.Size = new System.Drawing.Size(127, 22);
- this.menuItem2.Text = "Test";
- this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
- //
- // menuItemCheckTest
- //
- this.menuItemCheckTest.Name = "menuItemCheckTest";
- this.menuItemCheckTest.Size = new System.Drawing.Size(127, 22);
- this.menuItemCheckTest.Text = "Check Test";
- this.menuItemCheckTest.Click += new System.EventHandler(this.menuItemCheckTest_Click);
- //
- // contextMenuTabPage
- //
- this.contextMenuTabPage.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItem3,
- this.menuItem4,
- this.menuItem5});
- this.contextMenuTabPage.Name = "contextMenuTabPage";
- this.contextMenuTabPage.Size = new System.Drawing.Size(116, 70);
- //
- // menuItem3
- //
- this.menuItem3.Name = "menuItem3";
- this.menuItem3.Size = new System.Drawing.Size(115, 22);
- this.menuItem3.Text = "Option &1";
- //
- // menuItem4
- //
- this.menuItem4.Name = "menuItem4";
- this.menuItem4.Size = new System.Drawing.Size(115, 22);
- this.menuItem4.Text = "Option &2";
- //
- // menuItem5
- //
- this.menuItem5.Name = "menuItem5";
- this.menuItem5.Size = new System.Drawing.Size(115, 22);
- this.menuItem5.Text = "Option &3";
- //
- // richTextBox1
- //
- this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.richTextBox1.Location = new System.Drawing.Point(0, 4);
- this.richTextBox1.Name = "richTextBox1";
- this.richTextBox1.Size = new System.Drawing.Size(448, 389);
- this.richTextBox1.TabIndex = 2;
- this.richTextBox1.Text = "";
- //
- // DummyDoc
- //
- this.ClientSize = new System.Drawing.Size(448, 393);
- this.Controls.Add(this.richTextBox1);
- this.Controls.Add(this.mainMenu);
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.MainMenuStrip = this.mainMenu;
- this.Name = "DummyDoc";
- this.Padding = new System.Windows.Forms.Padding(0, 4, 0, 0);
- this.TabPageContextMenuStrip = this.contextMenuTabPage;
- this.mainMenu.ResumeLayout(false);
- this.mainMenu.PerformLayout();
- this.contextMenuTabPage.ResumeLayout(false);
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
- #endregion
-
- private System.Windows.Forms.MenuStrip mainMenu;
- private System.Windows.Forms.ToolStripMenuItem menuItem1;
- private System.Windows.Forms.ToolStripMenuItem menuItem2;
- private System.Windows.Forms.ContextMenuStrip contextMenuTabPage;
- private System.Windows.Forms.ToolStripMenuItem menuItem3;
- private System.Windows.Forms.ToolStripMenuItem menuItem4;
- private System.Windows.Forms.ToolStripMenuItem menuItem5;
- private System.Windows.Forms.ToolStripMenuItem menuItemCheckTest;
- private System.Windows.Forms.ToolTip toolTip;
- private System.Windows.Forms.RichTextBox richTextBox1;
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyDoc.cs b/src/Libraries/DockPanel_Src/DockSample/DummyDoc.cs
deleted file mode 100644
index 193d7357f9..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyDoc.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using WeifenLuo.WinFormsUI.Docking;
-using System.IO;
-
-namespace DockSample
-{
- public partial class DummyDoc : DockContent
- {
- public DummyDoc()
- {
- InitializeComponent();
- }
-
- private string m_fileName = string.Empty;
- public string FileName
- {
- get { return m_fileName; }
- set
- {
- if (value != string.Empty)
- {
- Stream s = new FileStream(value, FileMode.Open);
-
- FileInfo efInfo = new FileInfo(value);
-
- string fext = efInfo.Extension.ToUpper();
-
- if (fext.Equals(".RTF"))
- richTextBox1.LoadFile(s, RichTextBoxStreamType.RichText);
- else
- richTextBox1.LoadFile(s, RichTextBoxStreamType.PlainText);
- s.Close();
- }
-
- m_fileName = value;
- this.ToolTipText = value;
- }
- }
-
- // workaround of RichTextbox control's bug:
- // If load file before the control showed, all the text format will be lost
- // re-load the file after it get showed.
- private bool m_resetText = true;
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
-
- if (m_resetText)
- {
- m_resetText = false;
- FileName = FileName;
- }
- }
-
- protected override string GetPersistString()
- {
- return GetType().ToString() + "," + FileName + "," + Text;
- }
-
- private void menuItem2_Click(object sender, System.EventArgs e)
- {
- MessageBox.Show("This is to demostrate menu item has been successfully merged into the main form. Form Text=" + Text);
- }
-
- private void menuItemCheckTest_Click(object sender, System.EventArgs e)
- {
- menuItemCheckTest.Checked = !menuItemCheckTest.Checked;
- }
-
- protected override void OnTextChanged(EventArgs e)
- {
- base.OnTextChanged (e);
- if (FileName == string.Empty)
- this.richTextBox1.Text = Text;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyDoc.resx b/src/Libraries/DockPanel_Src/DockSample/DummyDoc.resx
deleted file mode 100644
index a7b68f4a21..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyDoc.resx
+++ /dev/null
@@ -1,140 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 261, 17
-
-
- 102, 17
-
-
- 17, 17
-
-
-
-
- AAABAAEAEBAQAAAAAAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAABAA
- AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
- AAD///8AAAAAAAAAAAAAeIiIiIiIAAB///////gAAH+IiIiI+AAAf//////4AAB/iIiIiPgAAH//////
- +AAAf4iIiIj4AAB///////gAAH+IiIiI+AAAf/////+IAAB/iIiI8AAAAH/////3BwAAf/////dwAAB3
- d3d3dwAAAAAAAAAAAADAAQAAwAEAAMABAADAAQAAwAEAAMABAADAAQAAwAEAAMABAADAAQAAwAEAAMAB
- AADACwAAwAcAAMAPAAD//wAA
-
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyOutputWindow.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/DummyOutputWindow.Designer.cs
deleted file mode 100644
index a543d0d65b..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyOutputWindow.Designer.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-namespace DockSample
-{
- partial class DummyOutputWindow
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DummyOutputWindow));
- this.comboBox = new System.Windows.Forms.ComboBox();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.SuspendLayout();
- //
- // comboBox
- //
- this.comboBox.Dock = System.Windows.Forms.DockStyle.Top;
- this.comboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox.Items.AddRange(new object[] {
- "Build"});
- this.comboBox.Location = new System.Drawing.Point(0, 2);
- this.comboBox.Name = "comboBox";
- this.comboBox.Size = new System.Drawing.Size(255, 21);
- this.comboBox.TabIndex = 1;
- //
- // textBox1
- //
- this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.textBox1.Location = new System.Drawing.Point(0, 23);
- this.textBox1.Multiline = true;
- this.textBox1.Name = "textBox1";
- this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
- this.textBox1.Size = new System.Drawing.Size(255, 340);
- this.textBox1.TabIndex = 2;
- this.textBox1.Text = resources.GetString("textBox1.Text");
- this.textBox1.WordWrap = false;
- //
- // DummyOutputWindow
- //
- this.ClientSize = new System.Drawing.Size(255, 365);
- this.Controls.Add(this.textBox1);
- this.Controls.Add(this.comboBox);
- this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.Float | WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)));
- this.HideOnClose = true;
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Name = "DummyOutputWindow";
- this.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
- this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockBottomAutoHide;
- this.TabText = "Output";
- this.Text = "Output";
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
- #endregion
-
- private System.Windows.Forms.ComboBox comboBox;
- private System.Windows.Forms.TextBox textBox1;
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyOutputWindow.cs b/src/Libraries/DockPanel_Src/DockSample/DummyOutputWindow.cs
deleted file mode 100644
index 51dfee8317..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyOutputWindow.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using WeifenLuo.WinFormsUI.Docking;
-
-namespace DockSample
-{
- public partial class DummyOutputWindow : ToolWindow
- {
- public DummyOutputWindow()
- {
- InitializeComponent();
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyOutputWindow.resx b/src/Libraries/DockPanel_Src/DockSample/DummyOutputWindow.resx
deleted file mode 100644
index bb68f5893a..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyOutputWindow.resx
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- ------ Build started: Project: WeifenLuo.WinFormsUI.Docking, Configuration: Debug .NET ------
-
-Preparing resources...
-Updating references...
-Performing main compilation...
-
-Build complete -- 0 errors, 0 warnings
-Building satellite assemblies...
-
-
-
------- Build started: Project: DockSample, Configuration: Debug .NET ------
-
-Preparing resources...
-Updating references...
-Performing main compilation...
-
-Build complete -- 0 errors, 0 warnings
-Building satellite assemblies...
-
-
-
----------------------- Done ----------------------
-
- Build: 2 succeeded, 0 failed, 0 skipped
-
-
-
-
-
-
- AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAAAIAAAAAAAAAAAAAEAAAABAA
- AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
- AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////wAAAAAA
- AP////////////8AAAAAAAD/d3d3d3d3d///AAAAAAAA/3d3d3d3d3f//wAAAAAAAP////////////8A
- AAAAAAD/////////////AAAAAAAA/3d3d3d3d3d3/wAAAAAAAP93d3d3d3d3d/8AAAAAAAD/////////
- ////AAAAAAAA/////////////wAAAAAAAP8AAAAAAAAA//8AAAAAAAD/AAAAAAAAAP//AAAAAAAA////
- /////////wAAAAAAAP////////////8AAAAAAAD/d3d3d3d3d3f/AAAAAAAA/3d3d3d3d3d3/wAAAAAA
- AP////////////8AAAAAAAD/////////////AAAAAABEREREREREREREREQAAAAARERERERERERERERE
- AAAAAERERERERERERERERAAAAABEREREREREREREREQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////8AAAD/AA
- AA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AA
- AA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP/////////////////////w==
-
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyPropertyWindow.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/DummyPropertyWindow.Designer.cs
deleted file mode 100644
index 7bcb62b7df..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyPropertyWindow.Designer.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-namespace DockSample
-{
- partial class DummyPropertyWindow
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DummyPropertyWindow));
- this.propertyGrid = new System.Windows.Forms.PropertyGrid();
- this.comboBox = new System.Windows.Forms.ComboBox();
- this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components);
- this.menuItem1 = new System.Windows.Forms.MenuItem();
- this.SuspendLayout();
- //
- // propertyGrid
- //
- this.propertyGrid.Dock = System.Windows.Forms.DockStyle.Fill;
- this.propertyGrid.LineColor = System.Drawing.SystemColors.ScrollBar;
- this.propertyGrid.Location = new System.Drawing.Point(0, 3);
- this.propertyGrid.Name = "propertyGrid";
- this.propertyGrid.Size = new System.Drawing.Size(208, 283);
- this.propertyGrid.TabIndex = 0;
- //
- // comboBox
- //
- this.comboBox.Dock = System.Windows.Forms.DockStyle.Top;
- this.comboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox.Items.AddRange(new object[] {
- "propertyGrid"});
- this.comboBox.Location = new System.Drawing.Point(0, 3);
- this.comboBox.Name = "comboBox";
- this.comboBox.Size = new System.Drawing.Size(208, 21);
- this.comboBox.TabIndex = 1;
- //
- // mainMenu1
- //
- this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
- this.menuItem1});
- //
- // menuItem1
- //
- this.menuItem1.Index = 0;
- this.menuItem1.Text = "File";
- //
- // DummyPropertyWindow
- //
- this.ClientSize = new System.Drawing.Size(208, 289);
- this.Controls.Add(this.comboBox);
- this.Controls.Add(this.propertyGrid);
- this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.Float | WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)));
- this.HideOnClose = true;
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Menu = this.mainMenu1;
- this.Name = "DummyPropertyWindow";
- this.Padding = new System.Windows.Forms.Padding(0, 3, 0, 3);
- this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockRight;
- this.TabText = "Properties";
- this.Text = "Properties";
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private System.Windows.Forms.PropertyGrid propertyGrid;
- private System.Windows.Forms.ComboBox comboBox;
- private System.Windows.Forms.MainMenu mainMenu1;
- private System.Windows.Forms.MenuItem menuItem1;
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyPropertyWindow.cs b/src/Libraries/DockPanel_Src/DockSample/DummyPropertyWindow.cs
deleted file mode 100644
index 0c69557916..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyPropertyWindow.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using WeifenLuo.WinFormsUI.Docking;
-
-namespace DockSample
-{
- public partial class DummyPropertyWindow : ToolWindow
- {
- public DummyPropertyWindow()
- {
- InitializeComponent();
- comboBox.SelectedIndex = 0;
- propertyGrid.SelectedObject = propertyGrid;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyPropertyWindow.resx b/src/Libraries/DockPanel_Src/DockSample/DummyPropertyWindow.resx
deleted file mode 100644
index 35aa996be5..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyPropertyWindow.resx
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 17, 17
-
-
-
-
- AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAAAIAAAAAAAAAAAAAEAAAABAA
- AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
- AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAD/////////////AAAAAAAA/////////////wAAAAAAAP8AAP8AAAAAAP8AAAAAAAD/
- AAD/AAAAAAD/AAAAAAAA/////////////wAAAAAAAP////////////8AAAAAAAD/AAD/AAAAAAD/AAAA
- AAAA/wAA/wAAAAAA/wAAAAAAAP////////////8AAAAAAAD/////////////AAAAAAAA//8AAP///wD/
- /wAAAAAAAP//AAD///8A//8AAAAAAAD//wAAAP8AAAD/AAAAAEQA//8AAAD/AAAA/wAAAABEAP///wAA
- AAAAAAAAAABERAD///8AAAAAAAAAAAAAREQAAAAAAAAAAAAAAAAAAEREAAAAAAAAAAAAAAAAAABERAAA
- AAAAAAAAAAAAAAAAREQAAAAAAAAAAAAAAAAAAEREAAAAAAAAAAAAAAAAAABERAAAAAAAAAAAAAAAAAAA
- REQAAAAAAAAAAAAAAAAAAEREAAAAAAAAAAAAAAAAAABERAAAAAAAAAAAAAAAAAAAREQAAAAAAAAAAAAA
- AAAAAEREAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////wAAAP8AAAD/AAAA/wAA
- AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AMDA/ADAwPwAMzAwADMwMAAM
- z8AADM/A//M/8P/zP/D//P/w//z/8P//AAD//wAA////8P////D//////////w==
-
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummySolutionExplorer.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/DummySolutionExplorer.Designer.cs
deleted file mode 100644
index 66abaa2bf2..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummySolutionExplorer.Designer.cs
+++ /dev/null
@@ -1,462 +0,0 @@
-namespace DockSample
-{
- partial class DummySolutionExplorer
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("Solution \'WinFormsUI\' (2 projects)");
- System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("System", 6, 6);
- System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("System.Data", 6, 6);
- System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("System.Drawing", 6, 6);
- System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("System.Windows.Forms", 6, 6);
- System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("System.XML", 6, 6);
- System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("WeifenLuo.WinFormsUI.Docking", 6, 6);
- System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("References", 4, 4, new System.Windows.Forms.TreeNode[] {
- treeNode2,
- treeNode3,
- treeNode4,
- treeNode5,
- treeNode6,
- treeNode7});
- System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("BlankIcon.ico", 5, 5);
- System.Windows.Forms.TreeNode treeNode10 = new System.Windows.Forms.TreeNode("CSProject.ico", 5, 5);
- System.Windows.Forms.TreeNode treeNode11 = new System.Windows.Forms.TreeNode("OutputWindow.ico", 5, 5);
- System.Windows.Forms.TreeNode treeNode12 = new System.Windows.Forms.TreeNode("References.ico", 5, 5);
- System.Windows.Forms.TreeNode treeNode13 = new System.Windows.Forms.TreeNode("SolutionExplorer.ico", 5, 5);
- System.Windows.Forms.TreeNode treeNode14 = new System.Windows.Forms.TreeNode("TaskListWindow.ico", 5, 5);
- System.Windows.Forms.TreeNode treeNode15 = new System.Windows.Forms.TreeNode("ToolboxWindow.ico", 5, 5);
- System.Windows.Forms.TreeNode treeNode16 = new System.Windows.Forms.TreeNode("Images", 2, 1, new System.Windows.Forms.TreeNode[] {
- treeNode9,
- treeNode10,
- treeNode11,
- treeNode12,
- treeNode13,
- treeNode14,
- treeNode15});
- System.Windows.Forms.TreeNode treeNode17 = new System.Windows.Forms.TreeNode("AboutDialog.cs", 8, 8);
- System.Windows.Forms.TreeNode treeNode18 = new System.Windows.Forms.TreeNode("App.ico", 5, 5);
- System.Windows.Forms.TreeNode treeNode19 = new System.Windows.Forms.TreeNode("AssemblyInfo.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode20 = new System.Windows.Forms.TreeNode("DummyOutputWindow.cs", 8, 8);
- System.Windows.Forms.TreeNode treeNode21 = new System.Windows.Forms.TreeNode("DummyPropertyWindow.cs", 8, 8);
- System.Windows.Forms.TreeNode treeNode22 = new System.Windows.Forms.TreeNode("DummySolutionExplorer.cs", 8, 8);
- System.Windows.Forms.TreeNode treeNode23 = new System.Windows.Forms.TreeNode("DummyTaskList.cs", 8, 8);
- System.Windows.Forms.TreeNode treeNode24 = new System.Windows.Forms.TreeNode("DummyToolbox.cs", 8, 8);
- System.Windows.Forms.TreeNode treeNode25 = new System.Windows.Forms.TreeNode("MianForm.cs", 8, 8);
- System.Windows.Forms.TreeNode treeNode26 = new System.Windows.Forms.TreeNode("Options.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode27 = new System.Windows.Forms.TreeNode("OptionsDialog.cs", 8, 8);
- System.Windows.Forms.TreeNode treeNode28 = new System.Windows.Forms.TreeNode("DockSample", 3, 3, new System.Windows.Forms.TreeNode[] {
- treeNode8,
- treeNode16,
- treeNode17,
- treeNode18,
- treeNode19,
- treeNode20,
- treeNode21,
- treeNode22,
- treeNode23,
- treeNode24,
- treeNode25,
- treeNode26,
- treeNode27});
- System.Windows.Forms.TreeNode treeNode29 = new System.Windows.Forms.TreeNode("System", 6, 6);
- System.Windows.Forms.TreeNode treeNode30 = new System.Windows.Forms.TreeNode("System.Data", 6, 6);
- System.Windows.Forms.TreeNode treeNode31 = new System.Windows.Forms.TreeNode("System.Design", 6, 6);
- System.Windows.Forms.TreeNode treeNode32 = new System.Windows.Forms.TreeNode("System.Drawing", 6, 6);
- System.Windows.Forms.TreeNode treeNode33 = new System.Windows.Forms.TreeNode("System.Windows.Forms", 6, 6);
- System.Windows.Forms.TreeNode treeNode34 = new System.Windows.Forms.TreeNode("System.XML", 6, 6);
- System.Windows.Forms.TreeNode treeNode35 = new System.Windows.Forms.TreeNode("References", 4, 4, new System.Windows.Forms.TreeNode[] {
- treeNode29,
- treeNode30,
- treeNode31,
- treeNode32,
- treeNode33,
- treeNode34});
- System.Windows.Forms.TreeNode treeNode36 = new System.Windows.Forms.TreeNode("DockWindow.AutoHideNo.bmp", 9, 9);
- System.Windows.Forms.TreeNode treeNode37 = new System.Windows.Forms.TreeNode("DockWindow.AutoHideYes.bmp", 9, 9);
- System.Windows.Forms.TreeNode treeNode38 = new System.Windows.Forms.TreeNode("DockWindow.Close.bmp", 9, 9);
- System.Windows.Forms.TreeNode treeNode39 = new System.Windows.Forms.TreeNode("DocumentWindow.Close.bmp", 9, 9);
- System.Windows.Forms.TreeNode treeNode40 = new System.Windows.Forms.TreeNode("DocumentWindow.ScrollLeftDisabled.bmp", 9, 9);
- System.Windows.Forms.TreeNode treeNode41 = new System.Windows.Forms.TreeNode("DocumentWindow.ScrollLeftEnabled.bmp", 9, 9);
- System.Windows.Forms.TreeNode treeNode42 = new System.Windows.Forms.TreeNode("DocumentWindow.ScrollRightDisabled.bmp", 9, 9);
- System.Windows.Forms.TreeNode treeNode43 = new System.Windows.Forms.TreeNode("DocumentWindow.ScrollRightEnabled.bmp", 9, 9);
- System.Windows.Forms.TreeNode treeNode44 = new System.Windows.Forms.TreeNode("Resources", 2, 1, new System.Windows.Forms.TreeNode[] {
- treeNode36,
- treeNode37,
- treeNode38,
- treeNode39,
- treeNode40,
- treeNode41,
- treeNode42,
- treeNode43});
- System.Windows.Forms.TreeNode treeNode45 = new System.Windows.Forms.TreeNode("Enums.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode46 = new System.Windows.Forms.TreeNode("Gdi32.cs", 7, 3);
- System.Windows.Forms.TreeNode treeNode47 = new System.Windows.Forms.TreeNode("Structs.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode48 = new System.Windows.Forms.TreeNode("User32.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode49 = new System.Windows.Forms.TreeNode("Win32", 2, 1, new System.Windows.Forms.TreeNode[] {
- treeNode45,
- treeNode46,
- treeNode47,
- treeNode48});
- System.Windows.Forms.TreeNode treeNode50 = new System.Windows.Forms.TreeNode("AssemblyInfo.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode51 = new System.Windows.Forms.TreeNode("Content.cs", 8, 8);
- System.Windows.Forms.TreeNode treeNode52 = new System.Windows.Forms.TreeNode("CotentCollection.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode53 = new System.Windows.Forms.TreeNode("CotentWindowCollection.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode54 = new System.Windows.Forms.TreeNode("DockHelper.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode55 = new System.Windows.Forms.TreeNode("DragHandler.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode56 = new System.Windows.Forms.TreeNode("DragHandlerBase.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode57 = new System.Windows.Forms.TreeNode("FloatWindow.cs", 8, 8);
- System.Windows.Forms.TreeNode treeNode58 = new System.Windows.Forms.TreeNode("HiddenMdiChild.cs", 8, 8);
- System.Windows.Forms.TreeNode treeNode59 = new System.Windows.Forms.TreeNode("InertButton.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode60 = new System.Windows.Forms.TreeNode("Measures.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode61 = new System.Windows.Forms.TreeNode("NormalTabStripWindow.cs", 8, 8);
- System.Windows.Forms.TreeNode treeNode62 = new System.Windows.Forms.TreeNode("ResourceHelper.cs", 7, 7);
- System.Windows.Forms.TreeNode treeNode63 = new System.Windows.Forms.TreeNode("WeifenLuo.WinFormsUI.Docking", 3, 3, new System.Windows.Forms.TreeNode[] {
- treeNode35,
- treeNode44,
- treeNode49,
- treeNode50,
- treeNode51,
- treeNode52,
- treeNode53,
- treeNode54,
- treeNode55,
- treeNode56,
- treeNode57,
- treeNode58,
- treeNode59,
- treeNode60,
- treeNode61,
- treeNode62});
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DummySolutionExplorer));
- this.treeView1 = new System.Windows.Forms.TreeView();
- this.imageList1 = new System.Windows.Forms.ImageList(this.components);
- this.SuspendLayout();
- //
- // treeView1
- //
- this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.treeView1.ImageIndex = 0;
- this.treeView1.ImageList = this.imageList1;
- this.treeView1.Indent = 19;
- this.treeView1.Location = new System.Drawing.Point(0, 24);
- this.treeView1.Name = "treeView1";
- treeNode1.Name = "";
- treeNode1.Text = "Solution \'WinFormsUI\' (2 projects)";
- treeNode2.ImageIndex = 6;
- treeNode2.Name = "";
- treeNode2.SelectedImageIndex = 6;
- treeNode2.Text = "System";
- treeNode3.ImageIndex = 6;
- treeNode3.Name = "";
- treeNode3.SelectedImageIndex = 6;
- treeNode3.Text = "System.Data";
- treeNode4.ImageIndex = 6;
- treeNode4.Name = "";
- treeNode4.SelectedImageIndex = 6;
- treeNode4.Text = "System.Drawing";
- treeNode5.ImageIndex = 6;
- treeNode5.Name = "";
- treeNode5.SelectedImageIndex = 6;
- treeNode5.Text = "System.Windows.Forms";
- treeNode6.ImageIndex = 6;
- treeNode6.Name = "";
- treeNode6.SelectedImageIndex = 6;
- treeNode6.Text = "System.XML";
- treeNode7.ImageIndex = 6;
- treeNode7.Name = "";
- treeNode7.SelectedImageIndex = 6;
- treeNode7.Text = "WeifenLuo.WinFormsUI.Docking";
- treeNode8.ImageIndex = 4;
- treeNode8.Name = "";
- treeNode8.SelectedImageIndex = 4;
- treeNode8.Text = "References";
- treeNode9.ImageIndex = 5;
- treeNode9.Name = "";
- treeNode9.SelectedImageIndex = 5;
- treeNode9.Text = "BlankIcon.ico";
- treeNode10.ImageIndex = 5;
- treeNode10.Name = "";
- treeNode10.SelectedImageIndex = 5;
- treeNode10.Text = "CSProject.ico";
- treeNode11.ImageIndex = 5;
- treeNode11.Name = "";
- treeNode11.SelectedImageIndex = 5;
- treeNode11.Text = "OutputWindow.ico";
- treeNode12.ImageIndex = 5;
- treeNode12.Name = "";
- treeNode12.SelectedImageIndex = 5;
- treeNode12.Text = "References.ico";
- treeNode13.ImageIndex = 5;
- treeNode13.Name = "";
- treeNode13.SelectedImageIndex = 5;
- treeNode13.Text = "SolutionExplorer.ico";
- treeNode14.ImageIndex = 5;
- treeNode14.Name = "";
- treeNode14.SelectedImageIndex = 5;
- treeNode14.Text = "TaskListWindow.ico";
- treeNode15.ImageIndex = 5;
- treeNode15.Name = "";
- treeNode15.SelectedImageIndex = 5;
- treeNode15.Text = "ToolboxWindow.ico";
- treeNode16.ImageIndex = 2;
- treeNode16.Name = "";
- treeNode16.SelectedImageIndex = 1;
- treeNode16.Text = "Images";
- treeNode17.ImageIndex = 8;
- treeNode17.Name = "";
- treeNode17.SelectedImageIndex = 8;
- treeNode17.Text = "AboutDialog.cs";
- treeNode18.ImageIndex = 5;
- treeNode18.Name = "";
- treeNode18.SelectedImageIndex = 5;
- treeNode18.Text = "App.ico";
- treeNode19.ImageIndex = 7;
- treeNode19.Name = "";
- treeNode19.SelectedImageIndex = 7;
- treeNode19.Text = "AssemblyInfo.cs";
- treeNode20.ImageIndex = 8;
- treeNode20.Name = "";
- treeNode20.SelectedImageIndex = 8;
- treeNode20.Text = "DummyOutputWindow.cs";
- treeNode21.ImageIndex = 8;
- treeNode21.Name = "";
- treeNode21.SelectedImageIndex = 8;
- treeNode21.Text = "DummyPropertyWindow.cs";
- treeNode22.ImageIndex = 8;
- treeNode22.Name = "";
- treeNode22.SelectedImageIndex = 8;
- treeNode22.Text = "DummySolutionExplorer.cs";
- treeNode23.ImageIndex = 8;
- treeNode23.Name = "";
- treeNode23.SelectedImageIndex = 8;
- treeNode23.Text = "DummyTaskList.cs";
- treeNode24.ImageIndex = 8;
- treeNode24.Name = "";
- treeNode24.SelectedImageIndex = 8;
- treeNode24.Text = "DummyToolbox.cs";
- treeNode25.ImageIndex = 8;
- treeNode25.Name = "";
- treeNode25.SelectedImageIndex = 8;
- treeNode25.Text = "MianForm.cs";
- treeNode26.ImageIndex = 7;
- treeNode26.Name = "";
- treeNode26.SelectedImageIndex = 7;
- treeNode26.Text = "Options.cs";
- treeNode27.ImageIndex = 8;
- treeNode27.Name = "";
- treeNode27.SelectedImageIndex = 8;
- treeNode27.Text = "OptionsDialog.cs";
- treeNode28.ImageIndex = 3;
- treeNode28.Name = "";
- treeNode28.SelectedImageIndex = 3;
- treeNode28.Text = "DockSample";
- treeNode29.ImageIndex = 6;
- treeNode29.Name = "";
- treeNode29.SelectedImageIndex = 6;
- treeNode29.Text = "System";
- treeNode30.ImageIndex = 6;
- treeNode30.Name = "";
- treeNode30.SelectedImageIndex = 6;
- treeNode30.Text = "System.Data";
- treeNode31.ImageIndex = 6;
- treeNode31.Name = "";
- treeNode31.SelectedImageIndex = 6;
- treeNode31.Text = "System.Design";
- treeNode32.ImageIndex = 6;
- treeNode32.Name = "";
- treeNode32.SelectedImageIndex = 6;
- treeNode32.Text = "System.Drawing";
- treeNode33.ImageIndex = 6;
- treeNode33.Name = "";
- treeNode33.SelectedImageIndex = 6;
- treeNode33.Text = "System.Windows.Forms";
- treeNode34.ImageIndex = 6;
- treeNode34.Name = "";
- treeNode34.SelectedImageIndex = 6;
- treeNode34.Text = "System.XML";
- treeNode35.ImageIndex = 4;
- treeNode35.Name = "";
- treeNode35.SelectedImageIndex = 4;
- treeNode35.Text = "References";
- treeNode36.ImageIndex = 9;
- treeNode36.Name = "";
- treeNode36.SelectedImageIndex = 9;
- treeNode36.Text = "DockWindow.AutoHideNo.bmp";
- treeNode37.ImageIndex = 9;
- treeNode37.Name = "";
- treeNode37.SelectedImageIndex = 9;
- treeNode37.Text = "DockWindow.AutoHideYes.bmp";
- treeNode38.ImageIndex = 9;
- treeNode38.Name = "";
- treeNode38.SelectedImageIndex = 9;
- treeNode38.Text = "DockWindow.Close.bmp";
- treeNode39.ImageIndex = 9;
- treeNode39.Name = "";
- treeNode39.SelectedImageIndex = 9;
- treeNode39.Text = "DocumentWindow.Close.bmp";
- treeNode40.ImageIndex = 9;
- treeNode40.Name = "";
- treeNode40.SelectedImageIndex = 9;
- treeNode40.Text = "DocumentWindow.ScrollLeftDisabled.bmp";
- treeNode41.ImageIndex = 9;
- treeNode41.Name = "";
- treeNode41.SelectedImageIndex = 9;
- treeNode41.Text = "DocumentWindow.ScrollLeftEnabled.bmp";
- treeNode42.ImageIndex = 9;
- treeNode42.Name = "";
- treeNode42.SelectedImageIndex = 9;
- treeNode42.Text = "DocumentWindow.ScrollRightDisabled.bmp";
- treeNode43.ImageIndex = 9;
- treeNode43.Name = "";
- treeNode43.SelectedImageIndex = 9;
- treeNode43.Text = "DocumentWindow.ScrollRightEnabled.bmp";
- treeNode44.ImageIndex = 2;
- treeNode44.Name = "";
- treeNode44.SelectedImageIndex = 1;
- treeNode44.Text = "Resources";
- treeNode45.ImageIndex = 7;
- treeNode45.Name = "";
- treeNode45.SelectedImageIndex = 7;
- treeNode45.Text = "Enums.cs";
- treeNode46.ImageIndex = 7;
- treeNode46.Name = "";
- treeNode46.SelectedImageIndex = 3;
- treeNode46.Text = "Gdi32.cs";
- treeNode47.ImageIndex = 7;
- treeNode47.Name = "";
- treeNode47.SelectedImageIndex = 7;
- treeNode47.Text = "Structs.cs";
- treeNode48.ImageIndex = 7;
- treeNode48.Name = "";
- treeNode48.SelectedImageIndex = 7;
- treeNode48.Text = "User32.cs";
- treeNode49.ImageIndex = 2;
- treeNode49.Name = "";
- treeNode49.SelectedImageIndex = 1;
- treeNode49.Text = "Win32";
- treeNode50.ImageIndex = 7;
- treeNode50.Name = "";
- treeNode50.SelectedImageIndex = 7;
- treeNode50.Text = "AssemblyInfo.cs";
- treeNode51.ImageIndex = 8;
- treeNode51.Name = "";
- treeNode51.SelectedImageIndex = 8;
- treeNode51.Text = "Content.cs";
- treeNode52.ImageIndex = 7;
- treeNode52.Name = "";
- treeNode52.SelectedImageIndex = 7;
- treeNode52.Text = "CotentCollection.cs";
- treeNode53.ImageIndex = 7;
- treeNode53.Name = "";
- treeNode53.SelectedImageIndex = 7;
- treeNode53.Text = "CotentWindowCollection.cs";
- treeNode54.ImageIndex = 7;
- treeNode54.Name = "";
- treeNode54.SelectedImageIndex = 7;
- treeNode54.Text = "DockHelper.cs";
- treeNode55.ImageIndex = 7;
- treeNode55.Name = "";
- treeNode55.SelectedImageIndex = 7;
- treeNode55.Text = "DragHandler.cs";
- treeNode56.ImageIndex = 7;
- treeNode56.Name = "";
- treeNode56.SelectedImageIndex = 7;
- treeNode56.Text = "DragHandlerBase.cs";
- treeNode57.ImageIndex = 8;
- treeNode57.Name = "";
- treeNode57.SelectedImageIndex = 8;
- treeNode57.Text = "FloatWindow.cs";
- treeNode58.ImageIndex = 8;
- treeNode58.Name = "";
- treeNode58.SelectedImageIndex = 8;
- treeNode58.Text = "HiddenMdiChild.cs";
- treeNode59.ImageIndex = 7;
- treeNode59.Name = "";
- treeNode59.SelectedImageIndex = 7;
- treeNode59.Text = "InertButton.cs";
- treeNode60.ImageIndex = 7;
- treeNode60.Name = "";
- treeNode60.SelectedImageIndex = 7;
- treeNode60.Text = "Measures.cs";
- treeNode61.ImageIndex = 8;
- treeNode61.Name = "";
- treeNode61.SelectedImageIndex = 8;
- treeNode61.Text = "NormalTabStripWindow.cs";
- treeNode62.ImageIndex = 7;
- treeNode62.Name = "";
- treeNode62.SelectedImageIndex = 7;
- treeNode62.Text = "ResourceHelper.cs";
- treeNode63.ImageIndex = 3;
- treeNode63.Name = "";
- treeNode63.SelectedImageIndex = 3;
- treeNode63.Text = "WeifenLuo.WinFormsUI.Docking";
- this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
- treeNode1,
- treeNode28,
- treeNode63});
- this.treeView1.SelectedImageIndex = 0;
- this.treeView1.Size = new System.Drawing.Size(245, 297);
- this.treeView1.TabIndex = 0;
- //
- // imageList1
- //
- this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
- this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
- this.imageList1.Images.SetKeyName(0, "");
- this.imageList1.Images.SetKeyName(1, "");
- this.imageList1.Images.SetKeyName(2, "");
- this.imageList1.Images.SetKeyName(3, "");
- this.imageList1.Images.SetKeyName(4, "");
- this.imageList1.Images.SetKeyName(5, "");
- this.imageList1.Images.SetKeyName(6, "");
- this.imageList1.Images.SetKeyName(7, "");
- this.imageList1.Images.SetKeyName(8, "");
- this.imageList1.Images.SetKeyName(9, "");
- //
- // DummySolutionExplorer
- //
- this.ClientSize = new System.Drawing.Size(245, 322);
- this.Controls.Add(this.treeView1);
- this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)((((WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)));
- this.HideOnClose = true;
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Name = "DummySolutionExplorer";
- this.Padding = new System.Windows.Forms.Padding(0, 24, 0, 1);
- this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockRight;
- this.TabText = "Solution Explorer";
- this.Text = "Solution Explorer - WinFormsUI";
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private System.Windows.Forms.TreeView treeView1;
- private System.Windows.Forms.ImageList imageList1;
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummySolutionExplorer.cs b/src/Libraries/DockPanel_Src/DockSample/DummySolutionExplorer.cs
deleted file mode 100644
index f8b83d245d..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummySolutionExplorer.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using WeifenLuo.WinFormsUI.Docking;
-
-namespace DockSample
-{
- public partial class DummySolutionExplorer : ToolWindow
- {
- public DummySolutionExplorer()
- {
- InitializeComponent();
- }
-
- protected override void OnRightToLeftLayoutChanged(EventArgs e)
- {
- treeView1.RightToLeftLayout = RightToLeftLayout;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummySolutionExplorer.resx b/src/Libraries/DockPanel_Src/DockSample/DummySolutionExplorer.resx
deleted file mode 100644
index d4b535f276..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummySolutionExplorer.resx
+++ /dev/null
@@ -1,220 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 23, 17
-
-
-
- AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
- LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
- ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADY
- EAAAAk1TRnQBSQFMAgEBCgEAAQ4BAAEEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
- AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
- AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
- AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
- AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
- AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
- AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
- ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
- AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
- AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
- AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
- AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
- AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
- AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
- AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
- AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
- ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
- Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
- AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
- AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
- AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
- ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
- Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
- AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
- AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
- AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
- AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
- AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
- AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/4IAAewMBwMAAewM/yMA
- AewFBwbsAQcDAAHsAf8C7AMCAQMB/gIDAewB/yMAAewBBwPsAQcBAAT/AewBBwMAAewB/wEDAewBAgH+
- AQIB7AEDA+wB/yMAAewFBwUAAewBBwMAAewB/wEDAewBAgH7AQIE7AEDAf8jAAHsDAcDAAHsAf8CAAEC
- Af4B+wECBAAB/yMAAewFBwbsAQcDAAHsAf8B/gECAf4B+wH+AfsBAgP+Af8jAAHsAQcD7AEHAQAE/wHs
- AQcDAAHsAf8BAgH+AfsB/gECAf4B+wECAv4B/yMAAewFBwUAAewBBwMAAewB/wECAfsBAgH7AgIB/gEC
- Af4BAAH/IwAB7AwHAwAB7AH/Af4CAgH+AQIB/gECAf4BAAH7Af8jAAHsDAcDAAHsAf8C/gECAfsBAgP+
- AQAB+wH/IwAOBAIAAewB/wP+AQIF/gEAAf8jAA4EAgAB7Az/MwAN7LQAAewD/wEHAv8BBwL/AQcB/xQA
- AewLBwQADOwEAAHsA/8BBwL/AQcC/wEHAf8UAAHsCv8BBwQAAewC/wEHAf8BBwH/AQcB/wEHAv8EAAHs
- CwcUAAHsBP8FBwH/AQcDAAHsAf8BAAL/BQAB7AEHAQAB7AMAAewB/wLsAQcC7AEHAuwBBwH/FAAB7Ar/
- AQcDAAHsAf8D7AUAAQcB7AEAAewDAAHsAf8C7AEHAuwBBwLsAQcB/wcAAewJBwMAAewE/wUHAf8BBwIA
- AewC/wHsAf8E7AEAAQcB/wEAAuwDAAHsCwcHAAHsAv8BBwH/AQcB/wEHAf8BBwMAAewC/wECB/8BBwIA
- AewL/wEAAQcB7AMAAewB/wLsAQcC7AEHAuwBBwH/AgAB7AH/BOwB/wEHAf8BBwH/AQcB/wIHAwAB7AH/
- AgIB/wECBAcB/wEHAgAN7AH/AewDAAHsAf8C7AEHAuwBBwLsAQcB/wMAAewDAAHsAv8BBwH/AQcB/wEH
- Af8BBwMAAewC/wMCBf8BBwMAAewB/wEHAf8BBwH/AQcB/wEHAf8BBwH/AQcB7AMAAewLBwcAAewB/wEH
- Af8BBwH/AQcB/wIHAwAB7AH/AgIB/wICBP8BBwMAAewC/wEHAf8BBwH/AQcF/wHsAwAB7AH/AuwBBwLs
- AQcC7AEHAf8HAAHsCP8BBwMAAewC/wMCBP8CBwMAAewB/wEHAf8BBwH/AQcB/wbsAwAB7AH/AuwBBwLs
- AQcC7AEHAf8IAAnsAwAB7AL/AQIB/wICAv8HAAHsBf8B7AkAAewIBxcAAewE/wECA/8B7AEAAewFAAXs
- CgAB7AP/AQcC/wEHAf8B7AH/AewUAAHsCP8C7BUAAewD/wEHAv8BBwH/AuwVAArsFgAK7CQABf8DAAP/
- AwAC/zAABP8BAAH8AQABAQEAAf8B7AH7AwAB/yIAAewG/wcAA/8BAAL8AQAB+QEBAQAC+wEAAfokAAHs
- Af8EBAH/BwAB/wEAAewBAAH8AQQB/wEBAfkBAQEAAfsB/wECAfoDAAzsAgAO7AIAAewB+wHsBv8HAAH/
- AewBBwECAfoBAgH/AQMBAQH5AQEBAAH/AQQB/AMAAewB/wH7AQcB+wEHAfsBBwH7AQcB+wHsAgAB7AH/
- AfsBBwH7AQcB+wEHAfsBBwH7AQcB+wHsAgAB7AH/AewB/wQEAf8BAAHsBQAB/wHsAf8BAgL6AQIC+wEB
- AfkBAQEEAvwCAAHsAf8B+wEHAfsBBwH7AQcB+wEHAfsBBwEAAewBAAHsAf8BBwH7AQcB+wEHAfsBBwH7
- AQcB+wEHAewCAAHsAfsB7Ab/AQcF/wEAAf8B7AH/AgIB+gEAAfsBAAH/AQEB+QL8AQAB/wEAAewB/wEH
- AfsBBwH7AQcB+wEHAfsBBwHsAQAB7AEAAewB/wH7AQcB+wEHAfsBBwH7AQcB+wEHAfsB7AIAAewB/wHs
- Af8EBAL/AQIE/wEAAf8B7AL/AgIBAAEDAf8B7AH/AQECAAL/AewB/wEHAfsBBwH7AQcB+wEHAfsBBwH7
- AQAC7AEAAewB/wEHAfsBBwH7AQcB+wEHAfsBBwH7AQcB7AIAAewB+wHsBv8CAgH/AQIC/wEAAf8B7AT/
- AQcD/wEHAf8BBwHsAv8B7Ar/AewBAAEHAewBAAHsAf8B+wEHAfsBBwH7AQcB+wEHAfsBBwH7AewCAAHs
- Af8G7AL/AwIC/wEAAf8B7AP/AQcB/wEHAf8BBwH/AQcB/wEAAv8N7AH7AewBAAHsAf8BBwH7AQcB+wEH
- AfsBBwH7AQcB+wEHAewCAAHsAfsB/wH7Af8B+wP/AgIB/wICAf8BAAH/AewC/wEHA/8BBwH/AQcB/wEH
- AQAC/wEAAewB/wEHAfsBBwH7AQcB+wEHAfsBBwH7AQcB7AEAAewB/wH7AQcB+wEHAfsBBwH7AQcB+wEH
- AfsB7AIAB+wD/wMCAv8BAAH/AewF/wEHAf8BBwH/AQcB/wEAAv8BAAHsAf8B+wEHAfsBBwH7AQcF/wHs
- AQAB7Az/AewEAAHsB/8BAgH/AgIB/wEAAf8B7AT/AQcD/wEHAf8BBwEAAv8BAAHsAf8BBwH7AQcB+wEH
- Af8G7AEAAewBBwH7AQcB+wEHAfsBBwbsBQAJ/wECAv8BAAH/DwQCAAHsBf8B7AgAAewBBwH7AQcB+wEH
- AewKAAYGAQcBBgEHAQYDBwEAAf8PBAMABewKAAXsCwAHBgEHAQYBBwEGAQcBBgEAEP8wAAFCAU0BPgcA
- AT4DAAEoAwABQAMAATADAAEBAQABAQUAAYABARYAA/8BAAT/BAABgAEBAYABAQQAAYABAQGAAQEEAAGA
- AQEBgAEBBAABgAEBAYABAQQAAYABAQGAAQEEAAGAAQEBgAEBBAABgAEBAYABAQQAAYABAQGAAQEEAAGA
- AQEBgAEBBAABgAEBAYABAQQAAYABAQGAAQEEAAGAAQEBgAEBBAABgAEBAYABAQQAAv8BgAEBBAAE/wQA
- Av8BwAEBAv8BwAEBAeABAAHAAQEC/wHAAQEBwAEAAcABAQL/AcABAQHAAQABwAEBAv8BwAEBAYABAAHA
- AQEB/AEBAcABAQGDAsABAQH4AQABwAEBAgABwAEBAZgBAAHAAQECAAHAAQECAAHAAQECAAHAAQEBmAEA
- AcABAQGAAQABwAEBAfgBAAHAAQEBgAEAAcABAQH4AQABwAEBAYABAQHAAQEB/AEBAcABAQHAAX8BwAEB
- Av8BwAELAeAB/wHAAQMC/wHAAQcC/wHAAQcC/wHAAQ8C/wHAAQ8E/wIABP8BwAE/AgAE/wHAAT8CAAHg
- AQABgAEBAQABPwIAAcACAAEBAQABPwIAAcACAAEBBAABgAIAAQEEAAGAAgABAQcAAQEHAAEBBwABAQQA
- AYACAAEBBAABgAIAAQEBwAMAAYABAQEAAQMBwAMAAcABfwGAAf8BwAMAAeAB/wHBAf8BwAMABv8L
-
-
-
-
-
- AAABAAEAICAEAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
- AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- QAAAAAAwAAAAAAAAAAAABMGZEAADiIgAAAAAAAAAAEzBmZEAP7u4AgAAAAAAAATMQZmZEIu7uAogAAAA
- AAB0xAGZmZEIu7gKogAHiIiIgED/GZmZEIuACqoAB/j4+PIP//GZmZEID/KqAAf//4+CIP//GZmZEP//
- KgAH//j48qIP84GZmZEP//IAB////4KqID+4GZmZEP9MAAf///jyqqD7u4GZmZEEzAAH////jyqg+7u4
- GZmRDMxAB/////jyoPu7gPGZkQzEAAf///+P/yD//w+PGZEMQAAH//////jzMzP4+PERBAAAB///////
- j4+Pj4+Pj4AAAAf///////j4+Pj4+PiAAAAH////////j4+Pj4+PgAAAB///////+P/4+Pj4+IAAAAf/
- ////////j/+Pj4+AAAAH///////////4+Pj4gAAAB////////////4+Pj4AAAAf///////////j4+PiA
- AAAH//////////+Pj4+PgAAABEREREREREREREREREQAAAREREREREREREREREREAAAERERERERERERE
- RERERAAABEREREREREREREREREQAAAAAAAAAAAAAAAAAAAAAAAD/////////////////8Hwf/+A4D//A
- EAf/gAADgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAADgAAAB4AAAA+AAAAPgAAAD4AA
- AA+AAAAPgAAAD4AAAA+AAAAPgAAAD4AAAA+AAAAPgAAAD4AAAA+AAAAP/////w==
-
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyTaskList.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/DummyTaskList.Designer.cs
deleted file mode 100644
index 89ad51bb4f..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyTaskList.Designer.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-namespace DockSample
-{
- partial class DummyTaskList
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DummyTaskList));
- this.listView1 = new System.Windows.Forms.ListView();
- this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
- this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
- this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
- this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
- this.columnHeader5 = new System.Windows.Forms.ColumnHeader();
- this.SuspendLayout();
- //
- // listView1
- //
- this.listView1.AllowColumnReorder = true;
- this.listView1.AutoArrange = false;
- this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
- this.columnHeader1,
- this.columnHeader2,
- this.columnHeader3,
- this.columnHeader4,
- this.columnHeader5});
- this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.listView1.FullRowSelect = true;
- this.listView1.HideSelection = false;
- this.listView1.Location = new System.Drawing.Point(0, 3);
- this.listView1.MultiSelect = false;
- this.listView1.Name = "listView1";
- this.listView1.Size = new System.Drawing.Size(337, 370);
- this.listView1.TabIndex = 0;
- this.listView1.UseCompatibleStateImageBehavior = false;
- this.listView1.View = System.Windows.Forms.View.Details;
- //
- // columnHeader1
- //
- this.columnHeader1.Text = "!";
- this.columnHeader1.Width = 16;
- //
- // columnHeader2
- //
- this.columnHeader2.Text = "";
- this.columnHeader2.Width = 16;
- //
- // columnHeader3
- //
- this.columnHeader3.Text = "Description";
- this.columnHeader3.Width = 300;
- //
- // columnHeader4
- //
- this.columnHeader4.Text = "File";
- this.columnHeader4.Width = 150;
- //
- // columnHeader5
- //
- this.columnHeader5.Text = "Line";
- //
- // DummyTaskList
- //
- this.ClientSize = new System.Drawing.Size(337, 376);
- this.Controls.Add(this.listView1);
- this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.Float | WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)));
- this.HideOnClose = true;
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Name = "DummyTaskList";
- this.Padding = new System.Windows.Forms.Padding(0, 3, 0, 3);
- this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockTopAutoHide;
- this.TabText = "Task List";
- this.Text = "Task List";
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private System.Windows.Forms.ListView listView1;
- private System.Windows.Forms.ColumnHeader columnHeader1;
- private System.Windows.Forms.ColumnHeader columnHeader2;
- private System.Windows.Forms.ColumnHeader columnHeader3;
- private System.Windows.Forms.ColumnHeader columnHeader4;
- private System.Windows.Forms.ColumnHeader columnHeader5;
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyTaskList.cs b/src/Libraries/DockPanel_Src/DockSample/DummyTaskList.cs
deleted file mode 100644
index 17f467b7a4..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyTaskList.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using WeifenLuo.WinFormsUI.Docking;
-
-namespace DockSample
-{
- public partial class DummyTaskList : ToolWindow
- {
- public DummyTaskList()
- {
- InitializeComponent();
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyTaskList.resx b/src/Libraries/DockPanel_Src/DockSample/DummyTaskList.resx
deleted file mode 100644
index 89b780eb23..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyTaskList.resx
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
-
-
- AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAAAIAAAAAAAAAAAAAEAAAABAA
- AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
- AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAd/////////////8AAAAAAHf/////////////AAAAAAB3////iIj//////wAAAAAA
- d////4iI//////8AAAAAAHf///8RiIj/////AAAAAAB3////EYiI/////wAAAAAAd///ERERiIj///8A
- AAAAAHf//xEREYiI////AAAAAAB3/xER/xERiP///wAAAAAAd/8REf8REYj///8AAAAAAHf//////xF3
- iP//AAAAAAB3//////8Rd4j//wAAAAAAd////////xGIiP8AAAAAAHf///////8RiIj/AAAAAAB3////
- /////xGI/wAAAAAAd/////////8RiP8AAAAAAHf//////////xH/AAAAAAB3//////////8R/wAAAAAA
- d/////////////8AAAAAAHf/////////////AAAAAAB3//8AAAAAAAD//wAAAAAAd///AAAAAAAA//8A
- AAAAAAB3dwD/iIiIAHd3AAAAAAAAd3cA/4iIiAB3dwAAAAAAAAAAAHd3d3cAAAAAAAAAAAAAAAB3d3d3
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////wAAD/8AAA/8AAAD/AA
- AA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AA
- AA/wAAAP8AAAD/AAAA/wAAAP8AAAD/wAAD/8AAA///AP///wD////////////w==
-
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyToolbox.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/DummyToolbox.Designer.cs
deleted file mode 100644
index 1b1764912c..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyToolbox.Designer.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-namespace DockSample
-{
- partial class DummyToolbox
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DummyToolbox));
- this.label2 = new System.Windows.Forms.Label();
- this.imageList = new System.Windows.Forms.ImageList(this.components);
- this.label1 = new System.Windows.Forms.Label();
- this.SuspendLayout();
- //
- // label2
- //
- this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.label2.BackColor = System.Drawing.SystemColors.ControlLightLight;
- this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
- this.label2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
- this.label2.ImageIndex = 0;
- this.label2.ImageList = this.imageList;
- this.label2.Location = new System.Drawing.Point(2, 26);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(215, 19);
- this.label2.TabIndex = 5;
- this.label2.Text = " Pointer";
- this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // imageList
- //
- this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
- this.imageList.TransparentColor = System.Drawing.Color.Transparent;
- this.imageList.Images.SetKeyName(0, "Mouse.bmp");
- //
- // label1
- //
- this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.label1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
- this.label1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
- this.label1.Location = new System.Drawing.Point(2, 7);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(215, 19);
- this.label1.TabIndex = 6;
- this.label1.Text = "General";
- //
- // DummyToolbox
- //
- this.ClientSize = new System.Drawing.Size(221, 365);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.label2);
- this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.Float | WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)));
- this.HideOnClose = true;
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Name = "DummyToolbox";
- this.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
- this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockLeftAutoHide;
- this.TabText = "Toolbox";
- this.Text = "Toolbox";
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.ImageList imageList;
- private System.Windows.Forms.Label label1;
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyToolbox.cs b/src/Libraries/DockPanel_Src/DockSample/DummyToolbox.cs
deleted file mode 100644
index 43f40f5c51..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyToolbox.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using WeifenLuo.WinFormsUI.Docking;
-
-namespace DockSample
-{
- public partial class DummyToolbox : ToolWindow
- {
- public DummyToolbox()
- {
- InitializeComponent();
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/DummyToolbox.resx b/src/Libraries/DockPanel_Src/DockSample/DummyToolbox.resx
deleted file mode 100644
index 34411700e9..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/DummyToolbox.resx
+++ /dev/null
@@ -1,181 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 17, 17
-
-
-
- AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
- LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
- ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACa
- BwAAAk1TRnQBSQFMAwEBAAEFAQABBAEAARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
- AUADAAEQAwABAQEAAQgGAAEEGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA
- AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA
- AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm
- AwABmQMAAcwCAAEzAwACMwIAATMBZgIAATMBmQIAATMBzAIAATMB/wIAAWYDAAFmATMCAAJmAgABZgGZ
- AgABZgHMAgABZgH/AgABmQMAAZkBMwIAAZkBZgIAApkCAAGZAcwCAAGZAf8CAAHMAwABzAEzAgABzAFm
- AgABzAGZAgACzAIAAcwB/wIAAf8BZgIAAf8BmQIAAf8BzAEAATMB/wIAAf8BAAEzAQABMwEAAWYBAAEz
- AQABmQEAATMBAAHMAQABMwEAAf8BAAH/ATMCAAMzAQACMwFmAQACMwGZAQACMwHMAQACMwH/AQABMwFm
- AgABMwFmATMBAAEzAmYBAAEzAWYBmQEAATMBZgHMAQABMwFmAf8BAAEzAZkCAAEzAZkBMwEAATMBmQFm
- AQABMwKZAQABMwGZAcwBAAEzAZkB/wEAATMBzAIAATMBzAEzAQABMwHMAWYBAAEzAcwBmQEAATMCzAEA
- ATMBzAH/AQABMwH/ATMBAAEzAf8BZgEAATMB/wGZAQABMwH/AcwBAAEzAv8BAAFmAwABZgEAATMBAAFm
- AQABZgEAAWYBAAGZAQABZgEAAcwBAAFmAQAB/wEAAWYBMwIAAWYCMwEAAWYBMwFmAQABZgEzAZkBAAFm
- ATMBzAEAAWYBMwH/AQACZgIAAmYBMwEAA2YBAAJmAZkBAAJmAcwBAAFmAZkCAAFmAZkBMwEAAWYBmQFm
- AQABZgKZAQABZgGZAcwBAAFmAZkB/wEAAWYBzAIAAWYBzAEzAQABZgHMAZkBAAFmAswBAAFmAcwB/wEA
- AWYB/wIAAWYB/wEzAQABZgH/AZkBAAFmAf8BzAEAAcwBAAH/AQAB/wEAAcwBAAKZAgABmQEzAZkBAAGZ
- AQABmQEAAZkBAAHMAQABmQMAAZkCMwEAAZkBAAFmAQABmQEzAcwBAAGZAQAB/wEAAZkBZgIAAZkBZgEz
- AQABmQEzAWYBAAGZAWYBmQEAAZkBZgHMAQABmQEzAf8BAAKZATMBAAKZAWYBAAOZAQACmQHMAQACmQH/
- AQABmQHMAgABmQHMATMBAAFmAcwBZgEAAZkBzAGZAQABmQLMAQABmQHMAf8BAAGZAf8CAAGZAf8BMwEA
- AZkBzAFmAQABmQH/AZkBAAGZAf8BzAEAAZkC/wEAAcwDAAGZAQABMwEAAcwBAAFmAQABzAEAAZkBAAHM
- AQABzAEAAZkBMwIAAcwCMwEAAcwBMwFmAQABzAEzAZkBAAHMATMBzAEAAcwBMwH/AQABzAFmAgABzAFm
- ATMBAAGZAmYBAAHMAWYBmQEAAcwBZgHMAQABmQFmAf8BAAHMAZkCAAHMAZkBMwEAAcwBmQFmAQABzAKZ
- AQABzAGZAcwBAAHMAZkB/wEAAswCAALMATMBAALMAWYBAALMAZkBAAPMAQACzAH/AQABzAH/AgABzAH/
- ATMBAAGZAf8BZgEAAcwB/wGZAQABzAH/AcwBAAHMAv8BAAHMAQABMwEAAf8BAAFmAQAB/wEAAZkBAAHM
- ATMCAAH/AjMBAAH/ATMBZgEAAf8BMwGZAQAB/wEzAcwBAAH/ATMB/wEAAf8BZgIAAf8BZgEzAQABzAJm
- AQAB/wFmAZkBAAH/AWYBzAEAAcwBZgH/AQAB/wGZAgAB/wGZATMBAAH/AZkBZgEAAf8CmQEAAf8BmQHM
- AQAB/wGZAf8BAAH/AcwCAAH/AcwBMwEAAf8BzAFmAQAB/wHMAZkBAAH/AswBAAH/AcwB/wEAAv8BMwEA
- AcwB/wFmAQAC/wGZAQAC/wHMAQACZgH/AQABZgH/AWYBAAFmAv8BAAH/AmYBAAH/AWYB/wEAAv8BZgEA
- ASEBAAGlAQADXwEAA3cBAAOGAQADlgEAA8sBAAOyAQAD1wEAA90BAAPjAQAD6gEAA/EBAAP4AQAB8AH7
- Af8BAAGkAqABAAOAAwAB/wIAAf8DAAL/AQAB/wMAAf8BAAH/AQAC/wIAA/8BABD/MAAJ/wEHAbwF/zAA
- Cf8BAAEUBf8wAAj/AewBDgH3Bf8wAAT/Ae8BBwL/AQABEAb/MAAE/wHsAREBvAHqAQABBwb/MAAE/wHs
- AQABDwIAB/8wAAT/AewGAAFtBP8wAAT/AewFAAHqBf8wAAT/AewEAAHqBv8wAAT/AewDAAFtB/8wAAT/
- AewCAAHrCP8wAAT/AewBAAHrAfQI/zAABP8B7AHrAfMJ/zAABP8B8wH0Cv8wABD/MAABQgFNAT4HAAE+
- AwABKAMAAUADAAEQAwABAQEAAQEFAAGAFwAD/4EACw==
-
-
-
-
-
- AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAAAIAAAAAAAAAAAAAEAAAABAA
- AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
- AAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAEQAAAAAAAACIAAAAAAAAABEAAAAAAAAAiAAAAAAAAAAAEQAAAAAAiAAAAAAAAAAA
- ABEAAAAAAIgAAAAAAAAAAAAAEQAAAIgAAAAAAAAAAAAAABEAAACIAAAAAAAAAAAAAAAAEQCIAAAAAAAA
- AAAAAAAAABEAiAAAAAAAAAAAAAAAAAAAiAAAAAAAAAAAAAAAAAAAAIgAAAAAAAAAAAAAAAAAAIgAEQAA
- AAAAAAAAAAAAAACIABEAAAAAAAAAAAAAAACIAAAAEQAAAAAzAAAAAAAAiAAAABEAAAAAMwAAAAAAAAAA
- AAAAEQAAADMzAAAAAAAAAAAAABEAAAAzMwAAAAAAAAAAAAAAADMzAAAAAAAAAAAAAAAAAAAzMwAAAAAA
- AAAAAAAAAAAzMzMAAAAAAAAAAAAAAAAAMzMzAAAAAAAAAAAAAAAAADMzMwAAAAAAAAAAAAAAAAAzMzMA
- AAAAAAAAAAAAADMzAAAAAAAAAAAAAAAAAAAzMwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////8P/8P/D//D/wP/A/8D/
- wP/wPwP/8D8D//wMD//8DA///wA///8AP///wP///8D///8AP8//AD/PAAwPAwAMDwMAPwAAAD8AADw/
- wAM8P8AD/D/AD/w/wA/wPwAP8D8AD//wAD//8AA///wD///8A////////////w==
-
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/ArrowDown.bmp b/src/Libraries/DockPanel_Src/DockSample/Images/ArrowDown.bmp
deleted file mode 100644
index 42f9c48959..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/ArrowDown.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/ArrowUp.bmp b/src/Libraries/DockPanel_Src/DockSample/Images/ArrowUp.bmp
deleted file mode 100644
index 3fbe95142d..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/ArrowUp.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/Bitmap.ico b/src/Libraries/DockPanel_Src/DockSample/Images/Bitmap.ico
deleted file mode 100644
index 685d74668f..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/Bitmap.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/BlankIcon.ico b/src/Libraries/DockPanel_Src/DockSample/Images/BlankIcon.ico
deleted file mode 100644
index f1282c694b..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/BlankIcon.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/CSFile.ico b/src/Libraries/DockPanel_Src/DockSample/Images/CSFile.ico
deleted file mode 100644
index 99534e8917..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/CSFile.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/CSProject.ico b/src/Libraries/DockPanel_Src/DockSample/Images/CSProject.ico
deleted file mode 100644
index bee04bd3f4..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/CSProject.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/ClosedFolder.ICO b/src/Libraries/DockPanel_Src/DockSample/Images/ClosedFolder.ICO
deleted file mode 100644
index adfd173a80..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/ClosedFolder.ICO and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/File.ico b/src/Libraries/DockPanel_Src/DockSample/Images/File.ico
deleted file mode 100644
index 0b2fda53b0..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/File.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/Form.ico b/src/Libraries/DockPanel_Src/DockSample/Images/Form.ico
deleted file mode 100644
index 1b83db4a03..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/Form.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/Mouse.bmp b/src/Libraries/DockPanel_Src/DockSample/Images/Mouse.bmp
deleted file mode 100644
index 1f60126a57..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/Mouse.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/New.ico b/src/Libraries/DockPanel_Src/DockSample/Images/New.ico
deleted file mode 100644
index bdaf403b09..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/New.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/Open.ico b/src/Libraries/DockPanel_Src/DockSample/Images/Open.ico
deleted file mode 100644
index f269d9edd3..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/Open.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/OpenFolder.ICO b/src/Libraries/DockPanel_Src/DockSample/Images/OpenFolder.ICO
deleted file mode 100644
index d36827b915..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/OpenFolder.ICO and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/OutputWindow.ico b/src/Libraries/DockPanel_Src/DockSample/Images/OutputWindow.ico
deleted file mode 100644
index d076fed5bd..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/OutputWindow.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/PropertyWindow.ico b/src/Libraries/DockPanel_Src/DockSample/Images/PropertyWindow.ico
deleted file mode 100644
index 7c2e1e19f6..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/PropertyWindow.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/Reference.ico b/src/Libraries/DockPanel_Src/DockSample/Images/Reference.ico
deleted file mode 100644
index 4b025eb1ec..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/Reference.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/References.ico b/src/Libraries/DockPanel_Src/DockSample/Images/References.ico
deleted file mode 100644
index 89e9dedf4e..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/References.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/SolutionExplorer.ico b/src/Libraries/DockPanel_Src/DockSample/Images/SolutionExplorer.ico
deleted file mode 100644
index 567a37be6b..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/SolutionExplorer.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/TaskListWindow.ico b/src/Libraries/DockPanel_Src/DockSample/Images/TaskListWindow.ico
deleted file mode 100644
index 03d5dffed5..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/TaskListWindow.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/ToolboxWindow.ico b/src/Libraries/DockPanel_Src/DockSample/Images/ToolboxWindow.ico
deleted file mode 100644
index 5d2ec12680..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/ToolboxWindow.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/XmlFile.ico b/src/Libraries/DockPanel_Src/DockSample/Images/XmlFile.ico
deleted file mode 100644
index 7c00c79fa8..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/XmlFile.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/Images/msenv22.ico b/src/Libraries/DockPanel_Src/DockSample/Images/msenv22.ico
deleted file mode 100644
index 32bb0db7e1..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Images/msenv22.ico and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/MainForm.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/MainForm.Designer.cs
deleted file mode 100644
index b199683b80..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/MainForm.Designer.cs
+++ /dev/null
@@ -1,614 +0,0 @@
-namespace DockSample
-{
- partial class MainForm
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
- this.mainMenu = new System.Windows.Forms.MenuStrip();
- this.menuItemFile = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemNew = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemOpen = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemClose = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemCloseAll = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemCloseAllButThisOne = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem4 = new System.Windows.Forms.ToolStripSeparator();
- this.menuItemExit = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemView = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemSolutionExplorer = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemPropertyWindow = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemToolbox = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemOutputWindow = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemTaskList = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem1 = new System.Windows.Forms.ToolStripSeparator();
- this.menuItemToolBar = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemStatusBar = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem2 = new System.Windows.Forms.ToolStripSeparator();
- this.menuItemLayoutByCode = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemLayoutByXml = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemTools = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemLockLayout = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemShowDocumentIcon = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem3 = new System.Windows.Forms.ToolStripSeparator();
- this.menuItemSchemaVS2005 = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemSchemaVS2003 = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem6 = new System.Windows.Forms.ToolStripSeparator();
- this.menuItemDockingMdi = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemDockingSdi = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemDockingWindow = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemSystemMdi = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem5 = new System.Windows.Forms.ToolStripSeparator();
- this.showRightToLeft = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemWindow = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemNewWindow = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemHelp = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemAbout = new System.Windows.Forms.ToolStripMenuItem();
- this.statusBar = new System.Windows.Forms.StatusStrip();
- this.imageList = new System.Windows.Forms.ImageList(this.components);
- this.toolBar = new System.Windows.Forms.ToolStrip();
- this.toolBarButtonNew = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonOpen = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonSeparator1 = new System.Windows.Forms.ToolStripSeparator();
- this.toolBarButtonSolutionExplorer = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonPropertyWindow = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonToolbox = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonOutputWindow = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonTaskList = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonSeparator2 = new System.Windows.Forms.ToolStripSeparator();
- this.toolBarButtonLayoutByCode = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonLayoutByXml = new System.Windows.Forms.ToolStripButton();
- this.dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
- this.exitWithoutSavingLayout = new System.Windows.Forms.ToolStripMenuItem();
- this.mainMenu.SuspendLayout();
- this.toolBar.SuspendLayout();
- this.SuspendLayout();
- //
- // mainMenu
- //
- this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItemFile,
- this.menuItemView,
- this.menuItemTools,
- this.menuItemWindow,
- this.menuItemHelp});
- this.mainMenu.Location = new System.Drawing.Point(0, 0);
- this.mainMenu.MdiWindowListItem = this.menuItemWindow;
- this.mainMenu.Name = "mainMenu";
- this.mainMenu.Size = new System.Drawing.Size(579, 24);
- this.mainMenu.TabIndex = 7;
- //
- // menuItemFile
- //
- this.menuItemFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItemNew,
- this.menuItemOpen,
- this.menuItemClose,
- this.menuItemCloseAll,
- this.menuItemCloseAllButThisOne,
- this.menuItem4,
- this.menuItemExit,
- this.exitWithoutSavingLayout});
- this.menuItemFile.Name = "menuItemFile";
- this.menuItemFile.Size = new System.Drawing.Size(35, 20);
- this.menuItemFile.Text = "&File";
- this.menuItemFile.DropDownOpening += new System.EventHandler(this.menuItemFile_Popup);
- //
- // menuItemNew
- //
- this.menuItemNew.Name = "menuItemNew";
- this.menuItemNew.Size = new System.Drawing.Size(204, 22);
- this.menuItemNew.Text = "&New";
- this.menuItemNew.Click += new System.EventHandler(this.menuItemNew_Click);
- //
- // menuItemOpen
- //
- this.menuItemOpen.Name = "menuItemOpen";
- this.menuItemOpen.Size = new System.Drawing.Size(204, 22);
- this.menuItemOpen.Text = "&Open...";
- this.menuItemOpen.Click += new System.EventHandler(this.menuItemOpen_Click);
- //
- // menuItemClose
- //
- this.menuItemClose.Name = "menuItemClose";
- this.menuItemClose.Size = new System.Drawing.Size(204, 22);
- this.menuItemClose.Text = "&Close";
- this.menuItemClose.Click += new System.EventHandler(this.menuItemClose_Click);
- //
- // menuItemCloseAll
- //
- this.menuItemCloseAll.Name = "menuItemCloseAll";
- this.menuItemCloseAll.Size = new System.Drawing.Size(204, 22);
- this.menuItemCloseAll.Text = "Close &All";
- this.menuItemCloseAll.Click += new System.EventHandler(this.menuItemCloseAll_Click);
- //
- // menuItemCloseAllButThisOne
- //
- this.menuItemCloseAllButThisOne.Name = "menuItemCloseAllButThisOne";
- this.menuItemCloseAllButThisOne.Size = new System.Drawing.Size(204, 22);
- this.menuItemCloseAllButThisOne.Text = "Close All &But This One";
- this.menuItemCloseAllButThisOne.Click += new System.EventHandler(this.menuItemCloseAllButThisOne_Click);
- //
- // menuItem4
- //
- this.menuItem4.Name = "menuItem4";
- this.menuItem4.Size = new System.Drawing.Size(201, 6);
- //
- // menuItemExit
- //
- this.menuItemExit.Name = "menuItemExit";
- this.menuItemExit.Size = new System.Drawing.Size(204, 22);
- this.menuItemExit.Text = "&Exit";
- this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_Click);
- //
- // menuItemView
- //
- this.menuItemView.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItemSolutionExplorer,
- this.menuItemPropertyWindow,
- this.menuItemToolbox,
- this.menuItemOutputWindow,
- this.menuItemTaskList,
- this.menuItem1,
- this.menuItemToolBar,
- this.menuItemStatusBar,
- this.menuItem2,
- this.menuItemLayoutByCode,
- this.menuItemLayoutByXml});
- this.menuItemView.MergeIndex = 1;
- this.menuItemView.Name = "menuItemView";
- this.menuItemView.Size = new System.Drawing.Size(41, 20);
- this.menuItemView.Text = "&View";
- //
- // menuItemSolutionExplorer
- //
- this.menuItemSolutionExplorer.Name = "menuItemSolutionExplorer";
- this.menuItemSolutionExplorer.Size = new System.Drawing.Size(176, 22);
- this.menuItemSolutionExplorer.Text = "&Solution Explorer";
- this.menuItemSolutionExplorer.Click += new System.EventHandler(this.menuItemSolutionExplorer_Click);
- //
- // menuItemPropertyWindow
- //
- this.menuItemPropertyWindow.Name = "menuItemPropertyWindow";
- this.menuItemPropertyWindow.ShortcutKeys = System.Windows.Forms.Keys.F4;
- this.menuItemPropertyWindow.Size = new System.Drawing.Size(176, 22);
- this.menuItemPropertyWindow.Text = "&Property Window";
- this.menuItemPropertyWindow.Click += new System.EventHandler(this.menuItemPropertyWindow_Click);
- //
- // menuItemToolbox
- //
- this.menuItemToolbox.Name = "menuItemToolbox";
- this.menuItemToolbox.Size = new System.Drawing.Size(176, 22);
- this.menuItemToolbox.Text = "&Toolbox";
- this.menuItemToolbox.Click += new System.EventHandler(this.menuItemToolbox_Click);
- //
- // menuItemOutputWindow
- //
- this.menuItemOutputWindow.Name = "menuItemOutputWindow";
- this.menuItemOutputWindow.Size = new System.Drawing.Size(176, 22);
- this.menuItemOutputWindow.Text = "&Output Window";
- this.menuItemOutputWindow.Click += new System.EventHandler(this.menuItemOutputWindow_Click);
- //
- // menuItemTaskList
- //
- this.menuItemTaskList.Name = "menuItemTaskList";
- this.menuItemTaskList.Size = new System.Drawing.Size(176, 22);
- this.menuItemTaskList.Text = "Task &List";
- this.menuItemTaskList.Click += new System.EventHandler(this.menuItemTaskList_Click);
- //
- // menuItem1
- //
- this.menuItem1.Name = "menuItem1";
- this.menuItem1.Size = new System.Drawing.Size(173, 6);
- //
- // menuItemToolBar
- //
- this.menuItemToolBar.Checked = true;
- this.menuItemToolBar.CheckState = System.Windows.Forms.CheckState.Checked;
- this.menuItemToolBar.Name = "menuItemToolBar";
- this.menuItemToolBar.Size = new System.Drawing.Size(176, 22);
- this.menuItemToolBar.Text = "Tool &Bar";
- this.menuItemToolBar.Click += new System.EventHandler(this.menuItemToolBar_Click);
- //
- // menuItemStatusBar
- //
- this.menuItemStatusBar.Checked = true;
- this.menuItemStatusBar.CheckState = System.Windows.Forms.CheckState.Checked;
- this.menuItemStatusBar.Name = "menuItemStatusBar";
- this.menuItemStatusBar.Size = new System.Drawing.Size(176, 22);
- this.menuItemStatusBar.Text = "Status B&ar";
- this.menuItemStatusBar.Click += new System.EventHandler(this.menuItemStatusBar_Click);
- //
- // menuItem2
- //
- this.menuItem2.Name = "menuItem2";
- this.menuItem2.Size = new System.Drawing.Size(173, 6);
- //
- // menuItemLayoutByCode
- //
- this.menuItemLayoutByCode.Name = "menuItemLayoutByCode";
- this.menuItemLayoutByCode.Size = new System.Drawing.Size(176, 22);
- this.menuItemLayoutByCode.Text = "Layout By &Code";
- this.menuItemLayoutByCode.Click += new System.EventHandler(this.menuItemLayoutByCode_Click);
- //
- // menuItemLayoutByXml
- //
- this.menuItemLayoutByXml.Name = "menuItemLayoutByXml";
- this.menuItemLayoutByXml.Size = new System.Drawing.Size(176, 22);
- this.menuItemLayoutByXml.Text = "Layout By &XML";
- this.menuItemLayoutByXml.Click += new System.EventHandler(this.menuItemLayoutByXml_Click);
- //
- // menuItemTools
- //
- this.menuItemTools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItemLockLayout,
- this.menuItemShowDocumentIcon,
- this.menuItem3,
- this.menuItemSchemaVS2005,
- this.menuItemSchemaVS2003,
- this.menuItem6,
- this.menuItemDockingMdi,
- this.menuItemDockingSdi,
- this.menuItemDockingWindow,
- this.menuItemSystemMdi,
- this.menuItem5,
- this.showRightToLeft});
- this.menuItemTools.MergeIndex = 2;
- this.menuItemTools.Name = "menuItemTools";
- this.menuItemTools.Size = new System.Drawing.Size(44, 20);
- this.menuItemTools.Text = "&Tools";
- this.menuItemTools.DropDownOpening += new System.EventHandler(this.menuItemTools_Popup);
- //
- // menuItemLockLayout
- //
- this.menuItemLockLayout.Name = "menuItemLockLayout";
- this.menuItemLockLayout.Size = new System.Drawing.Size(234, 22);
- this.menuItemLockLayout.Text = "&Lock Layout";
- this.menuItemLockLayout.Click += new System.EventHandler(this.menuItemLockLayout_Click);
- //
- // menuItemShowDocumentIcon
- //
- this.menuItemShowDocumentIcon.Name = "menuItemShowDocumentIcon";
- this.menuItemShowDocumentIcon.Size = new System.Drawing.Size(234, 22);
- this.menuItemShowDocumentIcon.Text = "&Show Document Icon";
- this.menuItemShowDocumentIcon.Click += new System.EventHandler(this.menuItemShowDocumentIcon_Click);
- //
- // menuItem3
- //
- this.menuItem3.Name = "menuItem3";
- this.menuItem3.Size = new System.Drawing.Size(231, 6);
- //
- // menuItemSchemaVS2005
- //
- this.menuItemSchemaVS2005.Checked = true;
- this.menuItemSchemaVS2005.CheckState = System.Windows.Forms.CheckState.Checked;
- this.menuItemSchemaVS2005.Name = "menuItemSchemaVS2005";
- this.menuItemSchemaVS2005.Size = new System.Drawing.Size(234, 22);
- this.menuItemSchemaVS2005.Text = "Schema: VS200&5";
- this.menuItemSchemaVS2005.Click += new System.EventHandler(this.SetSchema);
- //
- // menuItemSchemaVS2003
- //
- this.menuItemSchemaVS2003.Name = "menuItemSchemaVS2003";
- this.menuItemSchemaVS2003.Size = new System.Drawing.Size(234, 22);
- this.menuItemSchemaVS2003.Text = "Schema: VS200&3";
- this.menuItemSchemaVS2003.Click += new System.EventHandler(this.SetSchema);
- //
- // menuItem6
- //
- this.menuItem6.Name = "menuItem6";
- this.menuItem6.Size = new System.Drawing.Size(231, 6);
- //
- // menuItemDockingMdi
- //
- this.menuItemDockingMdi.Checked = true;
- this.menuItemDockingMdi.CheckState = System.Windows.Forms.CheckState.Checked;
- this.menuItemDockingMdi.Name = "menuItemDockingMdi";
- this.menuItemDockingMdi.Size = new System.Drawing.Size(234, 22);
- this.menuItemDockingMdi.Text = "Document Style: Docking &MDI";
- this.menuItemDockingMdi.Click += new System.EventHandler(this.SetDocumentStyle);
- //
- // menuItemDockingSdi
- //
- this.menuItemDockingSdi.Name = "menuItemDockingSdi";
- this.menuItemDockingSdi.Size = new System.Drawing.Size(234, 22);
- this.menuItemDockingSdi.Text = "Document Style: Docking &SDI";
- this.menuItemDockingSdi.Click += new System.EventHandler(this.SetDocumentStyle);
- //
- // menuItemDockingWindow
- //
- this.menuItemDockingWindow.Name = "menuItemDockingWindow";
- this.menuItemDockingWindow.Size = new System.Drawing.Size(234, 22);
- this.menuItemDockingWindow.Text = "Document Style: Docking &Window";
- this.menuItemDockingWindow.Click += new System.EventHandler(this.SetDocumentStyle);
- //
- // menuItemSystemMdi
- //
- this.menuItemSystemMdi.Name = "menuItemSystemMdi";
- this.menuItemSystemMdi.Size = new System.Drawing.Size(234, 22);
- this.menuItemSystemMdi.Text = "Document Style: S&ystem MDI";
- this.menuItemSystemMdi.Click += new System.EventHandler(this.SetDocumentStyle);
- //
- // menuItem5
- //
- this.menuItem5.Name = "menuItem5";
- this.menuItem5.Size = new System.Drawing.Size(231, 6);
- //
- // showRightToLeft
- //
- this.showRightToLeft.Name = "showRightToLeft";
- this.showRightToLeft.Size = new System.Drawing.Size(234, 22);
- this.showRightToLeft.Text = "Show &Right-To-Left";
- this.showRightToLeft.Click += new System.EventHandler(this.showRightToLeft_Click);
- //
- // menuItemWindow
- //
- this.menuItemWindow.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItemNewWindow});
- this.menuItemWindow.MergeIndex = 2;
- this.menuItemWindow.Name = "menuItemWindow";
- this.menuItemWindow.Size = new System.Drawing.Size(57, 20);
- this.menuItemWindow.Text = "&Window";
- //
- // menuItemNewWindow
- //
- this.menuItemNewWindow.Name = "menuItemNewWindow";
- this.menuItemNewWindow.Size = new System.Drawing.Size(136, 22);
- this.menuItemNewWindow.Text = "&New Window";
- this.menuItemNewWindow.Click += new System.EventHandler(this.menuItemNewWindow_Click);
- //
- // menuItemHelp
- //
- this.menuItemHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItemAbout});
- this.menuItemHelp.MergeIndex = 3;
- this.menuItemHelp.Name = "menuItemHelp";
- this.menuItemHelp.Size = new System.Drawing.Size(40, 20);
- this.menuItemHelp.Text = "&Help";
- //
- // menuItemAbout
- //
- this.menuItemAbout.Name = "menuItemAbout";
- this.menuItemAbout.Size = new System.Drawing.Size(175, 22);
- this.menuItemAbout.Text = "&About DockSample...";
- this.menuItemAbout.Click += new System.EventHandler(this.menuItemAbout_Click);
- //
- // statusBar
- //
- this.statusBar.Location = new System.Drawing.Point(0, 387);
- this.statusBar.Name = "statusBar";
- this.statusBar.Size = new System.Drawing.Size(579, 22);
- this.statusBar.TabIndex = 4;
- //
- // imageList
- //
- this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
- this.imageList.TransparentColor = System.Drawing.Color.Transparent;
- this.imageList.Images.SetKeyName(0, "");
- this.imageList.Images.SetKeyName(1, "");
- this.imageList.Images.SetKeyName(2, "");
- this.imageList.Images.SetKeyName(3, "");
- this.imageList.Images.SetKeyName(4, "");
- this.imageList.Images.SetKeyName(5, "");
- this.imageList.Images.SetKeyName(6, "");
- this.imageList.Images.SetKeyName(7, "");
- this.imageList.Images.SetKeyName(8, "");
- //
- // toolBar
- //
- this.toolBar.ImageList = this.imageList;
- this.toolBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.toolBarButtonNew,
- this.toolBarButtonOpen,
- this.toolBarButtonSeparator1,
- this.toolBarButtonSolutionExplorer,
- this.toolBarButtonPropertyWindow,
- this.toolBarButtonToolbox,
- this.toolBarButtonOutputWindow,
- this.toolBarButtonTaskList,
- this.toolBarButtonSeparator2,
- this.toolBarButtonLayoutByCode,
- this.toolBarButtonLayoutByXml});
- this.toolBar.Location = new System.Drawing.Point(0, 24);
- this.toolBar.Name = "toolBar";
- this.toolBar.Size = new System.Drawing.Size(579, 25);
- this.toolBar.TabIndex = 6;
- this.toolBar.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolBar_ButtonClick);
- //
- // toolBarButtonNew
- //
- this.toolBarButtonNew.ImageIndex = 0;
- this.toolBarButtonNew.Name = "toolBarButtonNew";
- this.toolBarButtonNew.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonNew.ToolTipText = "Show Layout From XML";
- //
- // toolBarButtonOpen
- //
- this.toolBarButtonOpen.ImageIndex = 1;
- this.toolBarButtonOpen.Name = "toolBarButtonOpen";
- this.toolBarButtonOpen.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonOpen.ToolTipText = "Open";
- //
- // toolBarButtonSeparator1
- //
- this.toolBarButtonSeparator1.Name = "toolBarButtonSeparator1";
- this.toolBarButtonSeparator1.Size = new System.Drawing.Size(6, 25);
- //
- // toolBarButtonSolutionExplorer
- //
- this.toolBarButtonSolutionExplorer.ImageIndex = 2;
- this.toolBarButtonSolutionExplorer.Name = "toolBarButtonSolutionExplorer";
- this.toolBarButtonSolutionExplorer.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonSolutionExplorer.ToolTipText = "Solution Explorer";
- //
- // toolBarButtonPropertyWindow
- //
- this.toolBarButtonPropertyWindow.ImageIndex = 3;
- this.toolBarButtonPropertyWindow.Name = "toolBarButtonPropertyWindow";
- this.toolBarButtonPropertyWindow.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonPropertyWindow.ToolTipText = "Property Window";
- //
- // toolBarButtonToolbox
- //
- this.toolBarButtonToolbox.ImageIndex = 4;
- this.toolBarButtonToolbox.Name = "toolBarButtonToolbox";
- this.toolBarButtonToolbox.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonToolbox.ToolTipText = "Tool Box";
- //
- // toolBarButtonOutputWindow
- //
- this.toolBarButtonOutputWindow.ImageIndex = 5;
- this.toolBarButtonOutputWindow.Name = "toolBarButtonOutputWindow";
- this.toolBarButtonOutputWindow.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonOutputWindow.ToolTipText = "Output Window";
- //
- // toolBarButtonTaskList
- //
- this.toolBarButtonTaskList.ImageIndex = 6;
- this.toolBarButtonTaskList.Name = "toolBarButtonTaskList";
- this.toolBarButtonTaskList.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonTaskList.ToolTipText = "Task List";
- //
- // toolBarButtonSeparator2
- //
- this.toolBarButtonSeparator2.Name = "toolBarButtonSeparator2";
- this.toolBarButtonSeparator2.Size = new System.Drawing.Size(6, 25);
- //
- // toolBarButtonLayoutByCode
- //
- this.toolBarButtonLayoutByCode.ImageIndex = 7;
- this.toolBarButtonLayoutByCode.Name = "toolBarButtonLayoutByCode";
- this.toolBarButtonLayoutByCode.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonLayoutByCode.ToolTipText = "Show Layout By Code";
- //
- // toolBarButtonLayoutByXml
- //
- this.toolBarButtonLayoutByXml.ImageIndex = 8;
- this.toolBarButtonLayoutByXml.Name = "toolBarButtonLayoutByXml";
- this.toolBarButtonLayoutByXml.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonLayoutByXml.ToolTipText = "Show layout by predefined XML file";
- //
- // dockPanel
- //
- this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
- this.dockPanel.DockBottomPortion = 150;
- this.dockPanel.DockLeftPortion = 200;
- this.dockPanel.DockRightPortion = 200;
- this.dockPanel.DockTopPortion = 150;
- this.dockPanel.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((byte)(0)));
- this.dockPanel.Location = new System.Drawing.Point(0, 49);
- this.dockPanel.Name = "dockPanel";
- this.dockPanel.RightToLeftLayout = true;
- this.dockPanel.Size = new System.Drawing.Size(579, 338);
- this.dockPanel.TabIndex = 0;
- //
- // exitWithoutSavingLayout
- //
- this.exitWithoutSavingLayout.Name = "exitWithoutSavingLayout";
- this.exitWithoutSavingLayout.Size = new System.Drawing.Size(204, 22);
- this.exitWithoutSavingLayout.Text = "Exit &Without Saving Layout";
- this.exitWithoutSavingLayout.Click += new System.EventHandler(this.exitWithoutSavingLayout_Click);
- //
- // MainForm
- //
- this.ClientSize = new System.Drawing.Size(579, 409);
- this.Controls.Add(this.dockPanel);
- this.Controls.Add(this.toolBar);
- this.Controls.Add(this.mainMenu);
- this.Controls.Add(this.statusBar);
- this.IsMdiContainer = true;
- this.MainMenuStrip = this.mainMenu;
- this.Name = "MainForm";
- this.Text = "DockSample";
- this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
- this.Closing += new System.ComponentModel.CancelEventHandler(this.MainForm_Closing);
- this.Load += new System.EventHandler(this.MainForm_Load);
- this.mainMenu.ResumeLayout(false);
- this.mainMenu.PerformLayout();
- this.toolBar.ResumeLayout(false);
- this.toolBar.PerformLayout();
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
- #endregion
-
- private WeifenLuo.WinFormsUI.Docking.DockPanel dockPanel;
- private System.Windows.Forms.ImageList imageList;
- private System.Windows.Forms.ToolStrip toolBar;
- private System.Windows.Forms.ToolStripButton toolBarButtonNew;
- private System.Windows.Forms.ToolStripButton toolBarButtonOpen;
- private System.Windows.Forms.ToolStripSeparator toolBarButtonSeparator1;
- private System.Windows.Forms.ToolStripButton toolBarButtonSolutionExplorer;
- private System.Windows.Forms.ToolStripButton toolBarButtonPropertyWindow;
- private System.Windows.Forms.ToolStripButton toolBarButtonToolbox;
- private System.Windows.Forms.ToolStripButton toolBarButtonOutputWindow;
- private System.Windows.Forms.ToolStripButton toolBarButtonTaskList;
- private System.Windows.Forms.ToolStripSeparator toolBarButtonSeparator2;
- private System.Windows.Forms.ToolStripButton toolBarButtonLayoutByCode;
- private System.Windows.Forms.ToolStripButton toolBarButtonLayoutByXml;
- private System.Windows.Forms.MenuStrip mainMenu;
- private System.Windows.Forms.ToolStripMenuItem menuItemFile;
- private System.Windows.Forms.ToolStripMenuItem menuItemNew;
- private System.Windows.Forms.ToolStripMenuItem menuItemOpen;
- private System.Windows.Forms.ToolStripMenuItem menuItemClose;
- private System.Windows.Forms.ToolStripMenuItem menuItemCloseAll;
- private System.Windows.Forms.ToolStripMenuItem menuItemCloseAllButThisOne;
- private System.Windows.Forms.ToolStripSeparator menuItem4;
- private System.Windows.Forms.ToolStripMenuItem menuItemExit;
- private System.Windows.Forms.ToolStripMenuItem menuItemView;
- private System.Windows.Forms.ToolStripMenuItem menuItemSolutionExplorer;
- private System.Windows.Forms.ToolStripMenuItem menuItemPropertyWindow;
- private System.Windows.Forms.ToolStripMenuItem menuItemToolbox;
- private System.Windows.Forms.ToolStripMenuItem menuItemOutputWindow;
- private System.Windows.Forms.ToolStripMenuItem menuItemTaskList;
- private System.Windows.Forms.ToolStripSeparator menuItem1;
- private System.Windows.Forms.ToolStripMenuItem menuItemToolBar;
- private System.Windows.Forms.ToolStripMenuItem menuItemStatusBar;
- private System.Windows.Forms.ToolStripSeparator menuItem2;
- private System.Windows.Forms.ToolStripMenuItem menuItemLayoutByCode;
- private System.Windows.Forms.ToolStripMenuItem menuItemLayoutByXml;
- private System.Windows.Forms.ToolStripMenuItem menuItemTools;
- private System.Windows.Forms.ToolStripMenuItem menuItemLockLayout;
- private System.Windows.Forms.ToolStripSeparator menuItem3;
- private System.Windows.Forms.ToolStripMenuItem menuItemSchemaVS2005;
- private System.Windows.Forms.ToolStripMenuItem menuItemSchemaVS2003;
- private System.Windows.Forms.ToolStripSeparator menuItem6;
- private System.Windows.Forms.ToolStripMenuItem menuItemDockingMdi;
- private System.Windows.Forms.ToolStripMenuItem menuItemDockingSdi;
- private System.Windows.Forms.ToolStripMenuItem menuItemDockingWindow;
- private System.Windows.Forms.ToolStripMenuItem menuItemSystemMdi;
- private System.Windows.Forms.ToolStripSeparator menuItem5;
- private System.Windows.Forms.ToolStripMenuItem menuItemShowDocumentIcon;
- private System.Windows.Forms.ToolStripMenuItem menuItemWindow;
- private System.Windows.Forms.ToolStripMenuItem menuItemNewWindow;
- private System.Windows.Forms.ToolStripMenuItem menuItemHelp;
- private System.Windows.Forms.ToolStripMenuItem menuItemAbout;
- private System.Windows.Forms.StatusStrip statusBar;
- private System.Windows.Forms.ToolStripMenuItem showRightToLeft;
- private System.Windows.Forms.ToolStripMenuItem exitWithoutSavingLayout;
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/MainForm.cs b/src/Libraries/DockPanel_Src/DockSample/MainForm.cs
deleted file mode 100644
index f9d0f3fd98..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/MainForm.cs
+++ /dev/null
@@ -1,443 +0,0 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Reflection;
-using System.Windows.Forms;
-using System.IO;
-using WeifenLuo.WinFormsUI.Docking;
-using DockSample.Customization;
-
-namespace DockSample
-{
- public partial class MainForm : Form
- {
- private bool m_bSaveLayout = true;
- private DeserializeDockContent m_deserializeDockContent;
- private DummySolutionExplorer m_solutionExplorer = new DummySolutionExplorer();
- private DummyPropertyWindow m_propertyWindow = new DummyPropertyWindow();
- private DummyToolbox m_toolbox = new DummyToolbox();
- private DummyOutputWindow m_outputWindow = new DummyOutputWindow();
- private DummyTaskList m_taskList = new DummyTaskList();
-
- public MainForm()
- {
- InitializeComponent();
- showRightToLeft.Checked = (RightToLeft == RightToLeft.Yes);
- RightToLeftLayout = showRightToLeft.Checked;
- m_solutionExplorer = new DummySolutionExplorer();
- m_solutionExplorer.RightToLeftLayout = RightToLeftLayout;
- m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
- }
-
- private void menuItemExit_Click(object sender, System.EventArgs e)
- {
- Close();
- }
-
- private void menuItemSolutionExplorer_Click(object sender, System.EventArgs e)
- {
- m_solutionExplorer.Show(dockPanel);
- }
-
- private void menuItemPropertyWindow_Click(object sender, System.EventArgs e)
- {
- m_propertyWindow.Show(dockPanel);
- }
-
- private void menuItemToolbox_Click(object sender, System.EventArgs e)
- {
- m_toolbox.Show(dockPanel);
- }
-
- private void menuItemOutputWindow_Click(object sender, System.EventArgs e)
- {
- m_outputWindow.Show(dockPanel);
- }
-
- private void menuItemTaskList_Click(object sender, System.EventArgs e)
- {
- m_taskList.Show(dockPanel);
- }
-
- private void menuItemAbout_Click(object sender, System.EventArgs e)
- {
- AboutDialog aboutDialog = new AboutDialog();
- aboutDialog.ShowDialog(this);
- }
-
- private IDockContent FindDocument(string text)
- {
- if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- {
- foreach (Form form in MdiChildren)
- if (form.Text == text)
- return form as IDockContent;
-
- return null;
- }
- else
- {
- foreach (IDockContent content in dockPanel.Documents)
- if (content.DockHandler.TabText == text)
- return content;
-
- return null;
- }
- }
-
- private void menuItemNew_Click(object sender, System.EventArgs e)
- {
- DummyDoc dummyDoc = CreateNewDocument();
- if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- {
- dummyDoc.MdiParent = this;
- dummyDoc.Show();
- }
- else
- dummyDoc.Show(dockPanel);
- }
-
- private DummyDoc CreateNewDocument()
- {
- DummyDoc dummyDoc = new DummyDoc();
-
- int count = 1;
- //string text = "C:\\MADFDKAJ\\ADAKFJASD\\ADFKDSAKFJASD\\ASDFKASDFJASDF\\ASDFIJADSFJ\\ASDFKDFDA" + count.ToString();
- string text = "Document" + count.ToString();
- while (FindDocument(text) != null)
- {
- count ++;
- //text = "C:\\MADFDKAJ\\ADAKFJASD\\ADFKDSAKFJASD\\ASDFKASDFJASDF\\ASDFIJADSFJ\\ASDFKDFDA" + count.ToString();
- text = "Document" + count.ToString();
- }
- dummyDoc.Text = text;
- return dummyDoc;
- }
-
- private DummyDoc CreateNewDocument(string text)
- {
- DummyDoc dummyDoc = new DummyDoc();
- dummyDoc.Text = text;
- return dummyDoc;
- }
-
- private void menuItemOpen_Click(object sender, System.EventArgs e)
- {
- OpenFileDialog openFile = new OpenFileDialog();
-
- openFile.InitialDirectory = Application.ExecutablePath;
- openFile.Filter = "rtf files (*.rtf)|*.rtf|txt files (*.txt)|*.txt|All files (*.*)|*.*" ;
- openFile.FilterIndex = 1;
- openFile.RestoreDirectory = true ;
-
- if(openFile.ShowDialog() == DialogResult.OK)
- {
- string fullName = openFile.FileName;
- string fileName = Path.GetFileName(fullName);
-
- if (FindDocument(fileName) != null)
- {
- MessageBox.Show("The document: " + fileName + " has already opened!");
- return;
- }
-
- DummyDoc dummyDoc = new DummyDoc();
- dummyDoc.Text = fileName;
- dummyDoc.Show(dockPanel);
- try
- {
- dummyDoc.FileName = fullName;
- }
- catch (Exception exception)
- {
- dummyDoc.Close();
- MessageBox.Show(exception.Message);
- }
-
- }
- }
-
- private void menuItemFile_Popup(object sender, System.EventArgs e)
- {
- if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- {
- menuItemClose.Enabled = menuItemCloseAll.Enabled = (ActiveMdiChild != null);
- }
- else
- {
- menuItemClose.Enabled = (dockPanel.ActiveDocument != null);
- menuItemCloseAll.Enabled = (dockPanel.DocumentsCount > 0);
- }
- }
-
- private void menuItemClose_Click(object sender, System.EventArgs e)
- {
- if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- ActiveMdiChild.Close();
- else if (dockPanel.ActiveDocument != null)
- dockPanel.ActiveDocument.DockHandler.Close();
- }
-
- private void menuItemCloseAll_Click(object sender, System.EventArgs e)
- {
- CloseAllDocuments();
- }
-
- private void CloseAllDocuments()
- {
- if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- {
- foreach (Form form in MdiChildren)
- form.Close();
- }
- else
- {
- IDockContent[] documents = dockPanel.DocumentsToArray();
- foreach (IDockContent content in documents)
- content.DockHandler.Close();
- }
- }
-
- private IDockContent GetContentFromPersistString(string persistString)
- {
- if (persistString == typeof(DummySolutionExplorer).ToString())
- return m_solutionExplorer;
- else if (persistString == typeof(DummyPropertyWindow).ToString())
- return m_propertyWindow;
- else if (persistString == typeof(DummyToolbox).ToString())
- return m_toolbox;
- else if (persistString == typeof(DummyOutputWindow).ToString())
- return m_outputWindow;
- else if (persistString == typeof(DummyTaskList).ToString())
- return m_taskList;
- else
- {
- string[] parsedStrings = persistString.Split(new char[] { ',' });
- if (parsedStrings.Length != 3)
- return null;
-
- if (parsedStrings[0] != typeof(DummyDoc).ToString())
- return null;
-
- DummyDoc dummyDoc = new DummyDoc();
- if (parsedStrings[1] != string.Empty)
- dummyDoc.FileName = parsedStrings[1];
- if (parsedStrings[2] != string.Empty)
- dummyDoc.Text = parsedStrings[2];
-
- return dummyDoc;
- }
- }
-
- private void MainForm_Load(object sender, System.EventArgs e)
- {
- string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config");
-
- if (File.Exists(configFile))
- dockPanel.LoadFromXml(configFile, m_deserializeDockContent);
- }
-
- private void MainForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
- {
- string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config");
- if (m_bSaveLayout)
- dockPanel.SaveAsXml(configFile);
- else if (File.Exists(configFile))
- File.Delete(configFile);
- }
-
- private void menuItemToolBar_Click(object sender, System.EventArgs e)
- {
- toolBar.Visible = menuItemToolBar.Checked = !menuItemToolBar.Checked;
- }
-
- private void menuItemStatusBar_Click(object sender, System.EventArgs e)
- {
- statusBar.Visible = menuItemStatusBar.Checked = !menuItemStatusBar.Checked;
- }
-
- private void toolBar_ButtonClick(object sender, System.Windows.Forms.ToolStripItemClickedEventArgs e)
- {
- if (e.ClickedItem == toolBarButtonNew)
- menuItemNew_Click(null, null);
- else if (e.ClickedItem == toolBarButtonOpen)
- menuItemOpen_Click(null, null);
- else if (e.ClickedItem == toolBarButtonSolutionExplorer)
- menuItemSolutionExplorer_Click(null, null);
- else if (e.ClickedItem == toolBarButtonPropertyWindow)
- menuItemPropertyWindow_Click(null, null);
- else if (e.ClickedItem == toolBarButtonToolbox)
- menuItemToolbox_Click(null, null);
- else if (e.ClickedItem == toolBarButtonOutputWindow)
- menuItemOutputWindow_Click(null, null);
- else if (e.ClickedItem == toolBarButtonTaskList)
- menuItemTaskList_Click(null, null);
- else if (e.ClickedItem == toolBarButtonLayoutByCode)
- menuItemLayoutByCode_Click(null, null);
- else if (e.ClickedItem == toolBarButtonLayoutByXml)
- menuItemLayoutByXml_Click(null, null);
- }
-
- private void menuItemNewWindow_Click(object sender, System.EventArgs e)
- {
- MainForm newWindow = new MainForm();
- newWindow.Text = newWindow.Text + " - New";
- newWindow.Show();
- }
-
- private void menuItemTools_Popup(object sender, System.EventArgs e)
- {
- menuItemLockLayout.Checked = !this.dockPanel.AllowEndUserDocking;
- }
-
- private void menuItemLockLayout_Click(object sender, System.EventArgs e)
- {
- dockPanel.AllowEndUserDocking = !dockPanel.AllowEndUserDocking;
- }
-
- private void menuItemLayoutByCode_Click(object sender, System.EventArgs e)
- {
- dockPanel.SuspendLayout(true);
-
- m_solutionExplorer.Show(dockPanel, DockState.DockRight);
- m_propertyWindow.Show(m_solutionExplorer.Pane, m_solutionExplorer);
- m_toolbox.Show(dockPanel, new Rectangle(98, 133, 200, 383));
- m_outputWindow.Show(m_solutionExplorer.Pane, DockAlignment.Bottom, 0.35);
- m_taskList.Show(m_toolbox.Pane, DockAlignment.Left, 0.4);
-
- CloseAllDocuments();
- DummyDoc doc1 = CreateNewDocument("Document1");
- DummyDoc doc2 = CreateNewDocument("Document2");
- DummyDoc doc3 = CreateNewDocument("Document3");
- DummyDoc doc4 = CreateNewDocument("Document4");
- doc1.Show(dockPanel, DockState.Document);
- doc2.Show(doc1.Pane, null);
- doc3.Show(doc1.Pane, DockAlignment.Bottom, 0.5);
- doc4.Show(doc3.Pane, DockAlignment.Right, 0.5);
-
- dockPanel.ResumeLayout(true, true);
- }
-
- private void menuItemLayoutByXml_Click(object sender, System.EventArgs e)
- {
- dockPanel.SuspendLayout(true);
-
- // In order to load layout from XML, we need to close all the DockContents
- CloseAllContents();
-
- Assembly assembly = Assembly.GetAssembly(typeof(MainForm));
- Stream xmlStream = assembly.GetManifestResourceStream("DockSample.Resources.DockPanel.xml");
- dockPanel.LoadFromXml(xmlStream, m_deserializeDockContent);
- xmlStream.Close();
-
- dockPanel.ResumeLayout(true, true);
- }
-
- private void CloseAllContents()
- {
- // we don't want to create another instance of tool window, set DockPanel to null
- m_solutionExplorer.DockPanel = null;
- m_propertyWindow.DockPanel = null;
- m_toolbox.DockPanel = null;
- m_outputWindow.DockPanel = null;
- m_taskList.DockPanel = null;
-
- // Close all other document windows
- CloseAllDocuments();
- }
-
- private void SetSchema(object sender, System.EventArgs e)
- {
- CloseAllContents();
-
- if (sender == menuItemSchemaVS2005)
- Extender.SetSchema(dockPanel, Extender.Schema.VS2005);
- else if (sender == menuItemSchemaVS2003)
- Extender.SetSchema(dockPanel, Extender.Schema.VS2003);
-
- menuItemSchemaVS2005.Checked = (sender == menuItemSchemaVS2005);
- menuItemSchemaVS2003.Checked = (sender == menuItemSchemaVS2003);
- }
-
- private void SetDocumentStyle(object sender, System.EventArgs e)
- {
- DocumentStyle oldStyle = dockPanel.DocumentStyle;
- DocumentStyle newStyle;
- if (sender == menuItemDockingMdi)
- newStyle = DocumentStyle.DockingMdi;
- else if (sender == menuItemDockingWindow)
- newStyle = DocumentStyle.DockingWindow;
- else if (sender == menuItemDockingSdi)
- newStyle = DocumentStyle.DockingSdi;
- else
- newStyle = DocumentStyle.SystemMdi;
-
- if (oldStyle == newStyle)
- return;
-
- if (oldStyle == DocumentStyle.SystemMdi || newStyle == DocumentStyle.SystemMdi)
- CloseAllDocuments();
-
- dockPanel.DocumentStyle = newStyle;
- menuItemDockingMdi.Checked = (newStyle == DocumentStyle.DockingMdi);
- menuItemDockingWindow.Checked = (newStyle == DocumentStyle.DockingWindow);
- menuItemDockingSdi.Checked = (newStyle == DocumentStyle.DockingSdi);
- menuItemSystemMdi.Checked = (newStyle == DocumentStyle.SystemMdi);
- menuItemLayoutByCode.Enabled = (newStyle != DocumentStyle.SystemMdi);
- menuItemLayoutByXml.Enabled = (newStyle != DocumentStyle.SystemMdi);
- toolBarButtonLayoutByCode.Enabled = (newStyle != DocumentStyle.SystemMdi);
- toolBarButtonLayoutByXml.Enabled = (newStyle != DocumentStyle.SystemMdi);
- }
-
- private void menuItemCloseAllButThisOne_Click(object sender, System.EventArgs e)
- {
- if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- {
- Form activeMdi = ActiveMdiChild;
- foreach (Form form in MdiChildren)
- {
- if (form != activeMdi)
- form.Close();
- }
- }
- else
- {
- foreach (IDockContent document in dockPanel.DocumentsToArray())
- {
- if (!document.DockHandler.IsActivated)
- document.DockHandler.Close();
- }
- }
- }
-
- private void menuItemShowDocumentIcon_Click(object sender, System.EventArgs e)
- {
- dockPanel.ShowDocumentIcon = menuItemShowDocumentIcon.Checked= !menuItemShowDocumentIcon.Checked;
- }
-
- private void showRightToLeft_Click(object sender, EventArgs e)
- {
- CloseAllContents();
- if (showRightToLeft.Checked)
- {
- this.RightToLeft = RightToLeft.No;
- this.RightToLeftLayout = false;
- }
- else
- {
- this.RightToLeft = RightToLeft.Yes;
- this.RightToLeftLayout = true;
- }
- m_solutionExplorer.RightToLeftLayout = this.RightToLeftLayout;
- showRightToLeft.Checked = !showRightToLeft.Checked;
- }
-
- private void exitWithoutSavingLayout_Click(object sender, EventArgs e)
- {
- m_bSaveLayout = false;
- Close();
- m_bSaveLayout = true;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/MainForm.resx b/src/Libraries/DockPanel_Src/DockSample/MainForm.resx
deleted file mode 100644
index ad5859d12b..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/MainForm.resx
+++ /dev/null
@@ -1,194 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 296, 8
-
-
- 16, 2
-
-
- 114, 5
-
-
-
- AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
- LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
- ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADY
- DAAAAk1TRnQBSQFMAgEBCQEAAQ4BAAEEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
- AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
- AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
- AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
- AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
- AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
- AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
- ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
- AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
- AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
- AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
- AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
- AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
- AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
- AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
- AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
- ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
- Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
- AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
- AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
- AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
- ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
- Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
- AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
- AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
- AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
- AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
- AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
- AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/0IAAewMBzMAAewL/wEH
- MwAB7AP/BgIC/wEHMwAB7Av/AQczAAHsA/8GAgL/AQczAAHsC/8BBzMAAewB/wEHAQAC/wIAAv8BAAIH
- MwAB7AEHAQAC/wEEAQIBBAEAAv8BAAHsMwAB7AH/AQcBAAH/AQIB/gECAQAB/wEAAgczAAHsAv8BBwL/
- AQIBBAT/AQczAAHsCf82AAHsCf8B7AEAAewzAAHsCf8C7DQAC+zmAAHsCwcEAAEBBwABBxcAAewK/wUA
- AewK/wEHBQABAQUAAQcJAAr/BQAB7AP/AgcF/wUAAewE/wUHAf8BBwYAAQEDAAEHCgAB/wfsAv8FAAHs
- A/8BAQIHBP8FAAHsCv8BBwcAAQEBAAEHCwAK/wUAAewC/wMBAgcD/wUAAewE/wUHAf8BBwgAAQcMAAH/
- COwB/wUAAewB/wIBAf8CAQEHA/8FAAHsAv8BAgf/AQcHAAEHAQABAQsACv8FAAHsBf8BAQHsAQcC/wUA
- AewB/wICAf8BAgQHAf8BBwYAAQcDAAEBBAABAwUAAf8HAAL/BQAB7Ab/AQECBwH/BQAB7AL/AwIF/wEH
- CwABAQMAAgMEAAr/BQAB7Af/AQEBBwH/BQAB7AH/AgIB/wICBP8BBw0AAgMGAAH/COwB/wUAAewI/wEB
- Af8FAAHsAv8DAgT/AgcMAAMDBgAK/wUAAewK/wUAAewC/wECAf8CAgL/DwADAwUADAQEAAHsAv8GAAL/
- BQAB7AT/AQID/wHsAQAB7AoAAgMIAAwEBQAC7AEAAf8DBwEAAuwFAAHsCP8C7CkABOwIAArsqgABBAQA
- AQM5AAEEAfwC+QEAAQMC+wQACv8IAAn/BgAJAwkAAewB/AEAA/kBAAL7AQAB+gIAAf8CAAH/BQAB/wgA
- Cf8FAAH7AQAJAwUABP8BAAL/A/kCAAH/AfoCAAr/CAAJ/wUAAf8B+wEACQMEAAT/AfoBAAH/AQcD+QEA
- Av8CAAH/AgAB/wUAAf8IAAn/BQAB+wH/AfsBAAkDAwAE/wL6Af8B+wEHA/kBAAH8AgAK/wgACf8FAAH/
- AfsB/wH7DAAF/wH6Af8B+wEHAf8C+QEAAfwCAAL/AgAD/wEAAv8IAAn/BQAB+wH/AfsB/wH7Af8B+wH/
- AfsHAAb/AgMD/wEBBAAC/wMAAf8DAAH/BAABBAMACf8FAAH/AfsB/wH7Af8B+wH/AfsB/wcADP8BBwMA
- A/8KAAIEAwAJ/wUAAfsB/wH7DQAM/wEHEAACBAMABv8YAAz/AQcQAAIEAwAG/wEAAf8WAAz/AQcQAAIE
- AwAG/xgADQQQAAIEIQANBBAAAgRAAAFCAU0BPgcAAT4DAAEoAwABQAMAATADAAEBAQABAQUAAYABARYA
- A/8BAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGA
- AQEGAAGAAQEGAAGAAQEGAAGAAQsGAAGAAQcGAAGAAQ8GAAL/BgAG/wHAAQEBnwHPAv8B4AEHAcABAQKP
- AcABAwHAAQMBwAEBAccBHwHAAQMBwAEDAcABAQHiAT8BwAEDAcABAwHAAQEB8AF/AcABAwHAAQMBwAEB
- AfgB/wHAAQMBwAEDAcABAQHwAXsBwAEDAcABAwHAAQEBAgExAcABAwHAAQMBwAEBAQcBAAHAAQMBwAED
- AcABAQFnAYEBwAEDAcABAwHAAQEB5wGDAcABAwHAAQMBwAEBAccBAwHAAQMBwAEDAcABCwH8AQcBwAED
- AeABBwHAAQcB/gEfAv8B/AE/AcABDxT/AfwBYwEAAQ8BwAEHAQABHwH4AQEBAAEPAcABBwEAAQ8BgAIA
- AQ8BwAEHAQABBwGAAgABDwHAAQcBAAEDAYACAAEPAcABBwEAAQEBgAIAAQ8BwAEHAgABgAEBAQABDwHA
- AQcBAAEfAYABAwEIAY4BwAEHAQABHwGAAQMBBQFEAcABBwEAAR8BgAEDAQIBuAHAAQcBjwHxAYABAwH9
- AXwBwAEPAf8B+QGAAQMB/gH8AcABHwH/AXUBgAEDAf8BAAHAAT8B/wGPAYABAwH/AfwI/ws=
-
-
-
- 211, 5
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/MainForm2.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/MainForm2.Designer.cs
deleted file mode 100644
index 073f668207..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/MainForm2.Designer.cs
+++ /dev/null
@@ -1,635 +0,0 @@
-namespace DockSample
-{
- partial class MainForm2
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm2));
- this.mainMenu = new System.Windows.Forms.MenuStrip();
- this.menuItemFile = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemNew = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemOpen = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemClose = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemCloseAll = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemCloseAllButThisOne = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem4 = new System.Windows.Forms.ToolStripSeparator();
- this.menuItemExit = new System.Windows.Forms.ToolStripMenuItem();
- this.exitWithoutSavingLayout = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemView = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemSolutionExplorer = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemPropertyWindow = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemToolbox = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemOutputWindow = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemTaskList = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem1 = new System.Windows.Forms.ToolStripSeparator();
- this.menuItemToolBar = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemStatusBar = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem2 = new System.Windows.Forms.ToolStripSeparator();
- this.menuItemLayoutByCode = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemLayoutByXml = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemTools = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemLockLayout = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemShowDocumentIcon = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem3 = new System.Windows.Forms.ToolStripSeparator();
- this.menuItemSchemaVS2005 = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemSchemaVS2003 = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem6 = new System.Windows.Forms.ToolStripSeparator();
- this.menuItemDockingMdi = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemDockingSdi = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemDockingWindow = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemSystemMdi = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItem5 = new System.Windows.Forms.ToolStripSeparator();
- this.showRightToLeft = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemWindow = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemNewWindow = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemHelp = new System.Windows.Forms.ToolStripMenuItem();
- this.menuItemAbout = new System.Windows.Forms.ToolStripMenuItem();
- this.imageList = new System.Windows.Forms.ImageList(this.components);
- this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
- this.toolBar = new System.Windows.Forms.ToolStrip();
- this.toolBarButtonNew = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonOpen = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonSeparator1 = new System.Windows.Forms.ToolStripSeparator();
- this.toolBarButtonSolutionExplorer = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonPropertyWindow = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonToolbox = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonOutputWindow = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonTaskList = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonSeparator2 = new System.Windows.Forms.ToolStripSeparator();
- this.toolBarButtonLayoutByCode = new System.Windows.Forms.ToolStripButton();
- this.toolBarButtonLayoutByXml = new System.Windows.Forms.ToolStripButton();
- this.dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
- this.statusBar = new System.Windows.Forms.StatusStrip();
- this.mainMenu.SuspendLayout();
- this.tableLayoutPanel1.SuspendLayout();
- this.toolBar.SuspendLayout();
- this.SuspendLayout();
- //
- // mainMenu
- //
- this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItemFile,
- this.menuItemView,
- this.menuItemTools,
- this.menuItemWindow,
- this.menuItemHelp});
- this.mainMenu.Location = new System.Drawing.Point(0, 0);
- this.mainMenu.MdiWindowListItem = this.menuItemWindow;
- this.mainMenu.Name = "mainMenu";
- this.mainMenu.Size = new System.Drawing.Size(579, 24);
- this.mainMenu.TabIndex = 7;
- //
- // menuItemFile
- //
- this.menuItemFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItemNew,
- this.menuItemOpen,
- this.menuItemClose,
- this.menuItemCloseAll,
- this.menuItemCloseAllButThisOne,
- this.menuItem4,
- this.menuItemExit,
- this.exitWithoutSavingLayout});
- this.menuItemFile.Name = "menuItemFile";
- this.menuItemFile.Size = new System.Drawing.Size(35, 20);
- this.menuItemFile.Text = "&File";
- this.menuItemFile.DropDownOpening += new System.EventHandler(this.menuItemFile_Popup);
- //
- // menuItemNew
- //
- this.menuItemNew.Name = "menuItemNew";
- this.menuItemNew.Size = new System.Drawing.Size(204, 22);
- this.menuItemNew.Text = "&New";
- this.menuItemNew.Click += new System.EventHandler(this.menuItemNew_Click);
- //
- // menuItemOpen
- //
- this.menuItemOpen.Name = "menuItemOpen";
- this.menuItemOpen.Size = new System.Drawing.Size(204, 22);
- this.menuItemOpen.Text = "&Open...";
- this.menuItemOpen.Click += new System.EventHandler(this.menuItemOpen_Click);
- //
- // menuItemClose
- //
- this.menuItemClose.Name = "menuItemClose";
- this.menuItemClose.Size = new System.Drawing.Size(204, 22);
- this.menuItemClose.Text = "&Close";
- this.menuItemClose.Click += new System.EventHandler(this.menuItemClose_Click);
- //
- // menuItemCloseAll
- //
- this.menuItemCloseAll.Name = "menuItemCloseAll";
- this.menuItemCloseAll.Size = new System.Drawing.Size(204, 22);
- this.menuItemCloseAll.Text = "Close &All";
- this.menuItemCloseAll.Click += new System.EventHandler(this.menuItemCloseAll_Click);
- //
- // menuItemCloseAllButThisOne
- //
- this.menuItemCloseAllButThisOne.Name = "menuItemCloseAllButThisOne";
- this.menuItemCloseAllButThisOne.Size = new System.Drawing.Size(204, 22);
- this.menuItemCloseAllButThisOne.Text = "Close All &But This One";
- this.menuItemCloseAllButThisOne.Click += new System.EventHandler(this.menuItemCloseAllButThisOne_Click);
- //
- // menuItem4
- //
- this.menuItem4.Name = "menuItem4";
- this.menuItem4.Size = new System.Drawing.Size(201, 6);
- //
- // menuItemExit
- //
- this.menuItemExit.Name = "menuItemExit";
- this.menuItemExit.Size = new System.Drawing.Size(204, 22);
- this.menuItemExit.Text = "&Exit";
- this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_Click);
- //
- // exitWithoutSavingLayout
- //
- this.exitWithoutSavingLayout.Name = "exitWithoutSavingLayout";
- this.exitWithoutSavingLayout.Size = new System.Drawing.Size(204, 22);
- this.exitWithoutSavingLayout.Text = "Exit &Without Saving Layout";
- this.exitWithoutSavingLayout.Click += new System.EventHandler(this.exitWithoutSavingLayout_Click);
- //
- // menuItemView
- //
- this.menuItemView.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItemSolutionExplorer,
- this.menuItemPropertyWindow,
- this.menuItemToolbox,
- this.menuItemOutputWindow,
- this.menuItemTaskList,
- this.menuItem1,
- this.menuItemToolBar,
- this.menuItemStatusBar,
- this.menuItem2,
- this.menuItemLayoutByCode,
- this.menuItemLayoutByXml});
- this.menuItemView.MergeIndex = 1;
- this.menuItemView.Name = "menuItemView";
- this.menuItemView.Size = new System.Drawing.Size(41, 20);
- this.menuItemView.Text = "&View";
- //
- // menuItemSolutionExplorer
- //
- this.menuItemSolutionExplorer.Name = "menuItemSolutionExplorer";
- this.menuItemSolutionExplorer.Size = new System.Drawing.Size(176, 22);
- this.menuItemSolutionExplorer.Text = "&Solution Explorer";
- this.menuItemSolutionExplorer.Click += new System.EventHandler(this.menuItemSolutionExplorer_Click);
- //
- // menuItemPropertyWindow
- //
- this.menuItemPropertyWindow.Name = "menuItemPropertyWindow";
- this.menuItemPropertyWindow.ShortcutKeys = System.Windows.Forms.Keys.F4;
- this.menuItemPropertyWindow.Size = new System.Drawing.Size(176, 22);
- this.menuItemPropertyWindow.Text = "&Property Window";
- this.menuItemPropertyWindow.Click += new System.EventHandler(this.menuItemPropertyWindow_Click);
- //
- // menuItemToolbox
- //
- this.menuItemToolbox.Name = "menuItemToolbox";
- this.menuItemToolbox.Size = new System.Drawing.Size(176, 22);
- this.menuItemToolbox.Text = "&Toolbox";
- this.menuItemToolbox.Click += new System.EventHandler(this.menuItemToolbox_Click);
- //
- // menuItemOutputWindow
- //
- this.menuItemOutputWindow.Name = "menuItemOutputWindow";
- this.menuItemOutputWindow.Size = new System.Drawing.Size(176, 22);
- this.menuItemOutputWindow.Text = "&Output Window";
- this.menuItemOutputWindow.Click += new System.EventHandler(this.menuItemOutputWindow_Click);
- //
- // menuItemTaskList
- //
- this.menuItemTaskList.Name = "menuItemTaskList";
- this.menuItemTaskList.Size = new System.Drawing.Size(176, 22);
- this.menuItemTaskList.Text = "Task &List";
- this.menuItemTaskList.Click += new System.EventHandler(this.menuItemTaskList_Click);
- //
- // menuItem1
- //
- this.menuItem1.Name = "menuItem1";
- this.menuItem1.Size = new System.Drawing.Size(173, 6);
- //
- // menuItemToolBar
- //
- this.menuItemToolBar.Checked = true;
- this.menuItemToolBar.CheckState = System.Windows.Forms.CheckState.Checked;
- this.menuItemToolBar.Name = "menuItemToolBar";
- this.menuItemToolBar.Size = new System.Drawing.Size(176, 22);
- this.menuItemToolBar.Text = "Tool &Bar";
- this.menuItemToolBar.Click += new System.EventHandler(this.menuItemToolBar_Click);
- //
- // menuItemStatusBar
- //
- this.menuItemStatusBar.Checked = true;
- this.menuItemStatusBar.CheckState = System.Windows.Forms.CheckState.Checked;
- this.menuItemStatusBar.Name = "menuItemStatusBar";
- this.menuItemStatusBar.Size = new System.Drawing.Size(176, 22);
- this.menuItemStatusBar.Text = "Status B&ar";
- this.menuItemStatusBar.Click += new System.EventHandler(this.menuItemStatusBar_Click);
- //
- // menuItem2
- //
- this.menuItem2.Name = "menuItem2";
- this.menuItem2.Size = new System.Drawing.Size(173, 6);
- //
- // menuItemLayoutByCode
- //
- this.menuItemLayoutByCode.Name = "menuItemLayoutByCode";
- this.menuItemLayoutByCode.Size = new System.Drawing.Size(176, 22);
- this.menuItemLayoutByCode.Text = "Layout By &Code";
- this.menuItemLayoutByCode.Click += new System.EventHandler(this.menuItemLayoutByCode_Click);
- //
- // menuItemLayoutByXml
- //
- this.menuItemLayoutByXml.Name = "menuItemLayoutByXml";
- this.menuItemLayoutByXml.Size = new System.Drawing.Size(176, 22);
- this.menuItemLayoutByXml.Text = "Layout By &XML";
- this.menuItemLayoutByXml.Click += new System.EventHandler(this.menuItemLayoutByXml_Click);
- //
- // menuItemTools
- //
- this.menuItemTools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItemLockLayout,
- this.menuItemShowDocumentIcon,
- this.menuItem3,
- this.menuItemSchemaVS2005,
- this.menuItemSchemaVS2003,
- this.menuItem6,
- this.menuItemDockingMdi,
- this.menuItemDockingSdi,
- this.menuItemDockingWindow,
- this.menuItemSystemMdi,
- this.menuItem5,
- this.showRightToLeft});
- this.menuItemTools.MergeIndex = 2;
- this.menuItemTools.Name = "menuItemTools";
- this.menuItemTools.Size = new System.Drawing.Size(44, 20);
- this.menuItemTools.Text = "&Tools";
- this.menuItemTools.DropDownOpening += new System.EventHandler(this.menuItemTools_Popup);
- //
- // menuItemLockLayout
- //
- this.menuItemLockLayout.Name = "menuItemLockLayout";
- this.menuItemLockLayout.Size = new System.Drawing.Size(234, 22);
- this.menuItemLockLayout.Text = "&Lock Layout";
- this.menuItemLockLayout.Click += new System.EventHandler(this.menuItemLockLayout_Click);
- //
- // menuItemShowDocumentIcon
- //
- this.menuItemShowDocumentIcon.Name = "menuItemShowDocumentIcon";
- this.menuItemShowDocumentIcon.Size = new System.Drawing.Size(234, 22);
- this.menuItemShowDocumentIcon.Text = "&Show Document Icon";
- this.menuItemShowDocumentIcon.Click += new System.EventHandler(this.menuItemShowDocumentIcon_Click);
- //
- // menuItem3
- //
- this.menuItem3.Name = "menuItem3";
- this.menuItem3.Size = new System.Drawing.Size(231, 6);
- //
- // menuItemSchemaVS2005
- //
- this.menuItemSchemaVS2005.Checked = true;
- this.menuItemSchemaVS2005.CheckState = System.Windows.Forms.CheckState.Checked;
- this.menuItemSchemaVS2005.Name = "menuItemSchemaVS2005";
- this.menuItemSchemaVS2005.Size = new System.Drawing.Size(234, 22);
- this.menuItemSchemaVS2005.Text = "Schema: VS200&5";
- this.menuItemSchemaVS2005.Click += new System.EventHandler(this.SetSchema);
- //
- // menuItemSchemaVS2003
- //
- this.menuItemSchemaVS2003.Name = "menuItemSchemaVS2003";
- this.menuItemSchemaVS2003.Size = new System.Drawing.Size(234, 22);
- this.menuItemSchemaVS2003.Text = "Schema: VS200&3";
- this.menuItemSchemaVS2003.Click += new System.EventHandler(this.SetSchema);
- //
- // menuItem6
- //
- this.menuItem6.Name = "menuItem6";
- this.menuItem6.Size = new System.Drawing.Size(231, 6);
- //
- // menuItemDockingMdi
- //
- this.menuItemDockingMdi.Checked = true;
- this.menuItemDockingMdi.CheckState = System.Windows.Forms.CheckState.Checked;
- this.menuItemDockingMdi.Name = "menuItemDockingMdi";
- this.menuItemDockingMdi.Size = new System.Drawing.Size(234, 22);
- this.menuItemDockingMdi.Text = "Document Style: Docking &MDI";
- this.menuItemDockingMdi.Click += new System.EventHandler(this.SetDocumentStyle);
- //
- // menuItemDockingSdi
- //
- this.menuItemDockingSdi.Name = "menuItemDockingSdi";
- this.menuItemDockingSdi.Size = new System.Drawing.Size(234, 22);
- this.menuItemDockingSdi.Text = "Document Style: Docking &SDI";
- this.menuItemDockingSdi.Click += new System.EventHandler(this.SetDocumentStyle);
- //
- // menuItemDockingWindow
- //
- this.menuItemDockingWindow.Name = "menuItemDockingWindow";
- this.menuItemDockingWindow.Size = new System.Drawing.Size(234, 22);
- this.menuItemDockingWindow.Text = "Document Style: Docking &Window";
- this.menuItemDockingWindow.Click += new System.EventHandler(this.SetDocumentStyle);
- //
- // menuItemSystemMdi
- //
- this.menuItemSystemMdi.Name = "menuItemSystemMdi";
- this.menuItemSystemMdi.Size = new System.Drawing.Size(234, 22);
- this.menuItemSystemMdi.Text = "Document Style: S&ystem MDI";
- this.menuItemSystemMdi.Click += new System.EventHandler(this.SetDocumentStyle);
- //
- // menuItem5
- //
- this.menuItem5.Name = "menuItem5";
- this.menuItem5.Size = new System.Drawing.Size(231, 6);
- //
- // showRightToLeft
- //
- this.showRightToLeft.Name = "showRightToLeft";
- this.showRightToLeft.Size = new System.Drawing.Size(234, 22);
- this.showRightToLeft.Text = "Show &Right-To-Left";
- this.showRightToLeft.Click += new System.EventHandler(this.showRightToLeft_Click);
- //
- // menuItemWindow
- //
- this.menuItemWindow.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItemNewWindow});
- this.menuItemWindow.MergeIndex = 2;
- this.menuItemWindow.Name = "menuItemWindow";
- this.menuItemWindow.Size = new System.Drawing.Size(57, 20);
- this.menuItemWindow.Text = "&Window";
- //
- // menuItemNewWindow
- //
- this.menuItemNewWindow.Name = "menuItemNewWindow";
- this.menuItemNewWindow.Size = new System.Drawing.Size(136, 22);
- this.menuItemNewWindow.Text = "&New Window";
- this.menuItemNewWindow.Click += new System.EventHandler(this.menuItemNewWindow_Click);
- //
- // menuItemHelp
- //
- this.menuItemHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.menuItemAbout});
- this.menuItemHelp.MergeIndex = 3;
- this.menuItemHelp.Name = "menuItemHelp";
- this.menuItemHelp.Size = new System.Drawing.Size(40, 20);
- this.menuItemHelp.Text = "&Help";
- //
- // menuItemAbout
- //
- this.menuItemAbout.Name = "menuItemAbout";
- this.menuItemAbout.Size = new System.Drawing.Size(175, 22);
- this.menuItemAbout.Text = "&About DockSample...";
- this.menuItemAbout.Click += new System.EventHandler(this.menuItemAbout_Click);
- //
- // imageList
- //
- this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
- this.imageList.TransparentColor = System.Drawing.Color.Transparent;
- this.imageList.Images.SetKeyName(0, "");
- this.imageList.Images.SetKeyName(1, "");
- this.imageList.Images.SetKeyName(2, "");
- this.imageList.Images.SetKeyName(3, "");
- this.imageList.Images.SetKeyName(4, "");
- this.imageList.Images.SetKeyName(5, "");
- this.imageList.Images.SetKeyName(6, "");
- this.imageList.Images.SetKeyName(7, "");
- this.imageList.Images.SetKeyName(8, "");
- //
- // tableLayoutPanel1
- //
- this.tableLayoutPanel1.ColumnCount = 1;
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
- this.tableLayoutPanel1.Controls.Add(this.toolBar, 0, 0);
- this.tableLayoutPanel1.Controls.Add(this.dockPanel, 0, 1);
- this.tableLayoutPanel1.Controls.Add(this.statusBar, 0, 2);
- this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 24);
- this.tableLayoutPanel1.Name = "tableLayoutPanel1";
- this.tableLayoutPanel1.RowCount = 2;
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
- this.tableLayoutPanel1.Size = new System.Drawing.Size(579, 385);
- this.tableLayoutPanel1.TabIndex = 9;
- //
- // toolBar
- //
- this.toolBar.ImageList = this.imageList;
- this.toolBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.toolBarButtonNew,
- this.toolBarButtonOpen,
- this.toolBarButtonSeparator1,
- this.toolBarButtonSolutionExplorer,
- this.toolBarButtonPropertyWindow,
- this.toolBarButtonToolbox,
- this.toolBarButtonOutputWindow,
- this.toolBarButtonTaskList,
- this.toolBarButtonSeparator2,
- this.toolBarButtonLayoutByCode,
- this.toolBarButtonLayoutByXml});
- this.toolBar.Location = new System.Drawing.Point(0, 0);
- this.toolBar.Name = "toolBar";
- this.toolBar.Size = new System.Drawing.Size(579, 25);
- this.toolBar.TabIndex = 7;
- //
- // toolBarButtonNew
- //
- this.toolBarButtonNew.ImageIndex = 0;
- this.toolBarButtonNew.Name = "toolBarButtonNew";
- this.toolBarButtonNew.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonNew.ToolTipText = "Show Layout From XML";
- //
- // toolBarButtonOpen
- //
- this.toolBarButtonOpen.ImageIndex = 1;
- this.toolBarButtonOpen.Name = "toolBarButtonOpen";
- this.toolBarButtonOpen.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonOpen.ToolTipText = "Open";
- //
- // toolBarButtonSeparator1
- //
- this.toolBarButtonSeparator1.Name = "toolBarButtonSeparator1";
- this.toolBarButtonSeparator1.Size = new System.Drawing.Size(6, 25);
- //
- // toolBarButtonSolutionExplorer
- //
- this.toolBarButtonSolutionExplorer.ImageIndex = 2;
- this.toolBarButtonSolutionExplorer.Name = "toolBarButtonSolutionExplorer";
- this.toolBarButtonSolutionExplorer.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonSolutionExplorer.ToolTipText = "Solution Explorer";
- //
- // toolBarButtonPropertyWindow
- //
- this.toolBarButtonPropertyWindow.ImageIndex = 3;
- this.toolBarButtonPropertyWindow.Name = "toolBarButtonPropertyWindow";
- this.toolBarButtonPropertyWindow.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonPropertyWindow.ToolTipText = "Property Window";
- //
- // toolBarButtonToolbox
- //
- this.toolBarButtonToolbox.ImageIndex = 4;
- this.toolBarButtonToolbox.Name = "toolBarButtonToolbox";
- this.toolBarButtonToolbox.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonToolbox.ToolTipText = "Tool Box";
- //
- // toolBarButtonOutputWindow
- //
- this.toolBarButtonOutputWindow.ImageIndex = 5;
- this.toolBarButtonOutputWindow.Name = "toolBarButtonOutputWindow";
- this.toolBarButtonOutputWindow.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonOutputWindow.ToolTipText = "Output Window";
- //
- // toolBarButtonTaskList
- //
- this.toolBarButtonTaskList.ImageIndex = 6;
- this.toolBarButtonTaskList.Name = "toolBarButtonTaskList";
- this.toolBarButtonTaskList.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonTaskList.ToolTipText = "Task List";
- //
- // toolBarButtonSeparator2
- //
- this.toolBarButtonSeparator2.Name = "toolBarButtonSeparator2";
- this.toolBarButtonSeparator2.Size = new System.Drawing.Size(6, 25);
- //
- // toolBarButtonLayoutByCode
- //
- this.toolBarButtonLayoutByCode.ImageIndex = 7;
- this.toolBarButtonLayoutByCode.Name = "toolBarButtonLayoutByCode";
- this.toolBarButtonLayoutByCode.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonLayoutByCode.ToolTipText = "Show Layout By Code";
- //
- // toolBarButtonLayoutByXml
- //
- this.toolBarButtonLayoutByXml.ImageIndex = 8;
- this.toolBarButtonLayoutByXml.Name = "toolBarButtonLayoutByXml";
- this.toolBarButtonLayoutByXml.Size = new System.Drawing.Size(23, 22);
- this.toolBarButtonLayoutByXml.ToolTipText = "Show layout by predefined XML file";
- //
- // dockPanel
- //
- this.dockPanel.ActiveAutoHideContent = null;
- this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
- this.dockPanel.DockBottomPortion = 150;
- this.dockPanel.DockLeftPortion = 200;
- this.dockPanel.DockRightPortion = 200;
- this.dockPanel.DockTopPortion = 150;
- this.dockPanel.DocumentStyle = WeifenLuo.WinFormsUI.Docking.DocumentStyle.DockingWindow;
- this.dockPanel.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((byte)(0)));
- this.dockPanel.Location = new System.Drawing.Point(3, 28);
- this.dockPanel.Name = "dockPanel";
- this.dockPanel.RightToLeftLayout = true;
- this.dockPanel.Size = new System.Drawing.Size(573, 332);
- this.dockPanel.TabIndex = 10;
- //
- // statusBar
- //
- this.statusBar.Location = new System.Drawing.Point(0, 363);
- this.statusBar.Name = "statusBar";
- this.statusBar.Size = new System.Drawing.Size(579, 22);
- this.statusBar.TabIndex = 8;
- //
- // MainForm2
- //
- this.ClientSize = new System.Drawing.Size(579, 409);
- this.Controls.Add(this.tableLayoutPanel1);
- this.Controls.Add(this.mainMenu);
- this.IsMdiContainer = true;
- this.MainMenuStrip = this.mainMenu;
- this.Name = "MainForm2";
- this.Text = "DockSample";
- this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
- this.Closing += new System.ComponentModel.CancelEventHandler(this.MainForm_Closing);
- this.Load += new System.EventHandler(this.MainForm_Load);
- this.mainMenu.ResumeLayout(false);
- this.mainMenu.PerformLayout();
- this.tableLayoutPanel1.ResumeLayout(false);
- this.tableLayoutPanel1.PerformLayout();
- this.toolBar.ResumeLayout(false);
- this.toolBar.PerformLayout();
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
- #endregion
-
- private System.Windows.Forms.ImageList imageList;
- private System.Windows.Forms.MenuStrip mainMenu;
- private System.Windows.Forms.ToolStripMenuItem menuItemFile;
- private System.Windows.Forms.ToolStripMenuItem menuItemNew;
- private System.Windows.Forms.ToolStripMenuItem menuItemOpen;
- private System.Windows.Forms.ToolStripMenuItem menuItemClose;
- private System.Windows.Forms.ToolStripMenuItem menuItemCloseAll;
- private System.Windows.Forms.ToolStripMenuItem menuItemCloseAllButThisOne;
- private System.Windows.Forms.ToolStripSeparator menuItem4;
- private System.Windows.Forms.ToolStripMenuItem menuItemExit;
- private System.Windows.Forms.ToolStripMenuItem menuItemView;
- private System.Windows.Forms.ToolStripMenuItem menuItemSolutionExplorer;
- private System.Windows.Forms.ToolStripMenuItem menuItemPropertyWindow;
- private System.Windows.Forms.ToolStripMenuItem menuItemToolbox;
- private System.Windows.Forms.ToolStripMenuItem menuItemOutputWindow;
- private System.Windows.Forms.ToolStripMenuItem menuItemTaskList;
- private System.Windows.Forms.ToolStripSeparator menuItem1;
- private System.Windows.Forms.ToolStripMenuItem menuItemToolBar;
- private System.Windows.Forms.ToolStripMenuItem menuItemStatusBar;
- private System.Windows.Forms.ToolStripSeparator menuItem2;
- private System.Windows.Forms.ToolStripMenuItem menuItemLayoutByCode;
- private System.Windows.Forms.ToolStripMenuItem menuItemLayoutByXml;
- private System.Windows.Forms.ToolStripMenuItem menuItemTools;
- private System.Windows.Forms.ToolStripMenuItem menuItemLockLayout;
- private System.Windows.Forms.ToolStripSeparator menuItem3;
- private System.Windows.Forms.ToolStripMenuItem menuItemSchemaVS2005;
- private System.Windows.Forms.ToolStripMenuItem menuItemSchemaVS2003;
- private System.Windows.Forms.ToolStripSeparator menuItem6;
- private System.Windows.Forms.ToolStripMenuItem menuItemDockingMdi;
- private System.Windows.Forms.ToolStripMenuItem menuItemDockingSdi;
- private System.Windows.Forms.ToolStripMenuItem menuItemDockingWindow;
- private System.Windows.Forms.ToolStripMenuItem menuItemSystemMdi;
- private System.Windows.Forms.ToolStripSeparator menuItem5;
- private System.Windows.Forms.ToolStripMenuItem menuItemShowDocumentIcon;
- private System.Windows.Forms.ToolStripMenuItem menuItemWindow;
- private System.Windows.Forms.ToolStripMenuItem menuItemNewWindow;
- private System.Windows.Forms.ToolStripMenuItem menuItemHelp;
- private System.Windows.Forms.ToolStripMenuItem menuItemAbout;
- private System.Windows.Forms.ToolStripMenuItem showRightToLeft;
- private System.Windows.Forms.ToolStripMenuItem exitWithoutSavingLayout;
- private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
- private WeifenLuo.WinFormsUI.Docking.DockPanel dockPanel;
- private System.Windows.Forms.StatusStrip statusBar;
- private System.Windows.Forms.ToolStrip toolBar;
- private System.Windows.Forms.ToolStripButton toolBarButtonNew;
- private System.Windows.Forms.ToolStripButton toolBarButtonOpen;
- private System.Windows.Forms.ToolStripSeparator toolBarButtonSeparator1;
- private System.Windows.Forms.ToolStripButton toolBarButtonSolutionExplorer;
- private System.Windows.Forms.ToolStripButton toolBarButtonPropertyWindow;
- private System.Windows.Forms.ToolStripButton toolBarButtonToolbox;
- private System.Windows.Forms.ToolStripButton toolBarButtonOutputWindow;
- private System.Windows.Forms.ToolStripButton toolBarButtonTaskList;
- private System.Windows.Forms.ToolStripSeparator toolBarButtonSeparator2;
- private System.Windows.Forms.ToolStripButton toolBarButtonLayoutByCode;
- private System.Windows.Forms.ToolStripButton toolBarButtonLayoutByXml;
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/MainForm2.cs b/src/Libraries/DockPanel_Src/DockSample/MainForm2.cs
deleted file mode 100644
index dfe83880cb..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/MainForm2.cs
+++ /dev/null
@@ -1,443 +0,0 @@
-using System;
-using System.Drawing;
-using System.Collections;
-using System.ComponentModel;
-using System.Reflection;
-using System.Windows.Forms;
-using System.IO;
-using WeifenLuo.WinFormsUI.Docking;
-using DockSample.Customization;
-
-namespace DockSample
-{
- public partial class MainForm2 : Form
- {
- private bool m_bSaveLayout = true;
- private DeserializeDockContent m_deserializeDockContent;
- private DummySolutionExplorer m_solutionExplorer = new DummySolutionExplorer();
- private DummyPropertyWindow m_propertyWindow = new DummyPropertyWindow();
- private DummyToolbox m_toolbox = new DummyToolbox();
- private DummyOutputWindow m_outputWindow = new DummyOutputWindow();
- private DummyTaskList m_taskList = new DummyTaskList();
-
- public MainForm2()
- {
- InitializeComponent();
- showRightToLeft.Checked = (RightToLeft == RightToLeft.Yes);
- RightToLeftLayout = showRightToLeft.Checked;
- m_solutionExplorer = new DummySolutionExplorer();
- m_solutionExplorer.RightToLeftLayout = RightToLeftLayout;
- m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
- }
-
- private void menuItemExit_Click(object sender, System.EventArgs e)
- {
- Close();
- }
-
- private void menuItemSolutionExplorer_Click(object sender, System.EventArgs e)
- {
- m_solutionExplorer.Show(dockPanel);
- }
-
- private void menuItemPropertyWindow_Click(object sender, System.EventArgs e)
- {
- m_propertyWindow.Show(dockPanel);
- }
-
- private void menuItemToolbox_Click(object sender, System.EventArgs e)
- {
- m_toolbox.Show(dockPanel);
- }
-
- private void menuItemOutputWindow_Click(object sender, System.EventArgs e)
- {
- m_outputWindow.Show(dockPanel);
- }
-
- private void menuItemTaskList_Click(object sender, System.EventArgs e)
- {
- m_taskList.Show(dockPanel);
- }
-
- private void menuItemAbout_Click(object sender, System.EventArgs e)
- {
- AboutDialog aboutDialog = new AboutDialog();
- aboutDialog.ShowDialog(this);
- }
-
- private IDockContent FindDocument(string text)
- {
- if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- {
- foreach (Form form in MdiChildren)
- if (form.Text == text)
- return form as IDockContent;
-
- return null;
- }
- else
- {
- foreach (IDockContent content in dockPanel.Documents)
- if (content.DockHandler.TabText == text)
- return content;
-
- return null;
- }
- }
-
- private void menuItemNew_Click(object sender, System.EventArgs e)
- {
- DummyDoc dummyDoc = CreateNewDocument();
- if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- {
- dummyDoc.MdiParent = this;
- dummyDoc.Show();
- }
- else
- dummyDoc.Show(dockPanel);
- }
-
- private DummyDoc CreateNewDocument()
- {
- DummyDoc dummyDoc = new DummyDoc();
-
- int count = 1;
- //string text = "C:\\MADFDKAJ\\ADAKFJASD\\ADFKDSAKFJASD\\ASDFKASDFJASDF\\ASDFIJADSFJ\\ASDFKDFDA" + count.ToString();
- string text = "Document" + count.ToString();
- while (FindDocument(text) != null)
- {
- count ++;
- //text = "C:\\MADFDKAJ\\ADAKFJASD\\ADFKDSAKFJASD\\ASDFKASDFJASDF\\ASDFIJADSFJ\\ASDFKDFDA" + count.ToString();
- text = "Document" + count.ToString();
- }
- dummyDoc.Text = text;
- return dummyDoc;
- }
-
- private DummyDoc CreateNewDocument(string text)
- {
- DummyDoc dummyDoc = new DummyDoc();
- dummyDoc.Text = text;
- return dummyDoc;
- }
-
- private void menuItemOpen_Click(object sender, System.EventArgs e)
- {
- OpenFileDialog openFile = new OpenFileDialog();
-
- openFile.InitialDirectory = Application.ExecutablePath;
- openFile.Filter = "rtf files (*.rtf)|*.rtf|txt files (*.txt)|*.txt|All files (*.*)|*.*" ;
- openFile.FilterIndex = 1;
- openFile.RestoreDirectory = true ;
-
- if(openFile.ShowDialog() == DialogResult.OK)
- {
- string fullName = openFile.FileName;
- string fileName = Path.GetFileName(fullName);
-
- if (FindDocument(fileName) != null)
- {
- MessageBox.Show("The document: " + fileName + " has already opened!");
- return;
- }
-
- DummyDoc dummyDoc = new DummyDoc();
- dummyDoc.Text = fileName;
- dummyDoc.Show(dockPanel);
- try
- {
- dummyDoc.FileName = fullName;
- }
- catch (Exception exception)
- {
- dummyDoc.Close();
- MessageBox.Show(exception.Message);
- }
-
- }
- }
-
- private void menuItemFile_Popup(object sender, System.EventArgs e)
- {
- if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- {
- menuItemClose.Enabled = menuItemCloseAll.Enabled = (ActiveMdiChild != null);
- }
- else
- {
- menuItemClose.Enabled = (dockPanel.ActiveDocument != null);
- menuItemCloseAll.Enabled = (dockPanel.DocumentsCount > 0);
- }
- }
-
- private void menuItemClose_Click(object sender, System.EventArgs e)
- {
- if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- ActiveMdiChild.Close();
- else if (dockPanel.ActiveDocument != null)
- dockPanel.ActiveDocument.DockHandler.Close();
- }
-
- private void menuItemCloseAll_Click(object sender, System.EventArgs e)
- {
- CloseAllDocuments();
- }
-
- private void CloseAllDocuments()
- {
- if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- {
- foreach (Form form in MdiChildren)
- form.Close();
- }
- else
- {
- IDockContent[] documents = dockPanel.DocumentsToArray();
- foreach (IDockContent content in documents)
- content.DockHandler.Close();
- }
- }
-
- private IDockContent GetContentFromPersistString(string persistString)
- {
- if (persistString == typeof(DummySolutionExplorer).ToString())
- return m_solutionExplorer;
- else if (persistString == typeof(DummyPropertyWindow).ToString())
- return m_propertyWindow;
- else if (persistString == typeof(DummyToolbox).ToString())
- return m_toolbox;
- else if (persistString == typeof(DummyOutputWindow).ToString())
- return m_outputWindow;
- else if (persistString == typeof(DummyTaskList).ToString())
- return m_taskList;
- else
- {
- string[] parsedStrings = persistString.Split(new char[] { ',' });
- if (parsedStrings.Length != 3)
- return null;
-
- if (parsedStrings[0] != typeof(DummyDoc).ToString())
- return null;
-
- DummyDoc dummyDoc = new DummyDoc();
- if (parsedStrings[1] != string.Empty)
- dummyDoc.FileName = parsedStrings[1];
- if (parsedStrings[2] != string.Empty)
- dummyDoc.Text = parsedStrings[2];
-
- return dummyDoc;
- }
- }
-
- private void MainForm_Load(object sender, System.EventArgs e)
- {
- string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config");
-
- if (File.Exists(configFile))
- dockPanel.LoadFromXml(configFile, m_deserializeDockContent);
- }
-
- private void MainForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
- {
- string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config");
- if (m_bSaveLayout)
- dockPanel.SaveAsXml(configFile);
- else if (File.Exists(configFile))
- File.Delete(configFile);
- }
-
- private void menuItemToolBar_Click(object sender, System.EventArgs e)
- {
- toolBar.Visible = menuItemToolBar.Checked = !menuItemToolBar.Checked;
- }
-
- private void menuItemStatusBar_Click(object sender, System.EventArgs e)
- {
- statusBar.Visible = menuItemStatusBar.Checked = !menuItemStatusBar.Checked;
- }
-
- private void toolBar_ButtonClick(object sender, System.Windows.Forms.ToolStripItemClickedEventArgs e)
- {
- if (e.ClickedItem == toolBarButtonNew)
- menuItemNew_Click(null, null);
- else if (e.ClickedItem == toolBarButtonOpen)
- menuItemOpen_Click(null, null);
- else if (e.ClickedItem == toolBarButtonSolutionExplorer)
- menuItemSolutionExplorer_Click(null, null);
- else if (e.ClickedItem == toolBarButtonPropertyWindow)
- menuItemPropertyWindow_Click(null, null);
- else if (e.ClickedItem == toolBarButtonToolbox)
- menuItemToolbox_Click(null, null);
- else if (e.ClickedItem == toolBarButtonOutputWindow)
- menuItemOutputWindow_Click(null, null);
- else if (e.ClickedItem == toolBarButtonTaskList)
- menuItemTaskList_Click(null, null);
- else if (e.ClickedItem == toolBarButtonLayoutByCode)
- menuItemLayoutByCode_Click(null, null);
- else if (e.ClickedItem == toolBarButtonLayoutByXml)
- menuItemLayoutByXml_Click(null, null);
- }
-
- private void menuItemNewWindow_Click(object sender, System.EventArgs e)
- {
- MainForm newWindow = new MainForm();
- newWindow.Text = newWindow.Text + " - New";
- newWindow.Show();
- }
-
- private void menuItemTools_Popup(object sender, System.EventArgs e)
- {
- menuItemLockLayout.Checked = !this.dockPanel.AllowEndUserDocking;
- }
-
- private void menuItemLockLayout_Click(object sender, System.EventArgs e)
- {
- dockPanel.AllowEndUserDocking = !dockPanel.AllowEndUserDocking;
- }
-
- private void menuItemLayoutByCode_Click(object sender, System.EventArgs e)
- {
- dockPanel.SuspendLayout(true);
-
- m_solutionExplorer.Show(dockPanel, DockState.DockRight);
- m_propertyWindow.Show(m_solutionExplorer.Pane, m_solutionExplorer);
- m_toolbox.Show(dockPanel, new Rectangle(98, 133, 200, 383));
- m_outputWindow.Show(m_solutionExplorer.Pane, DockAlignment.Bottom, 0.35);
- m_taskList.Show(m_toolbox.Pane, DockAlignment.Left, 0.4);
-
- CloseAllDocuments();
- DummyDoc doc1 = CreateNewDocument("Document1");
- DummyDoc doc2 = CreateNewDocument("Document2");
- DummyDoc doc3 = CreateNewDocument("Document3");
- DummyDoc doc4 = CreateNewDocument("Document4");
- doc1.Show(dockPanel, DockState.Document);
- doc2.Show(doc1.Pane, null);
- doc3.Show(doc1.Pane, DockAlignment.Bottom, 0.5);
- doc4.Show(doc3.Pane, DockAlignment.Right, 0.5);
-
- dockPanel.ResumeLayout(true, true);
- }
-
- private void menuItemLayoutByXml_Click(object sender, System.EventArgs e)
- {
- dockPanel.SuspendLayout(true);
-
- // In order to load layout from XML, we need to close all the DockContents
- CloseAllContents();
-
- Assembly assembly = Assembly.GetAssembly(typeof(MainForm));
- Stream xmlStream = assembly.GetManifestResourceStream("DockSample.Resources.DockPanel.xml");
- dockPanel.LoadFromXml(xmlStream, m_deserializeDockContent);
- xmlStream.Close();
-
- dockPanel.ResumeLayout(true, true);
- }
-
- private void CloseAllContents()
- {
- // we don't want to create another instance of tool window, set DockPanel to null
- m_solutionExplorer.DockPanel = null;
- m_propertyWindow.DockPanel = null;
- m_toolbox.DockPanel = null;
- m_outputWindow.DockPanel = null;
- m_taskList.DockPanel = null;
-
- // Close all other document windows
- CloseAllDocuments();
- }
-
- private void SetSchema(object sender, System.EventArgs e)
- {
- CloseAllContents();
-
- if (sender == menuItemSchemaVS2005)
- Extender.SetSchema(dockPanel, Extender.Schema.VS2005);
- else if (sender == menuItemSchemaVS2003)
- Extender.SetSchema(dockPanel, Extender.Schema.VS2003);
-
- menuItemSchemaVS2005.Checked = (sender == menuItemSchemaVS2005);
- menuItemSchemaVS2003.Checked = (sender == menuItemSchemaVS2003);
- }
-
- private void SetDocumentStyle(object sender, System.EventArgs e)
- {
- DocumentStyle oldStyle = dockPanel.DocumentStyle;
- DocumentStyle newStyle;
- if (sender == menuItemDockingMdi)
- newStyle = DocumentStyle.DockingMdi;
- else if (sender == menuItemDockingWindow)
- newStyle = DocumentStyle.DockingWindow;
- else if (sender == menuItemDockingSdi)
- newStyle = DocumentStyle.DockingSdi;
- else
- newStyle = DocumentStyle.SystemMdi;
-
- if (oldStyle == newStyle)
- return;
-
- if (oldStyle == DocumentStyle.SystemMdi || newStyle == DocumentStyle.SystemMdi)
- CloseAllDocuments();
-
- dockPanel.DocumentStyle = newStyle;
- menuItemDockingMdi.Checked = (newStyle == DocumentStyle.DockingMdi);
- menuItemDockingWindow.Checked = (newStyle == DocumentStyle.DockingWindow);
- menuItemDockingSdi.Checked = (newStyle == DocumentStyle.DockingSdi);
- menuItemSystemMdi.Checked = (newStyle == DocumentStyle.SystemMdi);
- menuItemLayoutByCode.Enabled = (newStyle != DocumentStyle.SystemMdi);
- menuItemLayoutByXml.Enabled = (newStyle != DocumentStyle.SystemMdi);
- toolBarButtonLayoutByCode.Enabled = (newStyle != DocumentStyle.SystemMdi);
- toolBarButtonLayoutByXml.Enabled = (newStyle != DocumentStyle.SystemMdi);
- }
-
- private void menuItemCloseAllButThisOne_Click(object sender, System.EventArgs e)
- {
- if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- {
- Form activeMdi = ActiveMdiChild;
- foreach (Form form in MdiChildren)
- {
- if (form != activeMdi)
- form.Close();
- }
- }
- else
- {
- foreach (IDockContent document in dockPanel.DocumentsToArray())
- {
- if (!document.DockHandler.IsActivated)
- document.DockHandler.Close();
- }
- }
- }
-
- private void menuItemShowDocumentIcon_Click(object sender, System.EventArgs e)
- {
- dockPanel.ShowDocumentIcon = menuItemShowDocumentIcon.Checked= !menuItemShowDocumentIcon.Checked;
- }
-
- private void showRightToLeft_Click(object sender, EventArgs e)
- {
- CloseAllContents();
- if (showRightToLeft.Checked)
- {
- this.RightToLeft = RightToLeft.No;
- this.RightToLeftLayout = false;
- }
- else
- {
- this.RightToLeft = RightToLeft.Yes;
- this.RightToLeftLayout = true;
- }
- m_solutionExplorer.RightToLeftLayout = this.RightToLeftLayout;
- showRightToLeft.Checked = !showRightToLeft.Checked;
- }
-
- private void exitWithoutSavingLayout_Click(object sender, EventArgs e)
- {
- m_bSaveLayout = false;
- Close();
- m_bSaveLayout = true;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/MainForm2.resx b/src/Libraries/DockPanel_Src/DockSample/MainForm2.resx
deleted file mode 100644
index b34fbc3c84..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/MainForm2.resx
+++ /dev/null
@@ -1,194 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 120, 12
-
-
- 24, 9
-
-
-
- AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
- LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
- ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADY
- DAAAAk1TRnQBSQFMAgEBCQEAAQ4BAAEEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
- AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
- AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
- AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
- AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
- AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
- AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
- ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
- AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
- AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
- AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
- AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
- AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
- AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
- AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
- AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
- ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
- Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
- AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
- AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
- AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
- ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
- Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
- AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
- AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
- AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
- AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
- AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
- AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/0IAAewMBzMAAewL/wEH
- MwAB7AP/BgIC/wEHMwAB7Av/AQczAAHsA/8GAgL/AQczAAHsC/8BBzMAAewB/wEHAQAC/wIAAv8BAAIH
- MwAB7AEHAQAC/wEEAQIBBAEAAv8BAAHsMwAB7AH/AQcBAAH/AQIB/gECAQAB/wEAAgczAAHsAv8BBwL/
- AQIBBAT/AQczAAHsCf82AAHsCf8B7AEAAewzAAHsCf8C7DQAC+zmAAHsCwcEAAEBBwABBxcAAewK/wUA
- AewK/wEHBQABAQUAAQcJAAr/BQAB7AP/AgcF/wUAAewE/wUHAf8BBwYAAQEDAAEHCgAB/wfsAv8FAAHs
- A/8BAQIHBP8FAAHsCv8BBwcAAQEBAAEHCwAK/wUAAewC/wMBAgcD/wUAAewE/wUHAf8BBwgAAQcMAAH/
- COwB/wUAAewB/wIBAf8CAQEHA/8FAAHsAv8BAgf/AQcHAAEHAQABAQsACv8FAAHsBf8BAQHsAQcC/wUA
- AewB/wICAf8BAgQHAf8BBwYAAQcDAAEBBAABAwUAAf8HAAL/BQAB7Ab/AQECBwH/BQAB7AL/AwIF/wEH
- CwABAQMAAgMEAAr/BQAB7Af/AQEBBwH/BQAB7AH/AgIB/wICBP8BBw0AAgMGAAH/COwB/wUAAewI/wEB
- Af8FAAHsAv8DAgT/AgcMAAMDBgAK/wUAAewK/wUAAewC/wECAf8CAgL/DwADAwUADAQEAAHsAv8GAAL/
- BQAB7AT/AQID/wHsAQAB7AoAAgMIAAwEBQAC7AEAAf8DBwEAAuwFAAHsCP8C7CkABOwIAArsqgABBAQA
- AQM5AAEEAfwC+QEAAQMC+wQACv8IAAn/BgAJAwkAAewB/AEAA/kBAAL7AQAB+gIAAf8CAAH/BQAB/wgA
- Cf8FAAH7AQAJAwUABP8BAAL/A/kCAAH/AfoCAAr/CAAJ/wUAAf8B+wEACQMEAAT/AfoBAAH/AQcD+QEA
- Av8CAAH/AgAB/wUAAf8IAAn/BQAB+wH/AfsBAAkDAwAE/wL6Af8B+wEHA/kBAAH8AgAK/wgACf8FAAH/
- AfsB/wH7DAAF/wH6Af8B+wEHAf8C+QEAAfwCAAL/AgAD/wEAAv8IAAn/BQAB+wH/AfsB/wH7Af8B+wH/
- AfsHAAb/AgMD/wEBBAAC/wMAAf8DAAH/BAABBAMACf8FAAH/AfsB/wH7Af8B+wH/AfsB/wcADP8BBwMA
- A/8KAAIEAwAJ/wUAAfsB/wH7DQAM/wEHEAACBAMABv8YAAz/AQcQAAIEAwAG/wEAAf8WAAz/AQcQAAIE
- AwAG/xgADQQQAAIEIQANBBAAAgRAAAFCAU0BPgcAAT4DAAEoAwABQAMAATADAAEBAQABAQUAAYABARYA
- A/8BAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGAAQEGAAGA
- AQEGAAGAAQEGAAGAAQEGAAGAAQsGAAGAAQcGAAGAAQ8GAAL/BgAG/wHAAQEBnwHPAv8B4AEHAcABAQKP
- AcABAwHAAQMBwAEBAccBHwHAAQMBwAEDAcABAQHiAT8BwAEDAcABAwHAAQEB8AF/AcABAwHAAQMBwAEB
- AfgB/wHAAQMBwAEDAcABAQHwAXsBwAEDAcABAwHAAQEBAgExAcABAwHAAQMBwAEBAQcBAAHAAQMBwAED
- AcABAQFnAYEBwAEDAcABAwHAAQEB5wGDAcABAwHAAQMBwAEBAccBAwHAAQMBwAEDAcABCwH8AQcBwAED
- AeABBwHAAQcB/gEfAv8B/AE/AcABDxT/AfwBYwEAAQ8BwAEHAQABHwH4AQEBAAEPAcABBwEAAQ8BgAIA
- AQ8BwAEHAQABBwGAAgABDwHAAQcBAAEDAYACAAEPAcABBwEAAQEBgAIAAQ8BwAEHAgABgAEBAQABDwHA
- AQcBAAEfAYABAwEIAY4BwAEHAQABHwGAAQMBBQFEAcABBwEAAR8BgAEDAQIBuAHAAQcBjwHxAYABAwH9
- AXwBwAEPAf8B+QGAAQMB/gH8AcABHwH/AXUBgAEDAf8BAAHAAT8B/wGPAYABAwH/AfwI/ws=
-
-
-
- 226, 12
-
-
- 310, 13
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/Program.cs b/src/Libraries/DockPanel_Src/DockSample/Program.cs
deleted file mode 100644
index 1f61876738..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Program.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-
-namespace DockSample
-{
- static class Program
- {
- ///
- /// The main entry point for the application.
- ///
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new MainForm());
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/Properties/AssemblyInfo.cs b/src/Libraries/DockPanel_Src/DockSample/Properties/AssemblyInfo.cs
deleted file mode 100644
index ca0d0b139e..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// 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("DockSample")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Weifen Luo")]
-[assembly: AssemblyProduct("DockSample")]
-[assembly: AssemblyCopyright("Copyright © Weifen Luo 2007")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("f881c535-4ab4-4ef8-93c2-785db20a791e")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("2.0.*")]
-//[assembly: AssemblyFileVersion("2.0.0.0")]
diff --git a/src/Libraries/DockPanel_Src/DockSample/Properties/Resources.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/Properties/Resources.Designer.cs
deleted file mode 100644
index f454f9f083..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.42
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace DockSample.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("DockSample.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/DockPanel_Src/DockSample/Properties/Resources.resx b/src/Libraries/DockPanel_Src/DockSample/Properties/Resources.resx
deleted file mode 100644
index af7dbebbac..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/Properties/Settings.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/Properties/Settings.Designer.cs
deleted file mode 100644
index dbfe78b492..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.42
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace DockSample.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.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/DockPanel_Src/DockSample/Properties/Settings.settings b/src/Libraries/DockPanel_Src/DockSample/Properties/Settings.settings
deleted file mode 100644
index 39645652af..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/Libraries/DockPanel_Src/DockSample/Resources/DockPanel.xml b/src/Libraries/DockPanel_Src/DockSample/Resources/DockPanel.xml
deleted file mode 100644
index a40333b9b4..0000000000
Binary files a/src/Libraries/DockPanel_Src/DockSample/Resources/DockPanel.xml and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/DockSample/ToolWindow.Designer.cs b/src/Libraries/DockPanel_Src/DockSample/ToolWindow.Designer.cs
deleted file mode 100644
index 2b098e248a..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/ToolWindow.Designer.cs
+++ /dev/null
@@ -1,91 +0,0 @@
-namespace DockSample
-{
- partial class ToolWindow
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
- this.option1ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.option2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.option3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.contextMenuStrip1.SuspendLayout();
- this.SuspendLayout();
- //
- // contextMenuStrip1
- //
- this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.option1ToolStripMenuItem,
- this.option2ToolStripMenuItem,
- this.option3ToolStripMenuItem});
- this.contextMenuStrip1.Name = "contextMenuStrip1";
- this.contextMenuStrip1.Size = new System.Drawing.Size(113, 70);
- //
- // option1ToolStripMenuItem
- //
- this.option1ToolStripMenuItem.Name = "option1ToolStripMenuItem";
- this.option1ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
- this.option1ToolStripMenuItem.Text = "Option&1";
- //
- // option2ToolStripMenuItem
- //
- this.option2ToolStripMenuItem.Name = "option2ToolStripMenuItem";
- this.option2ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
- this.option2ToolStripMenuItem.Text = "Option&2";
- //
- // option3ToolStripMenuItem
- //
- this.option3ToolStripMenuItem.Name = "option3ToolStripMenuItem";
- this.option3ToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
- this.option3ToolStripMenuItem.Text = "Option&3";
- //
- // ToolWindow
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(292, 266);
- this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.Float | WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
- | WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)));
- this.Name = "ToolWindow";
- this.TabPageContextMenuStrip = this.contextMenuStrip1;
- this.TabText = "ToolWindow";
- this.Text = "ToolWindow";
- this.contextMenuStrip1.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
- private System.Windows.Forms.ToolStripMenuItem option1ToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem option2ToolStripMenuItem;
- private System.Windows.Forms.ToolStripMenuItem option3ToolStripMenuItem;
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/ToolWindow.cs b/src/Libraries/DockPanel_Src/DockSample/ToolWindow.cs
deleted file mode 100644
index eefee4378a..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/ToolWindow.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Text;
-using System.Windows.Forms;
-using WeifenLuo.WinFormsUI.Docking;
-
-namespace DockSample
-{
- public partial class ToolWindow : DockContent
- {
- public ToolWindow()
- {
- InitializeComponent();
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/ToolWindow.resx b/src/Libraries/DockPanel_Src/DockSample/ToolWindow.resx
deleted file mode 100644
index 6fab886155..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/ToolWindow.resx
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 17, 17
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/DockSample/license.txt b/src/Libraries/DockPanel_Src/DockSample/license.txt
deleted file mode 100644
index 96f3fa5ce9..0000000000
--- a/src/Libraries/DockPanel_Src/DockSample/license.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-The MIT License
-
-Copyright (c) 2007 Weifen Luo (email: weifenluo@yahoo.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI.Docking.sln b/src/Libraries/DockPanel_Src/WinFormsUI.Docking.sln
deleted file mode 100644
index 10268f1600..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI.Docking.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual C# Express 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "WinFormsUI\WinFormsUI.csproj", "{C75532C4-765B-418E-B09B-46D36B2ABDB1}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DockSample", "DockSample\DockSample.csproj", "{40793A27-478B-4357-B4C3-FC8943131F3D}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C75532C4-765B-418E-B09B-46D36B2ABDB1}.Release|Any CPU.Build.0 = Release|Any CPU
- {40793A27-478B-4357-B4C3-FC8943131F3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {40793A27-478B-4357-B4C3-FC8943131F3D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {40793A27-478B-4357-B4C3-FC8943131F3D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {40793A27-478B-4357-B4C3-FC8943131F3D}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideStripBase.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideStripBase.cs
deleted file mode 100644
index 7c0cb3c478..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/AutoHideStripBase.cs
+++ /dev/null
@@ -1,508 +0,0 @@
-using System;
-using System.Collections;
-using System.Windows.Forms;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public abstract partial class AutoHideStripBase : Control
- {
- [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- protected class Tab : IDisposable
- {
- private IDockContent m_content;
-
- protected internal Tab(IDockContent content)
- {
- m_content = content;
- }
-
- public IDockContent Content
- {
- get { return m_content; }
- }
-
- public virtual void Dispose()
- {
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- protected sealed class TabCollection : IEnumerable
- {
- #region IEnumerable Members
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (int i = 0; i < Count; i++)
- yield return this[i];
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (int i = 0; i < Count; i++)
- yield return this[i];
- }
- #endregion
-
- internal TabCollection(DockPane pane)
- {
- m_dockPane = pane;
- }
-
- private DockPane m_dockPane = null;
- public DockPane DockPane
- {
- get { return m_dockPane; }
- }
-
- public DockPanel DockPanel
- {
- get { return DockPane.DockPanel; }
- }
-
- public int Count
- {
- get { return DockPane.DisplayingContents.Count; }
- }
-
- public Tab this[int index]
- {
- get
- {
- IDockContent content = DockPane.DisplayingContents[index];
- if (content == null)
- throw (new ArgumentOutOfRangeException("index"));
- if (content.DockHandler.AutoHideTab == null)
- content.DockHandler.AutoHideTab = (DockPanel.AutoHideStripControl.CreateTab(content));
- return content.DockHandler.AutoHideTab as Tab;
- }
- }
-
- public bool Contains(Tab tab)
- {
- return (IndexOf(tab) != -1);
- }
-
- public bool Contains(IDockContent content)
- {
- return (IndexOf(content) != -1);
- }
-
- public int IndexOf(Tab tab)
- {
- if (tab == null)
- return -1;
-
- return IndexOf(tab.Content);
- }
-
- public int IndexOf(IDockContent content)
- {
- return DockPane.DisplayingContents.IndexOf(content);
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- protected class Pane : IDisposable
- {
- private DockPane m_dockPane;
-
- protected internal Pane(DockPane dockPane)
- {
- m_dockPane = dockPane;
- }
-
- public DockPane DockPane
- {
- get { return m_dockPane; }
- }
-
- public TabCollection AutoHideTabs
- {
- get
- {
- if (DockPane.AutoHideTabs == null)
- DockPane.AutoHideTabs = new TabCollection(DockPane);
- return DockPane.AutoHideTabs as TabCollection;
- }
- }
-
- public virtual void Dispose()
- {
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- protected sealed class PaneCollection : IEnumerable
- {
- private class AutoHideState
- {
- public DockState m_dockState;
- public bool m_selected = false;
-
- public AutoHideState(DockState dockState)
- {
- m_dockState = dockState;
- }
-
- public DockState DockState
- {
- get { return m_dockState; }
- }
-
- public bool Selected
- {
- get { return m_selected; }
- set { m_selected = value; }
- }
- }
-
- private class AutoHideStateCollection
- {
- private AutoHideState[] m_states;
-
- public AutoHideStateCollection()
- {
- m_states = new AutoHideState[] {
- new AutoHideState(DockState.DockTopAutoHide),
- new AutoHideState(DockState.DockBottomAutoHide),
- new AutoHideState(DockState.DockLeftAutoHide),
- new AutoHideState(DockState.DockRightAutoHide)
- };
- }
-
- public AutoHideState this[DockState dockState]
- {
- get
- {
- for (int i = 0; i < m_states.Length; i++)
- {
- if (m_states[i].DockState == dockState)
- return m_states[i];
- }
- throw new ArgumentOutOfRangeException("dockState");
- }
- }
-
- public bool ContainsPane(DockPane pane)
- {
- if (pane.IsHidden)
- return false;
-
- for (int i = 0; i < m_states.Length; i++)
- {
- if (m_states[i].DockState == pane.DockState && m_states[i].Selected)
- return true;
- }
- return false;
- }
- }
-
- internal PaneCollection(DockPanel panel, DockState dockState)
- {
- m_dockPanel = panel;
- m_states = new AutoHideStateCollection();
- States[DockState.DockTopAutoHide].Selected = (dockState == DockState.DockTopAutoHide);
- States[DockState.DockBottomAutoHide].Selected = (dockState == DockState.DockBottomAutoHide);
- States[DockState.DockLeftAutoHide].Selected = (dockState == DockState.DockLeftAutoHide);
- States[DockState.DockRightAutoHide].Selected = (dockState == DockState.DockRightAutoHide);
- }
-
- private DockPanel m_dockPanel;
- public DockPanel DockPanel
- {
- get { return m_dockPanel; }
- }
-
- private AutoHideStateCollection m_states;
- private AutoHideStateCollection States
- {
- get { return m_states; }
- }
-
- public int Count
- {
- get
- {
- int count = 0;
- foreach (DockPane pane in DockPanel.Panes)
- {
- if (States.ContainsPane(pane))
- count++;
- }
-
- return count;
- }
- }
-
- public Pane this[int index]
- {
- get
- {
- int count = 0;
- foreach (DockPane pane in DockPanel.Panes)
- {
- if (!States.ContainsPane(pane))
- continue;
-
- if (count == index)
- {
- if (pane.AutoHidePane == null)
- pane.AutoHidePane = DockPanel.AutoHideStripControl.CreatePane(pane);
- return pane.AutoHidePane as Pane;
- }
-
- count++;
- }
- throw new ArgumentOutOfRangeException("index");
- }
- }
-
- public bool Contains(Pane pane)
- {
- return (IndexOf(pane) != -1);
- }
-
- public int IndexOf(Pane pane)
- {
- if (pane == null)
- return -1;
-
- int index = 0;
- foreach (DockPane dockPane in DockPanel.Panes)
- {
- if (!States.ContainsPane(pane.DockPane))
- continue;
-
- if (pane == dockPane.AutoHidePane)
- return index;
-
- index++;
- }
- return -1;
- }
-
- #region IEnumerable Members
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (int i = 0; i < Count; i++)
- yield return this[i];
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (int i = 0; i < Count; i++)
- yield return this[i];
- }
-
- #endregion
- }
-
- protected AutoHideStripBase(DockPanel panel)
- {
- m_dockPanel = panel;
- m_panesTop = new PaneCollection(panel, DockState.DockTopAutoHide);
- m_panesBottom = new PaneCollection(panel, DockState.DockBottomAutoHide);
- m_panesLeft = new PaneCollection(panel, DockState.DockLeftAutoHide);
- m_panesRight = new PaneCollection(panel, DockState.DockRightAutoHide);
-
- SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
- SetStyle(ControlStyles.Selectable, false);
- }
-
- private DockPanel m_dockPanel;
- protected DockPanel DockPanel
- {
- get { return m_dockPanel; }
- }
-
- private PaneCollection m_panesTop;
- protected PaneCollection PanesTop
- {
- get { return m_panesTop; }
- }
-
- private PaneCollection m_panesBottom;
- protected PaneCollection PanesBottom
- {
- get { return m_panesBottom; }
- }
-
- private PaneCollection m_panesLeft;
- protected PaneCollection PanesLeft
- {
- get { return m_panesLeft; }
- }
-
- private PaneCollection m_panesRight;
- protected PaneCollection PanesRight
- {
- get { return m_panesRight; }
- }
-
- protected PaneCollection GetPanes(DockState dockState)
- {
- if (dockState == DockState.DockTopAutoHide)
- return PanesTop;
- else if (dockState == DockState.DockBottomAutoHide)
- return PanesBottom;
- else if (dockState == DockState.DockLeftAutoHide)
- return PanesLeft;
- else if (dockState == DockState.DockRightAutoHide)
- return PanesRight;
- else
- throw new ArgumentOutOfRangeException("dockState");
- }
-
- internal int GetNumberOfPanes(DockState dockState)
- {
- return GetPanes(dockState).Count;
- }
-
- protected Rectangle RectangleTopLeft
- {
- get
- {
- int height = MeasureHeight();
- return PanesTop.Count > 0 && PanesLeft.Count > 0 ? new Rectangle(0, 0, height, height) : Rectangle.Empty;
- }
- }
-
- protected Rectangle RectangleTopRight
- {
- get
- {
- int height = MeasureHeight();
- return PanesTop.Count > 0 && PanesRight.Count > 0 ? new Rectangle(Width - height, 0, height, height) : Rectangle.Empty;
- }
- }
-
- protected Rectangle RectangleBottomLeft
- {
- get
- {
- int height = MeasureHeight();
- return PanesBottom.Count > 0 && PanesLeft.Count > 0 ? new Rectangle(0, Height - height, height, height) : Rectangle.Empty;
- }
- }
-
- protected Rectangle RectangleBottomRight
- {
- get
- {
- int height = MeasureHeight();
- return PanesBottom.Count > 0 && PanesRight.Count > 0 ? new Rectangle(Width - height, Height - height, height, height) : Rectangle.Empty;
- }
- }
-
- protected internal Rectangle GetTabStripRectangle(DockState dockState)
- {
- int height = MeasureHeight();
- if (dockState == DockState.DockTopAutoHide && PanesTop.Count > 0)
- return new Rectangle(RectangleTopLeft.Width, 0, Width - RectangleTopLeft.Width - RectangleTopRight.Width, height);
- else if (dockState == DockState.DockBottomAutoHide && PanesBottom.Count > 0)
- return new Rectangle(RectangleBottomLeft.Width, Height - height, Width - RectangleBottomLeft.Width - RectangleBottomRight.Width, height);
- else if (dockState == DockState.DockLeftAutoHide && PanesLeft.Count > 0)
- return new Rectangle(0, RectangleTopLeft.Width, height, Height - RectangleTopLeft.Height - RectangleBottomLeft.Height);
- else if (dockState == DockState.DockRightAutoHide && PanesRight.Count > 0)
- return new Rectangle(Width - height, RectangleTopRight.Width, height, Height - RectangleTopRight.Height - RectangleBottomRight.Height);
- else
- return Rectangle.Empty;
- }
-
- private GraphicsPath m_displayingArea = null;
- private GraphicsPath DisplayingArea
- {
- get
- {
- if (m_displayingArea == null)
- m_displayingArea = new GraphicsPath();
-
- return m_displayingArea;
- }
- }
-
- private void SetRegion()
- {
- DisplayingArea.Reset();
- DisplayingArea.AddRectangle(RectangleTopLeft);
- DisplayingArea.AddRectangle(RectangleTopRight);
- DisplayingArea.AddRectangle(RectangleBottomLeft);
- DisplayingArea.AddRectangle(RectangleBottomRight);
- DisplayingArea.AddRectangle(GetTabStripRectangle(DockState.DockTopAutoHide));
- DisplayingArea.AddRectangle(GetTabStripRectangle(DockState.DockBottomAutoHide));
- DisplayingArea.AddRectangle(GetTabStripRectangle(DockState.DockLeftAutoHide));
- DisplayingArea.AddRectangle(GetTabStripRectangle(DockState.DockRightAutoHide));
- Region = new Region(DisplayingArea);
- }
-
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
-
- if (e.Button != MouseButtons.Left)
- return;
-
- IDockContent content = HitTest();
- if (content == null)
- return;
-
- content.DockHandler.Activate();
- }
-
- protected override void OnMouseHover(EventArgs e)
- {
- base.OnMouseHover(e);
-
- IDockContent content = HitTest();
- if (content != null && DockPanel.ActiveAutoHideContent != content)
- DockPanel.ActiveAutoHideContent = content;
-
- // requires further tracking of mouse hover behavior,
- ResetMouseEventArgs();
- }
-
- protected override void OnLayout(LayoutEventArgs levent)
- {
- RefreshChanges();
- base.OnLayout (levent);
- }
-
- internal void RefreshChanges()
- {
- if (IsDisposed)
- return;
-
- SetRegion();
- OnRefreshChanges();
- }
-
- protected virtual void OnRefreshChanges()
- {
- }
-
- protected internal abstract int MeasureHeight();
-
- private IDockContent HitTest()
- {
- Point ptMouse = PointToClient(Control.MousePosition);
- return HitTest(ptMouse);
- }
-
- protected virtual Tab CreateTab(IDockContent content)
- {
- return new Tab(content);
- }
-
- protected virtual Pane CreatePane(DockPane dockPane)
- {
- return new Pane(dockPane);
- }
-
- protected abstract IDockContent HitTest(Point point);
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockAreasEditor.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockAreasEditor.cs
deleted file mode 100644
index 5ec674461a..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockAreasEditor.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.Drawing;
-using System.Drawing.Design;
-using System.Windows.Forms;
-using System.Windows.Forms.Design;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal class DockAreasEditor : UITypeEditor
- {
- private class DockAreasEditorControl : System.Windows.Forms.UserControl
- {
- private CheckBox checkBoxFloat;
- private CheckBox checkBoxDockLeft;
- private CheckBox checkBoxDockRight;
- private CheckBox checkBoxDockTop;
- private CheckBox checkBoxDockBottom;
- private CheckBox checkBoxDockFill;
- private DockAreas m_oldDockAreas;
-
- public DockAreas DockAreas
- {
- get
- {
- DockAreas dockAreas = 0;
- if (checkBoxFloat.Checked)
- dockAreas |= DockAreas.Float;
- if (checkBoxDockLeft.Checked)
- dockAreas |= DockAreas.DockLeft;
- if (checkBoxDockRight.Checked)
- dockAreas |= DockAreas.DockRight;
- if (checkBoxDockTop.Checked)
- dockAreas |= DockAreas.DockTop;
- if (checkBoxDockBottom.Checked)
- dockAreas |= DockAreas.DockBottom;
- if (checkBoxDockFill.Checked)
- dockAreas |= DockAreas.Document;
-
- if (dockAreas == 0)
- return m_oldDockAreas;
- else
- return dockAreas;
- }
- }
-
- public DockAreasEditorControl()
- {
- checkBoxFloat = new CheckBox();
- checkBoxDockLeft = new CheckBox();
- checkBoxDockRight = new CheckBox();
- checkBoxDockTop = new CheckBox();
- checkBoxDockBottom = new CheckBox();
- checkBoxDockFill = new CheckBox();
-
- SuspendLayout();
-
- checkBoxFloat.Appearance = Appearance.Button;
- checkBoxFloat.Dock = DockStyle.Top;
- checkBoxFloat.Height = 24;
- checkBoxFloat.Text = Strings.DockAreaEditor_FloatCheckBoxText;
- checkBoxFloat.TextAlign = ContentAlignment.MiddleCenter;
- checkBoxFloat.FlatStyle = FlatStyle.System;
-
- checkBoxDockLeft.Appearance = System.Windows.Forms.Appearance.Button;
- checkBoxDockLeft.Dock = System.Windows.Forms.DockStyle.Left;
- checkBoxDockLeft.Width = 24;
- checkBoxDockLeft.FlatStyle = FlatStyle.System;
-
- checkBoxDockRight.Appearance = System.Windows.Forms.Appearance.Button;
- checkBoxDockRight.Dock = System.Windows.Forms.DockStyle.Right;
- checkBoxDockRight.Width = 24;
- checkBoxDockRight.FlatStyle = FlatStyle.System;
-
- checkBoxDockTop.Appearance = System.Windows.Forms.Appearance.Button;
- checkBoxDockTop.Dock = System.Windows.Forms.DockStyle.Top;
- checkBoxDockTop.Height = 24;
- checkBoxDockTop.FlatStyle = FlatStyle.System;
-
- checkBoxDockBottom.Appearance = System.Windows.Forms.Appearance.Button;
- checkBoxDockBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
- checkBoxDockBottom.Height = 24;
- checkBoxDockBottom.FlatStyle = FlatStyle.System;
-
- checkBoxDockFill.Appearance = System.Windows.Forms.Appearance.Button;
- checkBoxDockFill.Dock = System.Windows.Forms.DockStyle.Fill;
- checkBoxDockFill.FlatStyle = FlatStyle.System;
-
- this.Controls.AddRange(new Control[] {
- checkBoxDockFill,
- checkBoxDockBottom,
- checkBoxDockTop,
- checkBoxDockRight,
- checkBoxDockLeft,
- checkBoxFloat});
-
- Size = new System.Drawing.Size(160, 144);
- BackColor = SystemColors.Control;
- ResumeLayout();
- }
-
- public void SetStates(DockAreas dockAreas)
- {
- m_oldDockAreas = dockAreas;
- if ((dockAreas & DockAreas.DockLeft) != 0)
- checkBoxDockLeft.Checked = true;
- if ((dockAreas & DockAreas.DockRight) != 0)
- checkBoxDockRight.Checked = true;
- if ((dockAreas & DockAreas.DockTop) != 0)
- checkBoxDockTop.Checked = true;
- if ((dockAreas & DockAreas.DockTop) != 0)
- checkBoxDockTop.Checked = true;
- if ((dockAreas & DockAreas.DockBottom) != 0)
- checkBoxDockBottom.Checked = true;
- if ((dockAreas & DockAreas.Document) != 0)
- checkBoxDockFill.Checked = true;
- if ((dockAreas & DockAreas.Float) != 0)
- checkBoxFloat.Checked = true;
- }
- }
-
- private DockAreasEditor.DockAreasEditorControl m_ui = null;
-
- public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
- {
- return UITypeEditorEditStyle.DropDown;
- }
-
- public override object EditValue(ITypeDescriptorContext context, IServiceProvider sp, object value)
- {
- if (m_ui == null)
- m_ui = new DockAreasEditor.DockAreasEditorControl();
-
- m_ui.SetStates((DockAreas)value);
-
- IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)sp.GetService(typeof(IWindowsFormsEditorService));
- edSvc.DropDownControl(m_ui);
-
- return m_ui.DockAreas;
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContent.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContent.cs
deleted file mode 100644
index 4ea43a176e..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContent.cs
+++ /dev/null
@@ -1,273 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.Drawing;
-using System.Windows.Forms;
-using System.Runtime.InteropServices;
-using System.Diagnostics.CodeAnalysis;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public class DockContent : Form, IDockContent
- {
- public DockContent()
- {
- m_dockHandler = new DockContentHandler(this, new GetPersistStringCallback(GetPersistString));
- m_dockHandler.DockStateChanged += new EventHandler(DockHandler_DockStateChanged);
- }
-
- private DockContentHandler m_dockHandler = null;
- [Browsable(false)]
- public DockContentHandler DockHandler
- {
- get { return m_dockHandler; }
- }
-
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockContent_AllowEndUserDocking_Description")]
- [DefaultValue(true)]
- public bool AllowEndUserDocking
- {
- get { return DockHandler.AllowEndUserDocking; }
- set { DockHandler.AllowEndUserDocking = value; }
- }
-
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockContent_DockAreas_Description")]
- [DefaultValue(DockAreas.DockLeft|DockAreas.DockRight|DockAreas.DockTop|DockAreas.DockBottom|DockAreas.Document|DockAreas.Float)]
- public DockAreas DockAreas
- {
- get { return DockHandler.DockAreas; }
- set { DockHandler.DockAreas = value; }
- }
-
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockContent_AutoHidePortion_Description")]
- [DefaultValue(0.25)]
- public double AutoHidePortion
- {
- get { return DockHandler.AutoHidePortion; }
- set { DockHandler.AutoHidePortion = value; }
- }
-
- [Localizable(true)]
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockContent_TabText_Description")]
- [DefaultValue(null)]
- public string TabText
- {
- get { return DockHandler.TabText; }
- set { DockHandler.TabText = value; }
- }
- private bool ShouldSerializeTabText()
- {
- return (DockHandler.TabText != null);
- }
-
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockContent_CloseButton_Description")]
- [DefaultValue(true)]
- public bool CloseButton
- {
- get { return DockHandler.CloseButton; }
- set { DockHandler.CloseButton = value; }
- }
-
- [Browsable(false)]
- public DockPanel DockPanel
- {
- get { return DockHandler.DockPanel; }
- set { DockHandler.DockPanel = value; }
- }
-
- [Browsable(false)]
- public DockState DockState
- {
- get { return DockHandler.DockState; }
- set { DockHandler.DockState = value; }
- }
-
- [Browsable(false)]
- public DockPane Pane
- {
- get { return DockHandler.Pane; }
- set { DockHandler.Pane = value; }
- }
-
- [Browsable(false)]
- public bool IsHidden
- {
- get { return DockHandler.IsHidden; }
- set { DockHandler.IsHidden = value; }
- }
-
- [Browsable(false)]
- public DockState VisibleState
- {
- get { return DockHandler.VisibleState; }
- set { DockHandler.VisibleState = value; }
- }
-
- [Browsable(false)]
- public bool IsFloat
- {
- get { return DockHandler.IsFloat; }
- set { DockHandler.IsFloat = value; }
- }
-
- [Browsable(false)]
- public DockPane PanelPane
- {
- get { return DockHandler.PanelPane; }
- set { DockHandler.PanelPane = value; }
- }
-
- [Browsable(false)]
- public DockPane FloatPane
- {
- get { return DockHandler.FloatPane; }
- set { DockHandler.FloatPane = value; }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
- protected virtual string GetPersistString()
- {
- return GetType().ToString();
- }
-
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockContent_HideOnClose_Description")]
- [DefaultValue(false)]
- public bool HideOnClose
- {
- get { return DockHandler.HideOnClose; }
- set { DockHandler.HideOnClose = value; }
- }
-
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockContent_ShowHint_Description")]
- [DefaultValue(DockState.Unknown)]
- public DockState ShowHint
- {
- get { return DockHandler.ShowHint; }
- set { DockHandler.ShowHint = value; }
- }
-
- [Browsable(false)]
- public bool IsActivated
- {
- get { return DockHandler.IsActivated; }
- }
-
- public bool IsDockStateValid(DockState dockState)
- {
- return DockHandler.IsDockStateValid(dockState);
- }
-
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockContent_TabPageContextMenu_Description")]
- [DefaultValue(null)]
- public ContextMenu TabPageContextMenu
- {
- get { return DockHandler.TabPageContextMenu; }
- set { DockHandler.TabPageContextMenu = value; }
- }
-
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockContent_TabPageContextMenuStrip_Description")]
- [DefaultValue(null)]
- public ContextMenuStrip TabPageContextMenuStrip
- {
- get { return DockHandler.TabPageContextMenuStrip; }
- set { DockHandler.TabPageContextMenuStrip = value; }
- }
-
- [Localizable(true)]
- [Category("Appearance")]
- [LocalizedDescription("DockContent_ToolTipText_Description")]
- [DefaultValue(null)]
- public string ToolTipText
- {
- get { return DockHandler.ToolTipText; }
- set { DockHandler.ToolTipText = value; }
- }
-
- public new void Activate()
- {
- DockHandler.Activate();
- }
-
- public new void Hide()
- {
- DockHandler.Hide();
- }
-
- public new void Show()
- {
- DockHandler.Show();
- }
-
- public void Show(DockPanel dockPanel)
- {
- DockHandler.Show(dockPanel);
- }
-
- public void Show(DockPanel dockPanel, DockState dockState)
- {
- DockHandler.Show(dockPanel, dockState);
- }
-
- [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")]
- public void Show(DockPanel dockPanel, Rectangle floatWindowBounds)
- {
- DockHandler.Show(dockPanel, floatWindowBounds);
- }
-
- public void Show(DockPane pane, IDockContent beforeContent)
- {
- DockHandler.Show(pane, beforeContent);
- }
-
- public void Show(DockPane previousPane, DockAlignment alignment, double proportion)
- {
- DockHandler.Show(previousPane, alignment, proportion);
- }
-
- [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")]
- public void FloatAt(Rectangle floatWindowBounds)
- {
- DockHandler.FloatAt(floatWindowBounds);
- }
-
- public void DockTo(DockPane paneTo, DockStyle dockStyle, int contentIndex)
- {
- DockHandler.DockTo(paneTo, dockStyle, contentIndex);
- }
-
- public void DockTo(DockPanel panel, DockStyle dockStyle)
- {
- DockHandler.DockTo(panel, dockStyle);
- }
-
- #region Events
- private void DockHandler_DockStateChanged(object sender, EventArgs e)
- {
- OnDockStateChanged(e);
- }
-
- private static readonly object DockStateChangedEvent = new object();
- [LocalizedCategory("Category_PropertyChanged")]
- [LocalizedDescription("Pane_DockStateChanged_Description")]
- public event EventHandler DockStateChanged
- {
- add { Events.AddHandler(DockStateChangedEvent, value); }
- remove { Events.RemoveHandler(DockStateChangedEvent, value); }
- }
- protected virtual void OnDockStateChanged(EventArgs e)
- {
- EventHandler handler = (EventHandler)Events[DockStateChangedEvent];
- if (handler != null)
- handler(this, e);
- }
- #endregion
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentCollection.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentCollection.cs
deleted file mode 100644
index 141615f477..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentCollection.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public class DockContentCollection : ReadOnlyCollection
- {
- private static List _emptyList = new List(0);
-
- internal DockContentCollection()
- : base(new List())
- {
- }
-
- internal DockContentCollection(DockPane pane)
- : base(_emptyList)
- {
- m_dockPane = pane;
- }
-
- private DockPane m_dockPane = null;
- private DockPane DockPane
- {
- get { return m_dockPane; }
- }
-
- public new IDockContent this[int index]
- {
- get
- {
- if (DockPane == null)
- return Items[index] as IDockContent;
- else
- return GetVisibleContent(index);
- }
- }
-
- internal int Add(IDockContent content)
- {
-#if DEBUG
- if (DockPane != null)
- throw new InvalidOperationException();
-#endif
-
- if (Contains(content))
- return IndexOf(content);
-
- Items.Add(content);
- return Count - 1;
- }
-
- internal void AddAt(IDockContent content, int index)
- {
-#if DEBUG
- if (DockPane != null)
- throw new InvalidOperationException();
-#endif
-
- if (index < 0 || index > Items.Count - 1)
- return;
-
- if (Contains(content))
- return;
-
- Items.Insert(index, content);
- }
-
- public new bool Contains(IDockContent content)
- {
- if (DockPane == null)
- return Items.Contains(content);
- else
- return (GetIndexOfVisibleContents(content) != -1);
- }
-
- public new int Count
- {
- get
- {
- if (DockPane == null)
- return base.Count;
- else
- return CountOfVisibleContents;
- }
- }
-
- public new int IndexOf(IDockContent content)
- {
- if (DockPane == null)
- {
- if (!Contains(content))
- return -1;
- else
- return Items.IndexOf(content);
- }
- else
- return GetIndexOfVisibleContents(content);
- }
-
- internal void Remove(IDockContent content)
- {
- if (DockPane != null)
- throw new InvalidOperationException();
-
- if (!Contains(content))
- return;
-
- Items.Remove(content);
- }
-
- private int CountOfVisibleContents
- {
- get
- {
-#if DEBUG
- if (DockPane == null)
- throw new InvalidOperationException();
-#endif
-
- int count = 0;
- foreach (IDockContent content in DockPane.Contents)
- {
- if (content.DockHandler.DockState == DockPane.DockState)
- count++;
- }
- return count;
- }
- }
-
- private IDockContent GetVisibleContent(int index)
- {
-#if DEBUG
- if (DockPane == null)
- throw new InvalidOperationException();
-#endif
-
- int currentIndex = -1;
- foreach (IDockContent content in DockPane.Contents)
- {
- if (content.DockHandler.DockState == DockPane.DockState)
- currentIndex++;
-
- if (currentIndex == index)
- return content;
- }
- throw (new ArgumentOutOfRangeException());
- }
-
- private int GetIndexOfVisibleContents(IDockContent content)
- {
-#if DEBUG
- if (DockPane == null)
- throw new InvalidOperationException();
-#endif
-
- if (content == null)
- return -1;
-
- int index = -1;
- foreach (IDockContent c in DockPane.Contents)
- {
- if (c.DockHandler.DockState == DockPane.DockState)
- {
- index++;
-
- if (c == content)
- return index;
- }
- }
- return -1;
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentEventArgs.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentEventArgs.cs
deleted file mode 100644
index 49d9caff4a..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentEventArgs.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public class DockContentEventArgs : EventArgs
- {
- private IDockContent m_content;
-
- public DockContentEventArgs(IDockContent content)
- {
- m_content = content;
- }
-
- public IDockContent Content
- {
- get { return m_content; }
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentHandler.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentHandler.cs
deleted file mode 100644
index 1599837e17..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockContentHandler.cs
+++ /dev/null
@@ -1,1069 +0,0 @@
-using System;
-using System.Windows.Forms;
-using System.Drawing;
-using System.ComponentModel;
-using System.Diagnostics.CodeAnalysis;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public delegate string GetPersistStringCallback();
-
- public class DockContentHandler : IDisposable, IDockDragSource
- {
- public DockContentHandler(Form form) : this(form, null)
- {
- }
-
- public DockContentHandler(Form form, GetPersistStringCallback getPersistStringCallback)
- {
- if (!(form is IDockContent))
- throw new ArgumentException(Strings.DockContent_Constructor_InvalidForm, "form");
-
- m_form = form;
- m_getPersistStringCallback = getPersistStringCallback;
-
- m_events = new EventHandlerList();
- Form.Disposed +=new EventHandler(Form_Disposed);
- Form.TextChanged += new EventHandler(Form_TextChanged);
- }
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- protected virtual void Dispose(bool disposing)
- {
- if(disposing)
- {
- lock(this)
- {
- DockPanel = null;
- if (m_autoHideTab != null)
- m_autoHideTab.Dispose();
- if (m_tab != null)
- m_tab.Dispose();
-
- Form.Disposed -= new EventHandler(Form_Disposed);
- Form.TextChanged -= new EventHandler(Form_TextChanged);
- m_events.Dispose();
- }
- }
- }
-
- private Form m_form;
- public Form Form
- {
- get { return m_form; }
- }
-
- public IDockContent Content
- {
- get { return Form as IDockContent; }
- }
-
- private IDockContent m_previousActive = null;
- public IDockContent PreviousActive
- {
- get { return m_previousActive; }
- internal set { m_previousActive = value; }
- }
-
- private IDockContent m_nextActive = null;
- public IDockContent NextActive
- {
- get { return m_nextActive; }
- internal set { m_nextActive = value; }
- }
-
- private EventHandlerList m_events;
- private EventHandlerList Events
- {
- get { return m_events; }
- }
-
- private bool m_allowEndUserDocking = true;
- public bool AllowEndUserDocking
- {
- get { return m_allowEndUserDocking; }
- set { m_allowEndUserDocking = value; }
- }
-
- private double m_autoHidePortion = 0.25;
- public double AutoHidePortion
- {
- get { return m_autoHidePortion; }
- set
- {
- if (value <= 0)
- throw(new ArgumentOutOfRangeException(Strings.DockContentHandler_AutoHidePortion_OutOfRange));
-
- if (m_autoHidePortion == value)
- return;
-
- m_autoHidePortion = value;
-
- if (DockPanel == null)
- return;
-
- if (DockPanel.ActiveAutoHideContent == Content)
- DockPanel.PerformLayout();
- }
- }
-
- private bool m_closeButton = true;
- public bool CloseButton
- {
- get { return m_closeButton; }
- set
- {
- if (m_closeButton == value)
- return;
-
- m_closeButton = value;
- if (Pane != null)
- if (Pane.ActiveContent.DockHandler == this)
- Pane.RefreshChanges();
- }
- }
-
- private DockState DefaultDockState
- {
- get
- {
- if (ShowHint != DockState.Unknown && ShowHint != DockState.Hidden)
- return ShowHint;
-
- if ((DockAreas & DockAreas.Document) != 0)
- return DockState.Document;
- if ((DockAreas & DockAreas.DockRight) != 0)
- return DockState.DockRight;
- if ((DockAreas & DockAreas.DockLeft) != 0)
- return DockState.DockLeft;
- if ((DockAreas & DockAreas.DockBottom) != 0)
- return DockState.DockBottom;
- if ((DockAreas & DockAreas.DockTop) != 0)
- return DockState.DockTop;
-
- return DockState.Unknown;
- }
- }
-
- private DockState DefaultShowState
- {
- get
- {
- if (ShowHint != DockState.Unknown)
- return ShowHint;
-
- if ((DockAreas & DockAreas.Document) != 0)
- return DockState.Document;
- if ((DockAreas & DockAreas.DockRight) != 0)
- return DockState.DockRight;
- if ((DockAreas & DockAreas.DockLeft) != 0)
- return DockState.DockLeft;
- if ((DockAreas & DockAreas.DockBottom) != 0)
- return DockState.DockBottom;
- if ((DockAreas & DockAreas.DockTop) != 0)
- return DockState.DockTop;
- if ((DockAreas & DockAreas.Float) != 0)
- return DockState.Float;
-
- return DockState.Unknown;
- }
- }
-
- private DockAreas m_allowedAreas = DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop | DockAreas.DockBottom | DockAreas.Document | DockAreas.Float;
- public DockAreas DockAreas
- {
- get { return m_allowedAreas; }
- set
- {
- if (m_allowedAreas == value)
- return;
-
- if (!DockHelper.IsDockStateValid(DockState, value))
- throw(new InvalidOperationException(Strings.DockContentHandler_DockAreas_InvalidValue));
-
- m_allowedAreas = value;
-
- if (!DockHelper.IsDockStateValid(ShowHint, m_allowedAreas))
- ShowHint = DockState.Unknown;
- }
- }
-
- private DockState m_dockState = DockState.Unknown;
- public DockState DockState
- {
- get { return m_dockState; }
- set
- {
- if (m_dockState == value)
- return;
-
- DockPanel.SuspendLayout(true);
-
- if (value == DockState.Hidden)
- IsHidden = true;
- else
- SetDockState(false, value, Pane);
-
- DockPanel.ResumeLayout(true, true);
- }
- }
-
- private DockPanel m_dockPanel = null;
- public DockPanel DockPanel
- {
- get { return m_dockPanel; }
- set
- {
- if (m_dockPanel == value)
- return;
-
- Pane = null;
-
- if (m_dockPanel != null)
- m_dockPanel.RemoveContent(Content);
-
- if (m_tab != null)
- {
- m_tab.Dispose();
- m_tab = null;
- }
-
- if (m_autoHideTab != null)
- {
- m_autoHideTab.Dispose();
- m_autoHideTab = null;
- }
-
- m_dockPanel = value;
-
- if (m_dockPanel != null)
- {
- m_dockPanel.AddContent(Content);
- Form.TopLevel = false;
- Form.FormBorderStyle = FormBorderStyle.None;
- Form.ShowInTaskbar = false;
- Form.WindowState = FormWindowState.Normal;
- NativeMethods.SetWindowPos(Form.Handle, IntPtr.Zero, 0, 0, 0, 0,
- Win32.FlagsSetWindowPos.SWP_NOACTIVATE |
- Win32.FlagsSetWindowPos.SWP_NOMOVE |
- Win32.FlagsSetWindowPos.SWP_NOSIZE |
- Win32.FlagsSetWindowPos.SWP_NOZORDER |
- Win32.FlagsSetWindowPos.SWP_NOOWNERZORDER |
- Win32.FlagsSetWindowPos.SWP_FRAMECHANGED);
- }
- }
- }
-
- public Icon Icon
- {
- get { return Form.Icon; }
- }
-
- public DockPane Pane
- {
- get { return IsFloat ? FloatPane : PanelPane; }
- set
- {
- if (Pane == value)
- return;
-
- DockPanel.SuspendLayout(true);
-
- DockPane oldPane = Pane;
-
- SuspendSetDockState();
- FloatPane = (value == null ? null : (value.IsFloat ? value : FloatPane));
- PanelPane = (value == null ? null : (value.IsFloat ? PanelPane : value));
- ResumeSetDockState(IsHidden, value != null ? value.DockState : DockState.Unknown, oldPane);
-
- DockPanel.ResumeLayout(true, true);
- }
- }
-
- private bool m_isHidden = true;
- public bool IsHidden
- {
- get { return m_isHidden; }
- set
- {
- if (m_isHidden == value)
- return;
-
- SetDockState(value, VisibleState, Pane);
- }
- }
-
- private string m_tabText = null;
- public string TabText
- {
- get { return m_tabText==null ? Form.Text : m_tabText; }
- set
- {
- if (m_tabText == value)
- return;
-
- m_tabText = value;
- if (Pane != null)
- Pane.RefreshChanges();
- }
- }
-
- private DockState m_visibleState = DockState.Unknown;
- public DockState VisibleState
- {
- get { return m_visibleState; }
- set
- {
- if (m_visibleState == value)
- return;
-
- SetDockState(IsHidden, value, Pane);
- }
- }
-
- private bool m_isFloat = false;
- public bool IsFloat
- {
- get { return m_isFloat; }
- set
- {
- if (m_isFloat == value)
- return;
-
- DockState visibleState = CheckDockState(value);
-
- if (visibleState == DockState.Unknown)
- throw new InvalidOperationException(Strings.DockContentHandler_IsFloat_InvalidValue);
-
- SetDockState(IsHidden, visibleState, Pane);
- }
- }
-
- [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")]
- public DockState CheckDockState(bool isFloat)
- {
- DockState dockState;
-
- if (isFloat)
- {
- if (!IsDockStateValid(DockState.Float))
- dockState = DockState.Unknown;
- else
- dockState = DockState.Float;
- }
- else
- {
- dockState = (PanelPane != null) ? PanelPane.DockState : DefaultDockState;
- if (dockState != DockState.Unknown && !IsDockStateValid(dockState))
- dockState = DockState.Unknown;
- }
-
- return dockState;
- }
-
- private DockPane m_panelPane = null;
- public DockPane PanelPane
- {
- get { return m_panelPane; }
- set
- {
- if (m_panelPane == value)
- return;
-
- if (value != null)
- {
- if (value.IsFloat || value.DockPanel != DockPanel)
- throw new InvalidOperationException(Strings.DockContentHandler_DockPane_InvalidValue);
- }
-
- DockPane oldPane = Pane;
-
- if (m_panelPane != null)
- RemoveFromPane(m_panelPane);
- m_panelPane = value;
- if (m_panelPane != null)
- {
- m_panelPane.AddContent(Content);
- SetDockState(IsHidden, IsFloat ? DockState.Float : m_panelPane.DockState, oldPane);
- }
- else
- SetDockState(IsHidden, DockState.Unknown, oldPane);
- }
- }
-
- private void RemoveFromPane(DockPane pane)
- {
- pane.RemoveContent(Content);
- SetPane(null);
- if (pane.Contents.Count == 0)
- pane.Dispose();
- }
-
- private DockPane m_floatPane = null;
- public DockPane FloatPane
- {
- get { return m_floatPane; }
- set
- {
- if (m_floatPane == value)
- return;
-
- if (value != null)
- {
- if (!value.IsFloat || value.DockPanel != DockPanel)
- throw new InvalidOperationException(Strings.DockContentHandler_FloatPane_InvalidValue);
- }
-
- DockPane oldPane = Pane;
-
- if (m_floatPane != null)
- RemoveFromPane(m_floatPane);
- m_floatPane = value;
- if (m_floatPane != null)
- {
- m_floatPane.AddContent(Content);
- SetDockState(IsHidden, IsFloat ? DockState.Float : VisibleState, oldPane);
- }
- else
- SetDockState(IsHidden, DockState.Unknown, oldPane);
- }
- }
-
- private int m_countSetDockState = 0;
- private void SuspendSetDockState()
- {
- m_countSetDockState ++;
- }
-
- private void ResumeSetDockState()
- {
- m_countSetDockState --;
- if (m_countSetDockState < 0)
- m_countSetDockState = 0;
- }
-
- internal bool IsSuspendSetDockState
- {
- get { return m_countSetDockState != 0; }
- }
-
- private void ResumeSetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
- {
- ResumeSetDockState();
- SetDockState(isHidden, visibleState, oldPane);
- }
-
- internal void SetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
- {
- if (IsSuspendSetDockState)
- return;
-
- if (DockPanel == null && visibleState != DockState.Unknown)
- throw new InvalidOperationException(Strings.DockContentHandler_SetDockState_NullPanel);
-
- if (visibleState == DockState.Hidden || (visibleState != DockState.Unknown && !IsDockStateValid(visibleState)))
- throw new InvalidOperationException(Strings.DockContentHandler_SetDockState_InvalidState);
-
- DockPanel dockPanel = DockPanel;
- if (dockPanel != null)
- dockPanel.SuspendLayout(true);
-
- SuspendSetDockState();
-
- DockState oldDockState = DockState;
-
- if (m_isHidden != isHidden || oldDockState == DockState.Unknown)
- {
- m_isHidden = isHidden;
- }
- m_visibleState = visibleState;
- m_dockState = isHidden ? DockState.Hidden : visibleState;
-
- if (visibleState == DockState.Unknown)
- Pane = null;
- else
- {
- m_isFloat = (m_visibleState == DockState.Float);
-
- if (Pane == null)
- Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
- else if (Pane.DockState != visibleState)
- {
- if (Pane.Contents.Count == 1)
- Pane.SetDockState(visibleState);
- else
- Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
- }
- }
-
- if (Form.ContainsFocus)
- if (DockState == DockState.Hidden || DockState == DockState.Unknown)
- DockPanel.ContentFocusManager.GiveUpFocus(Content);
-
- SetPaneAndVisible(Pane);
-
- if (oldPane != null && !oldPane.IsDisposed && oldDockState == oldPane.DockState)
- RefreshDockPane(oldPane);
-
- if (Pane != null && DockState == Pane.DockState)
- {
- if ((Pane != oldPane) ||
- (Pane == oldPane && oldDockState != oldPane.DockState))
- RefreshDockPane(Pane);
- }
-
- if (oldDockState != DockState)
- {
- if (DockState == DockState.Hidden || DockState == DockState.Unknown ||
- DockHelper.IsDockStateAutoHide(DockState))
- DockPanel.ContentFocusManager.RemoveFromList(Content);
- else
- DockPanel.ContentFocusManager.AddToList(Content);
-
- OnDockStateChanged(EventArgs.Empty);
- }
- ResumeSetDockState();
-
- if (dockPanel != null)
- dockPanel.ResumeLayout(true, true);
- }
-
- private static void RefreshDockPane(DockPane pane)
- {
- pane.RefreshChanges();
- pane.ValidateActiveContent();
- }
-
- internal string PersistString
- {
- get { return GetPersistStringCallback == null ? Form.GetType().ToString() : GetPersistStringCallback(); }
- }
-
- private GetPersistStringCallback m_getPersistStringCallback = null;
- public GetPersistStringCallback GetPersistStringCallback
- {
- get { return m_getPersistStringCallback; }
- set { m_getPersistStringCallback = value; }
- }
-
-
- private bool m_hideOnClose = false;
- public bool HideOnClose
- {
- get { return m_hideOnClose; }
- set { m_hideOnClose = value; }
- }
-
- private DockState m_showHint = DockState.Unknown;
- public DockState ShowHint
- {
- get { return m_showHint; }
- set
- {
- if (!DockHelper.IsDockStateValid(value, DockAreas))
- throw (new InvalidOperationException(Strings.DockContentHandler_ShowHint_InvalidValue));
-
- if (m_showHint == value)
- return;
-
- m_showHint = value;
- }
- }
-
- private bool m_isActivated = false;
- public bool IsActivated
- {
- get { return m_isActivated; }
- internal set
- {
- if (m_isActivated == value)
- return;
-
- m_isActivated = value;
- }
- }
-
- public bool IsDockStateValid(DockState dockState)
- {
- if (DockPanel != null && dockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- return false;
- else
- return DockHelper.IsDockStateValid(dockState, DockAreas);
- }
-
- private ContextMenu m_tabPageContextMenu = null;
- public ContextMenu TabPageContextMenu
- {
- get { return m_tabPageContextMenu; }
- set { m_tabPageContextMenu = value; }
- }
-
- private string m_toolTipText = null;
- public string ToolTipText
- {
- get { return m_toolTipText; }
- set { m_toolTipText = value; }
- }
-
- public void Activate()
- {
- if (DockPanel == null)
- Form.Activate();
- else if (Pane == null)
- Show(DockPanel);
- else
- {
- IsHidden = false;
- Pane.ActiveContent = Content;
- if (DockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyle.SystemMdi)
- {
- Form.Activate();
- return;
- }
- else if (DockHelper.IsDockStateAutoHide(DockState))
- DockPanel.ActiveAutoHideContent = Content;
-
- if (!Form.ContainsFocus)
- DockPanel.ContentFocusManager.Activate(Content);
- }
- }
-
- public void GiveUpFocus()
- {
- DockPanel.ContentFocusManager.GiveUpFocus(Content);
- }
-
- private IntPtr m_activeWindowHandle = IntPtr.Zero;
- internal IntPtr ActiveWindowHandle
- {
- get { return m_activeWindowHandle; }
- set { m_activeWindowHandle = value; }
- }
-
- public void Hide()
- {
- IsHidden = true;
- }
-
- internal void SetPaneAndVisible(DockPane pane)
- {
- SetPane(pane);
- SetVisible();
- }
-
- private void SetPane(DockPane pane)
- {
- if (pane != null && pane.DockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyle.DockingMdi)
- {
- if (Form.Parent is DockPane)
- SetParent(null);
- if (Form.MdiParent != DockPanel.ParentForm)
- {
- FlagClipWindow = true;
- Form.MdiParent = DockPanel.ParentForm;
- }
- }
- else
- {
- FlagClipWindow = true;
- if (Form.MdiParent != null)
- Form.MdiParent = null;
- if (Form.TopLevel)
- Form.TopLevel = false;
- SetParent(pane);
- }
- }
-
- internal void SetVisible()
- {
- bool visible;
-
- if (IsHidden)
- visible = false;
- else if (Pane != null && Pane.DockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyle.DockingMdi)
- visible = true;
- else if (Pane != null && Pane.ActiveContent == Content)
- visible = true;
- else if (Pane != null && Pane.ActiveContent != Content)
- visible = false;
- else
- visible = Form.Visible;
-
- // when Form.Parent.Visible==false, Form.Visible cannot be read correctly (but returns always false),
- // so we have to always assign the new visibility in those cases
- if (Form.Visible != visible || (Form.Parent != null && !Form.Parent.Visible))
- Form.Visible = visible;
- }
-
- private void SetParent(Control value)
- {
- if (Form.Parent == value)
- return;
-
- //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- // Workaround of .Net Framework bug:
- // Change the parent of a control with focus may result in the first
- // MDI child form get activated.
- //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-// bool bRestoreFocus = false;
-// if (Form.ContainsFocus)
-// {
-// if (value == null)
-// DockPanel.ContentFocusManager.GiveUpFocus(this.Content);
-// else
-// {
-// DockPanel.SaveFocus();
-// bRestoreFocus = true;
-// }
-// }
- //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
- Form.Parent = value;
-
- //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- // Workaround of .Net Framework bug:
- // Change the parent of a control with focus may result in the first
- // MDI child form get activated.
- //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-/* Workaround disabled: in SharpDevelop, the Activate() call causes an exception on layout changes
- iff no document is open and a pad has the focus.
- I don't think we need this workaround because we don't use MDI.
-
-System.InvalidOperationException: Invalid Content: ActiveContent must be one ofthe visible contents, or null if there is no visible content.
- at WeifenLuo.WinFormsUI.Docking.DockPane.set_ActiveContent(IDockContent value) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockPane.cs:line 162
- at WeifenLuo.WinFormsUI.Docking.DockContentHandler.Activate() in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockContentHandler.cs:line 618
- at WeifenLuo.WinFormsUI.Docking.DockContentHandler.SetParent(Control value) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockContentHandler.cs:line 728
- at WeifenLuo.WinFormsUI.Docking.DockContentHandler.SetPane(DockPane pane) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockContentHandler.cs:line 674
- at WeifenLuo.WinFormsUI.Docking.DockContentHandler.SetPaneAndVisible(DockPane pane) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockContentHandler.cs:line 651
- at WeifenLuo.WinFormsUI.Docking.DockContentHandler.SetDockState(Boolean isHidden, DockState visibleState, DockPane oldPane) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockContentHandler.cs:line 504
- at WeifenLuo.WinFormsUI.Docking.DockContentHandler.set_PanelPane(DockPane value) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockContentHandler.cs:line 388
- at WeifenLuo.WinFormsUI.Docking.DockPanel.Persistor.LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent, Boolean closeStream) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockPanel.Persistor.cs:line 614
- at WeifenLuo.WinFormsUI.Docking.DockPanel.Persistor.LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockPanel.Persistor.cs:line 378
- at WeifenLuo.WinFormsUI.Docking.DockPanel.LoadFromXml(Stream stream, DeserializeDockContent deserializeContent) in d:\SD\3.0\SharpDevelop\src\Libraries\DockPanel_Src\WinFormsUI\Docking\DockPanel.Persistor.cs:line 772
- at ICSharpCode.SharpDevelop.Gui.SdiWorkbenchLayout.LoadDockPanelLayout(String fileName) in d:\SD\3.0\SharpDevelop\src\Main\Base\Project\Src\Gui\Workbench\Layouts\SdiWorkspaceLayout.cs:line 213
- at ICSharpCode.SharpDevelop.Gui.SdiWorkbenchLayout.LoadLayoutConfiguration()in d:\SD\3.0\SharpDevelop\src\Main\Base\Project\Src\Gui\Workbench\Layouts\SdiWorkspaceLayout.cs:line 190
-
- if (bRestoreFocus)
- Activate();
- */
- //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- }
-
- public void Show()
- {
- if (DockPanel == null)
- Form.Show();
- else
- Show(DockPanel);
- }
-
- public void Show(DockPanel dockPanel)
- {
- if (dockPanel == null)
- throw(new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel));
-
- if (DockState == DockState.Unknown)
- Show(dockPanel, DefaultShowState);
- else if (Pane == null)
- Show(dockPanel, DockState == DockState.Hidden ? DefaultShowState : DockState);
- else
- Activate();
- }
-
- public void Show(DockPanel dockPanel, DockState dockState)
- {
- if (dockPanel == null)
- throw(new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel));
-
- if (dockState == DockState.Unknown || dockState == DockState.Hidden)
- throw(new ArgumentException(Strings.DockContentHandler_Show_InvalidDockState));
-
- dockPanel.SuspendLayout(true);
-
- DockPanel = dockPanel;
-
- if (dockState == DockState.Float && FloatPane == null)
- Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Float, true);
- else if (PanelPane == null)
- {
- DockPane paneExisting = null;
- foreach (DockPane pane in DockPanel.Panes)
- if (pane.DockState == dockState)
- {
- paneExisting = pane;
- break;
- }
-
- if (paneExisting == null)
- Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, dockState, true);
- else
- Pane = paneExisting;
- }
-
- DockState = dockState;
- Activate();
-
- dockPanel.ResumeLayout(true, true);
- }
-
- [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")]
- public void Show(DockPanel dockPanel, Rectangle floatWindowBounds)
- {
- if (dockPanel == null)
- throw(new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel));
-
- dockPanel.SuspendLayout(true);
-
- DockPanel = dockPanel;
- if (FloatPane == null)
- {
- IsHidden = true; // to reduce the screen flicker
- FloatPane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Float, false);
- FloatPane.FloatWindow.StartPosition = FormStartPosition.Manual;
- }
-
- FloatPane.FloatWindow.Bounds = floatWindowBounds;
-
- Show(dockPanel, DockState.Float);
- Activate();
-
- dockPanel.ResumeLayout(true, true);
- }
-
- public void Show(DockPane pane, IDockContent beforeContent)
- {
- if (pane == null)
- throw(new ArgumentNullException(Strings.DockContentHandler_Show_NullPane));
-
- if (beforeContent != null && pane.Contents.IndexOf(beforeContent) == -1)
- throw(new ArgumentException(Strings.DockContentHandler_Show_InvalidBeforeContent));
-
- pane.DockPanel.SuspendLayout(true);
-
- DockPanel = pane.DockPanel;
- Pane = pane;
- pane.SetContentIndex(Content, pane.Contents.IndexOf(beforeContent));
- Show();
-
- pane.DockPanel.ResumeLayout(true, true);
- }
-
- public void Show(DockPane previousPane, DockAlignment alignment, double proportion)
- {
- if (previousPane == null)
- throw(new ArgumentException(Strings.DockContentHandler_Show_InvalidPrevPane));
-
- if (DockHelper.IsDockStateAutoHide(previousPane.DockState))
- throw(new ArgumentException(Strings.DockContentHandler_Show_InvalidPrevPane));
-
- previousPane.DockPanel.SuspendLayout(true);
-
- DockPanel = previousPane.DockPanel;
- DockPanel.DockPaneFactory.CreateDockPane(Content, previousPane, alignment, proportion, true);
- Show();
-
- previousPane.DockPanel.ResumeLayout(true, true);
- }
-
- public void Close()
- {
- DockPanel dockPanel = DockPanel;
- if (dockPanel != null)
- dockPanel.SuspendLayout(true);
- Form.Close();
- if (dockPanel != null)
- dockPanel.ResumeLayout(true, true);
-
- }
-
- private DockPaneStripBase.Tab m_tab = null;
- internal DockPaneStripBase.Tab GetTab(DockPaneStripBase dockPaneStrip)
- {
- if (m_tab == null)
- m_tab = dockPaneStrip.CreateTab(Content);
-
- return m_tab;
- }
-
- private IDisposable m_autoHideTab = null;
- internal IDisposable AutoHideTab
- {
- get { return m_autoHideTab; }
- set { m_autoHideTab = value; }
- }
-
- #region Events
- private static readonly object DockStateChangedEvent = new object();
- public event EventHandler DockStateChanged
- {
- add { Events.AddHandler(DockStateChangedEvent, value); }
- remove { Events.RemoveHandler(DockStateChangedEvent, value); }
- }
- protected virtual void OnDockStateChanged(EventArgs e)
- {
- EventHandler handler = (EventHandler)Events[DockStateChangedEvent];
- if (handler != null)
- handler(this, e);
- }
- #endregion
-
- private void Form_Disposed(object sender, EventArgs e)
- {
- Dispose();
- }
-
- private void Form_TextChanged(object sender, EventArgs e)
- {
- if (DockHelper.IsDockStateAutoHide(DockState))
- DockPanel.RefreshAutoHideStrip();
- else if (Pane != null)
- {
- if (Pane.FloatWindow != null)
- Pane.FloatWindow.SetText();
- Pane.RefreshChanges();
- }
- }
-
- private bool m_flagClipWindow = false;
- internal bool FlagClipWindow
- {
- get { return m_flagClipWindow; }
- set
- {
- if (m_flagClipWindow == value)
- return;
-
- m_flagClipWindow = value;
- if (m_flagClipWindow)
- Form.Region = new Region(Rectangle.Empty);
- else
- Form.Region = null;
- }
- }
-
- private ContextMenuStrip m_tabPageContextMenuStrip = null;
- public ContextMenuStrip TabPageContextMenuStrip
- {
- get { return m_tabPageContextMenuStrip; }
- set { m_tabPageContextMenuStrip = value; }
- }
-
- #region IDockDragSource Members
-
- Control IDragSource.DragControl
- {
- get { return Form; }
- }
-
- bool IDockDragSource.CanDockTo(DockPane pane)
- {
- if (!IsDockStateValid(pane.DockState))
- return false;
-
- if (Pane == pane && pane.DisplayingContents.Count == 1)
- return false;
-
- return true;
- }
-
- Rectangle IDockDragSource.BeginDrag(Point ptMouse)
- {
- Size size;
- DockPane floatPane = this.FloatPane;
- if (DockState == DockState.Float || floatPane == null || floatPane.FloatWindow.NestedPanes.Count != 1)
- size = DockPanel.DefaultFloatWindowSize;
- else
- size = floatPane.FloatWindow.Size;
-
- Point location;
- Rectangle rectPane = Pane.ClientRectangle;
- if (DockState == DockState.Document)
- location = new Point(rectPane.Left, rectPane.Top);
- else
- {
- location = new Point(rectPane.Left, rectPane.Bottom);
- location.Y -= size.Height;
- }
- location = Pane.PointToScreen(location);
-
- if (ptMouse.X > location.X + size.Width)
- location.X += ptMouse.X - (location.X + size.Width) + Measures.SplitterSize;
-
- return new Rectangle(location, size);
- }
-
- public void FloatAt(Rectangle floatWindowBounds)
- {
- DockPane pane = DockPanel.DockPaneFactory.CreateDockPane(Content, floatWindowBounds, true);
- }
-
- public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex)
- {
- if (dockStyle == DockStyle.Fill)
- {
- bool samePane = (Pane == pane);
- if (!samePane)
- Pane = pane;
-
- if (contentIndex == -1 || !samePane)
- pane.SetContentIndex(Content, contentIndex);
- else
- {
- DockContentCollection contents = pane.Contents;
- int oldIndex = contents.IndexOf(Content);
- int newIndex = contentIndex;
- if (oldIndex < newIndex)
- {
- newIndex += 1;
- if (newIndex > contents.Count -1)
- newIndex = -1;
- }
- pane.SetContentIndex(Content, newIndex);
- }
- }
- else
- {
- DockPane paneFrom = DockPanel.DockPaneFactory.CreateDockPane(Content, pane.DockState, true);
- INestedPanesContainer container = pane.NestedPanesContainer;
- if (dockStyle == DockStyle.Left)
- paneFrom.DockTo(container, pane, DockAlignment.Left, 0.5);
- else if (dockStyle == DockStyle.Right)
- paneFrom.DockTo(container, pane, DockAlignment.Right, 0.5);
- else if (dockStyle == DockStyle.Top)
- paneFrom.DockTo(container, pane, DockAlignment.Top, 0.5);
- else if (dockStyle == DockStyle.Bottom)
- paneFrom.DockTo(container, pane, DockAlignment.Bottom, 0.5);
-
- paneFrom.DockState = pane.DockState;
- }
- }
-
- public void DockTo(DockPanel panel, DockStyle dockStyle)
- {
- if (panel != DockPanel)
- throw new ArgumentException(Strings.IDockDragSource_DockTo_InvalidPanel, "panel");
-
- DockPane pane;
-
- if (dockStyle == DockStyle.Top)
- pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.DockTop, true);
- else if (dockStyle == DockStyle.Bottom)
- pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.DockBottom, true);
- else if (dockStyle == DockStyle.Left)
- pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.DockLeft, true);
- else if (dockStyle == DockStyle.Right)
- pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.DockRight, true);
- else if (dockStyle == DockStyle.Fill)
- pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Document, true);
- else
- return;
- }
-
- #endregion
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockOutlineBase.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockOutlineBase.cs
deleted file mode 100644
index 6d24175fc3..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockOutlineBase.cs
+++ /dev/null
@@ -1,161 +0,0 @@
-using System;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal abstract class DockOutlineBase
- {
- public DockOutlineBase()
- {
- Init();
- }
-
- private void Init()
- {
- SetValues(Rectangle.Empty, null, DockStyle.None, -1);
- SaveOldValues();
- }
-
- private Rectangle m_oldFloatWindowBounds;
- protected Rectangle OldFloatWindowBounds
- {
- get { return m_oldFloatWindowBounds; }
- }
-
- private Control m_oldDockTo;
- protected Control OldDockTo
- {
- get { return m_oldDockTo; }
- }
-
- private DockStyle m_oldDock;
- protected DockStyle OldDock
- {
- get { return m_oldDock; }
- }
-
- private int m_oldContentIndex;
- protected int OldContentIndex
- {
- get { return m_oldContentIndex; }
- }
-
- protected bool SameAsOldValue
- {
- get
- {
- return FloatWindowBounds == OldFloatWindowBounds &&
- DockTo == OldDockTo &&
- Dock == OldDock &&
- ContentIndex == OldContentIndex;
- }
- }
-
- private Rectangle m_floatWindowBounds;
- public Rectangle FloatWindowBounds
- {
- get { return m_floatWindowBounds; }
- }
-
- private Control m_dockTo;
- public Control DockTo
- {
- get { return m_dockTo; }
- }
-
- private DockStyle m_dock;
- public DockStyle Dock
- {
- get { return m_dock; }
- }
-
- private int m_contentIndex;
- public int ContentIndex
- {
- get { return m_contentIndex; }
- }
-
- public bool FlagFullEdge
- {
- get { return m_contentIndex != 0; }
- }
-
- private bool m_flagTestDrop = false;
- public bool FlagTestDrop
- {
- get { return m_flagTestDrop; }
- set { m_flagTestDrop = value; }
- }
-
- private void SaveOldValues()
- {
- m_oldDockTo = m_dockTo;
- m_oldDock = m_dock;
- m_oldContentIndex = m_contentIndex;
- m_oldFloatWindowBounds = m_floatWindowBounds;
- }
-
- protected abstract void OnShow();
-
- protected abstract void OnClose();
-
- private void SetValues(Rectangle floatWindowBounds, Control dockTo, DockStyle dock, int contentIndex)
- {
- m_floatWindowBounds = floatWindowBounds;
- m_dockTo = dockTo;
- m_dock = dock;
- m_contentIndex = contentIndex;
- FlagTestDrop = true;
- }
-
- private void TestChange()
- {
- if (m_floatWindowBounds != m_oldFloatWindowBounds ||
- m_dockTo != m_oldDockTo ||
- m_dock != m_oldDock ||
- m_contentIndex != m_oldContentIndex)
- OnShow();
- }
-
- public void Show()
- {
- SaveOldValues();
- SetValues(Rectangle.Empty, null, DockStyle.None, -1);
- TestChange();
- }
-
- public void Show(DockPane pane, DockStyle dock)
- {
- SaveOldValues();
- SetValues(Rectangle.Empty, pane, dock, -1);
- TestChange();
- }
-
- public void Show(DockPane pane, int contentIndex)
- {
- SaveOldValues();
- SetValues(Rectangle.Empty, pane, DockStyle.Fill, contentIndex);
- TestChange();
- }
-
- public void Show(DockPanel dockPanel, DockStyle dock, bool fullPanelEdge)
- {
- SaveOldValues();
- SetValues(Rectangle.Empty, dockPanel, dock, fullPanelEdge ? -1 : 0);
- TestChange();
- }
-
- public void Show(Rectangle floatWindowBounds)
- {
- SaveOldValues();
- SetValues(floatWindowBounds, null, DockStyle.None, -1);
- TestChange();
- }
-
- public void Close()
- {
- OnClose();
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPane.SplitterControl.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPane.SplitterControl.cs
deleted file mode 100644
index dc69fb944f..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPane.SplitterControl.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- partial class DockPane
- {
- private class SplitterControl : Control, ISplitterDragSource
- {
- DockPane m_pane;
-
- public SplitterControl(DockPane pane)
- {
- SetStyle(ControlStyles.Selectable, false);
- m_pane = pane;
- }
-
- public DockPane DockPane
- {
- get { return m_pane; }
- }
-
- private DockAlignment m_alignment;
- public DockAlignment Alignment
- {
- get { return m_alignment; }
- set
- {
- m_alignment = value;
- if (m_alignment == DockAlignment.Left || m_alignment == DockAlignment.Right)
- Cursor = Cursors.VSplit;
- else if (m_alignment == DockAlignment.Top || m_alignment == DockAlignment.Bottom)
- Cursor = Cursors.HSplit;
- else
- Cursor = Cursors.Default;
-
- if (DockPane.DockState == DockState.Document)
- Invalidate();
- }
- }
-
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
-
- if (DockPane.DockState != DockState.Document)
- return;
-
- Graphics g = e.Graphics;
- Rectangle rect = ClientRectangle;
- if (Alignment == DockAlignment.Top || Alignment == DockAlignment.Bottom)
- g.DrawLine(SystemPens.ControlDark, rect.Left, rect.Bottom - 1, rect.Right, rect.Bottom - 1);
- else if (Alignment == DockAlignment.Left || Alignment == DockAlignment.Right)
- g.DrawLine(SystemPens.ControlDarkDark, rect.Right - 1, rect.Top, rect.Right - 1, rect.Bottom);
- }
-
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
-
- if (e.Button != MouseButtons.Left)
- return;
-
- DockPane.DockPanel.BeginDrag(this, Parent.RectangleToScreen(Bounds));
- }
-
- #region ISplitterDragSource Members
-
- void ISplitterDragSource.BeginDrag(Rectangle rectSplitter)
- {
- }
-
- void ISplitterDragSource.EndDrag()
- {
- }
-
- bool ISplitterDragSource.IsVertical
- {
- get
- {
- NestedDockingStatus status = DockPane.NestedDockingStatus;
- return (status.DisplayingAlignment == DockAlignment.Left ||
- status.DisplayingAlignment == DockAlignment.Right);
- }
- }
-
- Rectangle ISplitterDragSource.DragLimitBounds
- {
- get
- {
- NestedDockingStatus status = DockPane.NestedDockingStatus;
- Rectangle rectLimit = Parent.RectangleToScreen(status.LogicalBounds);
- if (((ISplitterDragSource)this).IsVertical)
- {
- rectLimit.X += MeasurePane.MinSize;
- rectLimit.Width -= 2 * MeasurePane.MinSize;
- }
- else
- {
- rectLimit.Y += MeasurePane.MinSize;
- rectLimit.Height -= 2 * MeasurePane.MinSize;
- }
-
- return rectLimit;
- }
- }
-
- void ISplitterDragSource.MoveSplitter(int offset)
- {
- NestedDockingStatus status = DockPane.NestedDockingStatus;
- double proportion = status.Proportion;
- if (status.LogicalBounds.Width <= 0 || status.LogicalBounds.Height <= 0)
- return;
- else if (status.DisplayingAlignment == DockAlignment.Left)
- proportion += ((double)offset) / (double)status.LogicalBounds.Width;
- else if (status.DisplayingAlignment == DockAlignment.Right)
- proportion -= ((double)offset) / (double)status.LogicalBounds.Width;
- else if (status.DisplayingAlignment == DockAlignment.Top)
- proportion += ((double)offset) / (double)status.LogicalBounds.Height;
- else
- proportion -= ((double)offset) / (double)status.LogicalBounds.Height;
-
- DockPane.SetNestedDockingProportion(proportion);
- }
-
- #region IDragSource Members
-
- Control IDragSource.DragControl
- {
- get { return this; }
- }
-
- #endregion
-
- #endregion
- }
-
- private SplitterControl m_splitter;
- private SplitterControl Splitter
- {
- get { return m_splitter; }
- }
-
- internal Rectangle SplitterBounds
- {
- set { Splitter.Bounds = value; }
- }
-
- internal DockAlignment SplitterAlignment
- {
- set { Splitter.Alignment = value; }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPane.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPane.cs
deleted file mode 100644
index 98685cfa77..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPane.cs
+++ /dev/null
@@ -1,1277 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Windows.Forms;
-using System.Runtime.InteropServices;
-using System.Security.Permissions;
-using System.Diagnostics.CodeAnalysis;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- [ToolboxItem(false)]
- public partial class DockPane : UserControl, IDockDragSource
- {
- public enum AppearanceStyle
- {
- ToolWindow,
- Document
- }
-
- private enum HitTestArea
- {
- Caption,
- TabStrip,
- Content,
- None
- }
-
- private struct HitTestResult
- {
- public HitTestArea HitArea;
- public int Index;
-
- public HitTestResult(HitTestArea hitTestArea, int index)
- {
- HitArea = hitTestArea;
- Index = index;
- }
- }
-
- private DockPaneCaptionBase m_captionControl;
- private DockPaneCaptionBase CaptionControl
- {
- get { return m_captionControl; }
- }
-
- private DockPaneStripBase m_tabStripControl;
- internal DockPaneStripBase TabStripControl
- {
- get { return m_tabStripControl; }
- }
-
- internal protected DockPane(IDockContent content, DockState visibleState, bool show)
- {
- InternalConstruct(content, visibleState, false, Rectangle.Empty, null, DockAlignment.Right, 0.5, show);
- }
-
- [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")]
- internal protected DockPane(IDockContent content, FloatWindow floatWindow, bool show)
- {
- if (floatWindow == null)
- throw new ArgumentNullException("floatWindow");
-
- InternalConstruct(content, DockState.Float, false, Rectangle.Empty, floatWindow.NestedPanes.GetDefaultPreviousPane(this), DockAlignment.Right, 0.5, show);
- }
-
- internal protected DockPane(IDockContent content, DockPane previousPane, DockAlignment alignment, double proportion, bool show)
- {
- if (previousPane == null)
- throw(new ArgumentNullException("previousPane"));
- InternalConstruct(content, previousPane.DockState, false, Rectangle.Empty, previousPane, alignment, proportion, show);
- }
-
- [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")]
- internal protected DockPane(IDockContent content, Rectangle floatWindowBounds, bool show)
- {
- InternalConstruct(content, DockState.Float, true, floatWindowBounds, null, DockAlignment.Right, 0.5, show);
- }
-
- private void InternalConstruct(IDockContent content, DockState dockState, bool flagBounds, Rectangle floatWindowBounds, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
- {
- if (dockState == DockState.Hidden || dockState == DockState.Unknown)
- throw new ArgumentException(Strings.DockPane_SetDockState_InvalidState);
-
- if (content == null)
- throw new ArgumentNullException(Strings.DockPane_Constructor_NullContent);
-
- if (content.DockHandler.DockPanel == null)
- throw new ArgumentException(Strings.DockPane_Constructor_NullDockPanel);
-
-
- SuspendLayout();
- SetStyle(ControlStyles.Selectable, false);
-
- m_isFloat = (dockState == DockState.Float);
-
- m_contents = new DockContentCollection();
- m_displayingContents = new DockContentCollection(this);
- m_dockPanel = content.DockHandler.DockPanel;
- m_dockPanel.AddPane(this);
-
- m_splitter = new SplitterControl(this);
-
- m_nestedDockingStatus = new NestedDockingStatus(this);
-
- m_captionControl = DockPanel.DockPaneCaptionFactory.CreateDockPaneCaption(this);
- m_tabStripControl = DockPanel.DockPaneStripFactory.CreateDockPaneStrip(this);
- Controls.AddRange(new Control[] { m_captionControl, m_tabStripControl });
-
- DockPanel.SuspendLayout(true);
- if (flagBounds)
- FloatWindow = DockPanel.FloatWindowFactory.CreateFloatWindow(DockPanel, this, floatWindowBounds);
- else if (prevPane != null)
- DockTo(prevPane.NestedPanesContainer, prevPane, alignment, proportion);
-
- SetDockState(dockState);
- if (show)
- content.DockHandler.Pane = this;
- else if (this.IsFloat)
- content.DockHandler.FloatPane = this;
- else
- content.DockHandler.PanelPane = this;
-
- ResumeLayout();
- DockPanel.ResumeLayout(true, true);
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- m_dockState = DockState.Unknown;
-
- if (NestedPanesContainer != null)
- NestedPanesContainer.NestedPanes.Remove(this);
-
- if (DockPanel != null)
- {
- DockPanel.RemovePane(this);
- m_dockPanel = null;
- }
-
- Splitter.Dispose();
- if (m_autoHidePane != null)
- m_autoHidePane.Dispose();
- }
- base.Dispose(disposing);
- }
-
- private IDockContent m_activeContent = null;
- public virtual IDockContent ActiveContent
- {
- get { return m_activeContent; }
- set
- {
- if (ActiveContent == value)
- return;
-
- if (value != null)
- {
- if (!DisplayingContents.Contains(value))
- throw(new InvalidOperationException(Strings.DockPane_ActiveContent_InvalidValue));
- }
- else
- {
- if (DisplayingContents.Count != 0)
- throw(new InvalidOperationException(Strings.DockPane_ActiveContent_InvalidValue));
- }
-
- IDockContent oldValue = m_activeContent;
-
- if (DockPanel.ActiveAutoHideContent == oldValue)
- DockPanel.ActiveAutoHideContent = null;
-
- m_activeContent = value;
-
- if (DockPanel.DocumentStyle == DocumentStyle.DockingMdi && DockState == DockState.Document)
- {
- if (m_activeContent != null)
- m_activeContent.DockHandler.Form.BringToFront();
- }
- else
- {
- if (m_activeContent != null)
- m_activeContent.DockHandler.SetVisible();
- if (oldValue != null && DisplayingContents.Contains(oldValue))
- oldValue.DockHandler.SetVisible();
- if (IsActivated && m_activeContent != null)
- m_activeContent.DockHandler.Activate();
- }
-
- if (FloatWindow != null)
- FloatWindow.SetText();
-
- if (DockPanel.DocumentStyle == DocumentStyle.DockingMdi &&
- DockState == DockState.Document)
- RefreshChanges(false); // delayed layout to reduce screen flicker
- else
- RefreshChanges();
-
- if (m_activeContent != null)
- TabStripControl.EnsureTabVisible(m_activeContent);
- }
- }
-
- private bool m_allowDockDragAndDrop = true;
- public virtual bool AllowDockDragAndDrop
- {
- get { return m_allowDockDragAndDrop; }
- set { m_allowDockDragAndDrop = value; }
- }
-
- private IDisposable m_autoHidePane = null;
- internal IDisposable AutoHidePane
- {
- get { return m_autoHidePane; }
- set { m_autoHidePane = value; }
- }
-
- private object m_autoHideTabs = null;
- internal object AutoHideTabs
- {
- get { return m_autoHideTabs; }
- set { m_autoHideTabs = value; }
- }
-
- private object TabPageContextMenu
- {
- get
- {
- IDockContent content = ActiveContent;
-
- if (content == null)
- return null;
-
- if (content.DockHandler.TabPageContextMenuStrip != null)
- return content.DockHandler.TabPageContextMenuStrip;
- else if (content.DockHandler.TabPageContextMenu != null)
- return content.DockHandler.TabPageContextMenu;
- else
- return null;
- }
- }
-
- internal bool HasTabPageContextMenu
- {
- get { return TabPageContextMenu != null; }
- }
-
- internal void ShowTabPageContextMenu(Control control, Point position)
- {
- object menu = TabPageContextMenu;
-
- if (menu == null)
- return;
-
- ContextMenuStrip contextMenuStrip = menu as ContextMenuStrip;
- if (contextMenuStrip != null)
- {
- contextMenuStrip.Show(control, position);
- return;
- }
-
- ContextMenu contextMenu = menu as ContextMenu;
- if (contextMenu != null)
- contextMenu.Show(this, position);
- }
-
- private Rectangle CaptionRectangle
- {
- get
- {
- if (!HasCaption)
- return Rectangle.Empty;
-
- Rectangle rectWindow = DisplayingRectangle;
- int x, y, width;
- x = rectWindow.X;
- y = rectWindow.Y;
- width = rectWindow.Width;
- int height = CaptionControl.MeasureHeight();
-
- return new Rectangle(x, y, width, height);
- }
- }
-
- internal Rectangle ContentRectangle
- {
- get
- {
- Rectangle rectWindow = DisplayingRectangle;
- Rectangle rectCaption = CaptionRectangle;
- Rectangle rectTabStrip = TabStripRectangle;
-
- int x = rectWindow.X;
- int y = rectWindow.Y + (rectCaption.IsEmpty ? 0 : rectCaption.Height) +
- (DockState == DockState.Document ? rectTabStrip.Height : 0);
- int width = rectWindow.Width;
- int height = rectWindow.Height - rectCaption.Height - rectTabStrip.Height;
-
- return new Rectangle(x, y, width, height);
- }
- }
-
- internal Rectangle TabStripRectangle
- {
- get
- {
- if (Appearance == AppearanceStyle.ToolWindow)
- return TabStripRectangle_ToolWindow;
- else
- return TabStripRectangle_Document;
- }
- }
-
- private Rectangle TabStripRectangle_ToolWindow
- {
- get
- {
- if (DisplayingContents.Count <= 1 || IsAutoHide)
- return Rectangle.Empty;
-
- Rectangle rectWindow = DisplayingRectangle;
-
- int width = rectWindow.Width;
- int height = TabStripControl.MeasureHeight();
- int x = rectWindow.X;
- int y = rectWindow.Bottom - height;
- Rectangle rectCaption = CaptionRectangle;
- if (rectCaption.Contains(x, y))
- y = rectCaption.Y + rectCaption.Height;
-
- return new Rectangle(x, y, width, height);
- }
- }
-
- private Rectangle TabStripRectangle_Document
- {
- get
- {
- if (DisplayingContents.Count == 0)
- return Rectangle.Empty;
-
- if (DisplayingContents.Count == 1 && DockPanel.DocumentStyle == DocumentStyle.DockingSdi)
- return Rectangle.Empty;
-
- Rectangle rectWindow = DisplayingRectangle;
- int x = rectWindow.X;
- int y = rectWindow.Y;
- int width = rectWindow.Width;
- int height = TabStripControl.MeasureHeight();
-
- return new Rectangle(x, y, width, height);
- }
- }
-
- public virtual string CaptionText
- {
- get { return ActiveContent == null ? string.Empty : ActiveContent.DockHandler.TabText; }
- }
-
- private DockContentCollection m_contents;
- public DockContentCollection Contents
- {
- get { return m_contents; }
- }
-
- private DockContentCollection m_displayingContents;
- public DockContentCollection DisplayingContents
- {
- get { return m_displayingContents; }
- }
-
- private DockPanel m_dockPanel;
- public DockPanel DockPanel
- {
- get { return m_dockPanel; }
- }
-
- private bool HasCaption
- {
- get
- {
- if (DockState == DockState.Document ||
- DockState == DockState.Hidden ||
- DockState == DockState.Unknown ||
- (DockState == DockState.Float && FloatWindow.VisibleNestedPanes.Count <= 1))
- return false;
- else
- return true;
- }
- }
-
- private bool m_isActivated = false;
- public bool IsActivated
- {
- get { return m_isActivated; }
- }
- internal void SetIsActivated(bool value)
- {
- if (m_isActivated == value)
- return;
-
- m_isActivated = value;
- if (DockState != DockState.Document)
- RefreshChanges(false);
- OnIsActivatedChanged(EventArgs.Empty);
- }
-
- private bool m_isActiveDocumentPane = false;
- public bool IsActiveDocumentPane
- {
- get { return m_isActiveDocumentPane; }
- }
- internal void SetIsActiveDocumentPane(bool value)
- {
- if (m_isActiveDocumentPane == value)
- return;
-
- m_isActiveDocumentPane = value;
- if (DockState == DockState.Document)
- RefreshChanges();
- OnIsActiveDocumentPaneChanged(EventArgs.Empty);
- }
-
- public bool IsDockStateValid(DockState dockState)
- {
- foreach (IDockContent content in Contents)
- if (!content.DockHandler.IsDockStateValid(dockState))
- return false;
-
- return true;
- }
-
- public bool IsAutoHide
- {
- get { return DockHelper.IsDockStateAutoHide(DockState); }
- }
-
- public AppearanceStyle Appearance
- {
- get { return (DockState == DockState.Document) ? AppearanceStyle.Document : AppearanceStyle.ToolWindow; }
- }
-
- internal Rectangle DisplayingRectangle
- {
- get { return ClientRectangle; }
- }
-
- public void Activate()
- {
- if (DockHelper.IsDockStateAutoHide(DockState) && DockPanel.ActiveAutoHideContent != ActiveContent)
- DockPanel.ActiveAutoHideContent = ActiveContent;
- else if (!IsActivated && ActiveContent != null)
- ActiveContent.DockHandler.Activate();
- }
-
- internal void AddContent(IDockContent content)
- {
- if (Contents.Contains(content))
- return;
-
- Contents.Add(content);
- }
-
- internal void Close()
- {
- Dispose();
- }
-
- public void CloseActiveContent()
- {
- CloseContent(ActiveContent);
- }
-
- internal void CloseContent(IDockContent content)
- {
- DockPanel dockPanel = DockPanel;
- dockPanel.SuspendLayout(true);
-
- if (content == null)
- return;
-
- if (!content.DockHandler.CloseButton)
- return;
-
- if (content.DockHandler.HideOnClose)
- content.DockHandler.Hide();
- else
- content.DockHandler.Close();
-
- dockPanel.ResumeLayout(true, true);
- }
-
- private HitTestResult GetHitTest(Point ptMouse)
- {
- Point ptMouseClient = PointToClient(ptMouse);
-
- Rectangle rectCaption = CaptionRectangle;
- if (rectCaption.Contains(ptMouseClient))
- return new HitTestResult(HitTestArea.Caption, -1);
-
- Rectangle rectContent = ContentRectangle;
- if (rectContent.Contains(ptMouseClient))
- return new HitTestResult(HitTestArea.Content, -1);
-
- Rectangle rectTabStrip = TabStripRectangle;
- if (rectTabStrip.Contains(ptMouseClient))
- return new HitTestResult(HitTestArea.TabStrip, TabStripControl.HitTest(TabStripControl.PointToClient(ptMouse)));
-
- return new HitTestResult(HitTestArea.None, -1);
- }
-
- private bool m_isHidden = true;
- public bool IsHidden
- {
- get { return m_isHidden; }
- }
- private void SetIsHidden(bool value)
- {
- if (m_isHidden == value)
- return;
-
- m_isHidden = value;
- if (DockHelper.IsDockStateAutoHide(DockState))
- {
- DockPanel.RefreshAutoHideStrip();
- DockPanel.PerformLayout();
- }
- else if (NestedPanesContainer != null)
- ((Control)NestedPanesContainer).PerformLayout();
- }
-
- protected override void OnLayout(LayoutEventArgs levent)
- {
- SetIsHidden(DisplayingContents.Count == 0);
- if (!IsHidden)
- {
- CaptionControl.Bounds = CaptionRectangle;
- TabStripControl.Bounds = TabStripRectangle;
-
- SetContentBounds();
-
- foreach (IDockContent content in Contents)
- {
- if (DisplayingContents.Contains(content))
- if (content.DockHandler.FlagClipWindow && content.DockHandler.Form.Visible)
- content.DockHandler.FlagClipWindow = false;
- }
- }
-
- base.OnLayout(levent);
- }
-
- internal void SetContentBounds()
- {
- Rectangle rectContent = ContentRectangle;
- if (DockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyle.DockingMdi)
- rectContent = DockPanel.RectangleToMdiClient(RectangleToScreen(rectContent));
-
- Rectangle rectInactive = new Rectangle(-rectContent.Width, rectContent.Y, rectContent.Width, rectContent.Height);
- foreach (IDockContent content in Contents)
- if (content.DockHandler.Pane == this)
- {
- if (content == ActiveContent)
- content.DockHandler.Form.Bounds = rectContent;
- else
- content.DockHandler.Form.Bounds = rectInactive;
- }
- }
-
- internal void RefreshChanges()
- {
- RefreshChanges(true);
- }
-
- private void RefreshChanges(bool performLayout)
- {
- if (IsDisposed)
- return;
-
- CaptionControl.RefreshChanges();
- TabStripControl.RefreshChanges();
- if (DockState == DockState.Float)
- FloatWindow.RefreshChanges();
- if (DockHelper.IsDockStateAutoHide(DockState) && DockPanel != null)
- {
- DockPanel.RefreshAutoHideStrip();
- DockPanel.PerformLayout();
- }
-
- if (performLayout)
- PerformLayout();
- }
-
- internal void RemoveContent(IDockContent content)
- {
- if (!Contents.Contains(content))
- return;
-
- Contents.Remove(content);
- }
-
- public void SetContentIndex(IDockContent content, int index)
- {
- int oldIndex = Contents.IndexOf(content);
- if (oldIndex == -1)
- throw(new ArgumentException(Strings.DockPane_SetContentIndex_InvalidContent));
-
- if (index < 0 || index > Contents.Count - 1)
- if (index != -1)
- throw(new ArgumentOutOfRangeException(Strings.DockPane_SetContentIndex_InvalidIndex));
-
- if (oldIndex == index)
- return;
- if (oldIndex == Contents.Count - 1 && index == -1)
- return;
-
- Contents.Remove(content);
- if (index == -1)
- Contents.Add(content);
- else if (oldIndex < index)
- Contents.AddAt(content, index - 1);
- else
- Contents.AddAt(content, index);
-
- RefreshChanges();
- }
-
- private void SetParent()
- {
- if (DockState == DockState.Unknown || DockState == DockState.Hidden)
- {
- SetParent(null);
- Splitter.Parent = null;
- }
- else if (DockState == DockState.Float)
- {
- SetParent(FloatWindow);
- Splitter.Parent = FloatWindow;
- }
- else if (DockHelper.IsDockStateAutoHide(DockState))
- {
- SetParent(DockPanel.AutoHideControl);
- Splitter.Parent = null;
- }
- else
- {
- SetParent(DockPanel.DockWindows[DockState]);
- Splitter.Parent = Parent;
- }
- }
-
- private void SetParent(Control value)
- {
- if (Parent == value)
- return;
-
- //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- // Workaround of .Net Framework bug:
- // Change the parent of a control with focus may result in the first
- // MDI child form get activated.
- //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- IDockContent contentFocused = GetFocusedContent();
- if (contentFocused != null)
- DockPanel.SaveFocus();
-
- //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
- Parent = value;
-
- //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- // Workaround of .Net Framework bug:
- // Change the parent of a control with focus may result in the first
- // MDI child form get activated.
- //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- if (contentFocused != null)
- contentFocused.DockHandler.Activate();
- //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- }
-
- public new void Show()
- {
- Activate();
- }
-
- internal void TestDrop(IDockDragSource dragSource, DockOutlineBase dockOutline)
- {
- if (!dragSource.CanDockTo(this))
- return;
-
- Point ptMouse = Control.MousePosition;
-
- HitTestResult hitTestResult = GetHitTest(ptMouse);
- if (hitTestResult.HitArea == HitTestArea.Caption)
- dockOutline.Show(this, -1);
- else if (hitTestResult.HitArea == HitTestArea.TabStrip && hitTestResult.Index != -1)
- dockOutline.Show(this, hitTestResult.Index);
- }
-
- internal void ValidateActiveContent()
- {
- if (ActiveContent == null)
- {
- if (DisplayingContents.Count != 0)
- ActiveContent = DisplayingContents[0];
- return;
- }
-
- if (DisplayingContents.IndexOf(ActiveContent) >= 0)
- return;
-
- IDockContent prevVisible = null;
- for (int i=Contents.IndexOf(ActiveContent)-1; i>=0; i--)
- if (Contents[i].DockHandler.DockState == DockState)
- {
- prevVisible = Contents[i];
- break;
- }
-
- IDockContent nextVisible = null;
- for (int i=Contents.IndexOf(ActiveContent)+1; i= 0);
- DockPanel.ResumeLayout(true, true);
- }
-
- private bool IsRefreshStateChangeSuspended
- {
- get { return m_countRefreshStateChange != 0; }
- }
-
- private void ResumeRefreshStateChange(INestedPanesContainer oldContainer, DockState oldDockState)
- {
- ResumeRefreshStateChange();
- RefreshStateChange(oldContainer, oldDockState);
- }
-
- private void RefreshStateChange(INestedPanesContainer oldContainer, DockState oldDockState)
- {
- lock (this)
- {
- if (IsRefreshStateChangeSuspended)
- return;
-
- SuspendRefreshStateChange();
- }
-
- DockPanel.SuspendLayout(true);
-
- IDockContent contentFocused = GetFocusedContent();
- if (contentFocused != null)
- DockPanel.SaveFocus();
- SetParent();
-
- if (ActiveContent != null)
- ActiveContent.DockHandler.SetDockState(ActiveContent.DockHandler.IsHidden, DockState, ActiveContent.DockHandler.Pane);
- foreach (IDockContent content in Contents)
- {
- if (content.DockHandler.Pane == this)
- content.DockHandler.SetDockState(content.DockHandler.IsHidden, DockState, content.DockHandler.Pane);
- }
-
- if (oldContainer != null)
- {
- Control oldContainerControl = (Control)oldContainer;
- if (oldContainer.DockState == oldDockState && !oldContainerControl.IsDisposed)
- oldContainerControl.PerformLayout();
- }
- if (DockHelper.IsDockStateAutoHide(oldDockState))
- DockPanel.RefreshActiveAutoHideContent();
-
- if (NestedPanesContainer.DockState == DockState)
- ((Control)NestedPanesContainer).PerformLayout();
- if (DockHelper.IsDockStateAutoHide(DockState))
- DockPanel.RefreshActiveAutoHideContent();
-
- if (DockHelper.IsDockStateAutoHide(oldDockState) ||
- DockHelper.IsDockStateAutoHide(DockState))
- {
- DockPanel.RefreshAutoHideStrip();
- DockPanel.PerformLayout();
- }
-
- ResumeRefreshStateChange();
-
- if (contentFocused != null)
- contentFocused.DockHandler.Activate();
-
- DockPanel.ResumeLayout(true, true);
-
- if (oldDockState != DockState)
- OnDockStateChanged(EventArgs.Empty);
- }
-
- private IDockContent GetFocusedContent()
- {
- IDockContent contentFocused = null;
- foreach (IDockContent content in Contents)
- {
- if (content.DockHandler.Form.ContainsFocus)
- {
- contentFocused = content;
- break;
- }
- }
-
- return contentFocused;
- }
-
- public DockPane DockTo(INestedPanesContainer container)
- {
- if (container == null)
- throw new InvalidOperationException(Strings.DockPane_DockTo_NullContainer);
-
- DockAlignment alignment;
- if (container.DockState == DockState.DockLeft || container.DockState == DockState.DockRight)
- alignment = DockAlignment.Bottom;
- else
- alignment = DockAlignment.Right;
-
- return DockTo(container, container.NestedPanes.GetDefaultPreviousPane(this), alignment, 0.5);
- }
-
- public DockPane DockTo(INestedPanesContainer container, DockPane previousPane, DockAlignment alignment, double proportion)
- {
- if (container == null)
- throw new InvalidOperationException(Strings.DockPane_DockTo_NullContainer);
-
- if (container.IsFloat == this.IsFloat)
- {
- InternalAddToDockList(container, previousPane, alignment, proportion);
- return this;
- }
-
- IDockContent firstContent = GetFirstContent(container.DockState);
- if (firstContent == null)
- return null;
-
- DockPane pane;
- DockPanel.DummyContent.DockPanel = DockPanel;
- if (container.IsFloat)
- pane = DockPanel.DockPaneFactory.CreateDockPane(DockPanel.DummyContent, (FloatWindow)container, true);
- else
- pane = DockPanel.DockPaneFactory.CreateDockPane(DockPanel.DummyContent, container.DockState, true);
-
- pane.DockTo(container, previousPane, alignment, proportion);
- SetVisibleContentsToPane(pane);
- DockPanel.DummyContent.DockPanel = null;
-
- return pane;
- }
-
- private void SetVisibleContentsToPane(DockPane pane)
- {
- SetVisibleContentsToPane(pane, ActiveContent);
- }
-
- private void SetVisibleContentsToPane(DockPane pane, IDockContent activeContent)
- {
- for (int i=0; i 0)
- throw new InvalidOperationException(Strings.DockPane_DockTo_NullPrevPane);
-
- if (prevPane != null && !container.NestedPanes.Contains(prevPane))
- throw new InvalidOperationException(Strings.DockPane_DockTo_NoPrevPane);
-
- if (prevPane == this)
- throw new InvalidOperationException(Strings.DockPane_DockTo_SelfPrevPane);
-
- INestedPanesContainer oldContainer = NestedPanesContainer;
- DockState oldDockState = DockState;
- container.NestedPanes.Add(this);
- NestedDockingStatus.SetStatus(container.NestedPanes, prevPane, alignment, proportion);
-
- if (DockHelper.IsDockWindowState(DockState))
- m_dockState = container.DockState;
-
- RefreshStateChange(oldContainer, oldDockState);
- }
-
- public void SetNestedDockingProportion(double proportion)
- {
- NestedDockingStatus.SetStatus(NestedDockingStatus.NestedPanes, NestedDockingStatus.PreviousPane, NestedDockingStatus.Alignment, proportion);
- if (NestedPanesContainer != null)
- ((Control)NestedPanesContainer).PerformLayout();
- }
-
- public DockPane Float()
- {
- DockPanel.SuspendLayout(true);
-
- IDockContent activeContent = ActiveContent;
-
- DockPane floatPane = GetFloatPaneFromContents();
- if (floatPane == null)
- {
- IDockContent firstContent = GetFirstContent(DockState.Float);
- if (firstContent == null)
- {
- DockPanel.ResumeLayout(true, true);
- return null;
- }
- floatPane = DockPanel.DockPaneFactory.CreateDockPane(firstContent,DockState.Float, true);
- }
- SetVisibleContentsToPane(floatPane, activeContent);
-
- DockPanel.ResumeLayout(true, true);
- return floatPane;
- }
-
- private DockPane GetFloatPaneFromContents()
- {
- DockPane floatPane = null;
- for (int i=0; i=0; i--)
- {
- IDockContent content = DisplayingContents[i];
- if (content.DockHandler.CheckDockState(false) != DockState.Unknown)
- content.DockHandler.IsFloat = false;
- }
-
- DockPanel.ResumeLayout(true, true);
- }
-
- [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- protected override void WndProc(ref Message m)
- {
- if (m.Msg == (int)Win32.Msgs.WM_MOUSEACTIVATE)
- Activate();
-
- base.WndProc(ref m);
- }
-
- #region IDockDragSource Members
-
- #region IDragSource Members
-
- Control IDragSource.DragControl
- {
- get { return this; }
- }
-
- #endregion
-
- bool IDockDragSource.IsDockStateValid(DockState dockState)
- {
- return IsDockStateValid(dockState);
- }
-
- bool IDockDragSource.CanDockTo(DockPane pane)
- {
- if (!IsDockStateValid(pane.DockState))
- return false;
-
- if (pane == this)
- return false;
-
- return true;
- }
-
- Rectangle IDockDragSource.BeginDrag(Point ptMouse)
- {
- Point location = PointToScreen(new Point(0, 0));
- Size size;
-
- DockPane floatPane = ActiveContent.DockHandler.FloatPane;
- if (DockState == DockState.Float || floatPane == null || floatPane.FloatWindow.NestedPanes.Count != 1)
- size = DockPanel.DefaultFloatWindowSize;
- else
- size = floatPane.FloatWindow.Size;
-
- if (ptMouse.X > location.X + size.Width)
- location.X += ptMouse.X - (location.X + size.Width) + Measures.SplitterSize;
-
- return new Rectangle(location, size);
- }
-
- public void FloatAt(Rectangle floatWindowBounds)
- {
- if (FloatWindow == null || FloatWindow.NestedPanes.Count != 1)
- FloatWindow = DockPanel.FloatWindowFactory.CreateFloatWindow(DockPanel, this, floatWindowBounds);
- else
- FloatWindow.Bounds = floatWindowBounds;
-
- DockState = DockState.Float;
- }
-
- public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex)
- {
- if (dockStyle == DockStyle.Fill)
- {
- IDockContent activeContent = ActiveContent;
- for (int i = Contents.Count - 1; i >= 0; i--)
- {
- IDockContent c = Contents[i];
- c.DockHandler.Pane = pane;
- if (contentIndex != -1)
- pane.SetContentIndex(c, contentIndex);
- }
- pane.ActiveContent = activeContent;
- }
- else
- {
- if (dockStyle == DockStyle.Left)
- DockTo(pane.NestedPanesContainer, pane, DockAlignment.Left, 0.5);
- else if (dockStyle == DockStyle.Right)
- DockTo(pane.NestedPanesContainer, pane, DockAlignment.Right, 0.5);
- else if (dockStyle == DockStyle.Top)
- DockTo(pane.NestedPanesContainer, pane, DockAlignment.Top, 0.5);
- else if (dockStyle == DockStyle.Bottom)
- DockTo(pane.NestedPanesContainer, pane, DockAlignment.Bottom, 0.5);
-
- DockState = pane.DockState;
- }
- }
-
- public void DockTo(DockPanel panel, DockStyle dockStyle)
- {
- if (panel != DockPanel)
- throw new ArgumentException(Strings.IDockDragSource_DockTo_InvalidPanel, "panel");
-
- if (dockStyle == DockStyle.Top)
- DockState = DockState.DockTop;
- else if (dockStyle == DockStyle.Bottom)
- DockState = DockState.DockBottom;
- else if (dockStyle == DockStyle.Left)
- DockState = DockState.DockLeft;
- else if (dockStyle == DockStyle.Right)
- DockState = DockState.DockRight;
- else if (dockStyle == DockStyle.Fill)
- DockState = DockState.Document;
- }
-
- #endregion
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCaptionBase.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCaptionBase.cs
deleted file mode 100644
index 3daf9f7039..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCaptionBase.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-using System;
-using System.Windows.Forms;
-using System.Drawing;
-using System.Runtime.InteropServices;
-using System.Security.Permissions;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public abstract class DockPaneCaptionBase : Control
- {
- protected internal DockPaneCaptionBase(DockPane pane)
- {
- m_dockPane = pane;
-
- SetStyle(ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint |
- ControlStyles.AllPaintingInWmPaint, true);
- SetStyle(ControlStyles.Selectable, false);
- }
-
- private DockPane m_dockPane;
- protected DockPane DockPane
- {
- get { return m_dockPane; }
- }
-
- protected DockPane.AppearanceStyle Appearance
- {
- get { return DockPane.Appearance; }
- }
-
- protected bool HasTabPageContextMenu
- {
- get { return DockPane.HasTabPageContextMenu; }
- }
-
- protected void ShowTabPageContextMenu(Point position)
- {
- DockPane.ShowTabPageContextMenu(this, position);
- }
-
- protected override void OnMouseUp(MouseEventArgs e)
- {
- base.OnMouseUp(e);
-
- if (e.Button == MouseButtons.Right)
- ShowTabPageContextMenu(new Point(e.X, e.Y));
- }
-
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
-
- if (e.Button == MouseButtons.Left &&
- DockPane.DockPanel.AllowEndUserDocking &&
- DockPane.AllowDockDragAndDrop &&
- !DockHelper.IsDockStateAutoHide(DockPane.DockState) &&
- DockPane.ActiveContent != null)
- DockPane.DockPanel.BeginDrag(DockPane);
- }
-
- [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- protected override void WndProc(ref Message m)
- {
- if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK)
- {
- if (DockHelper.IsDockStateAutoHide(DockPane.DockState))
- {
- DockPane.DockPanel.ActiveAutoHideContent = null;
- return;
- }
-
- if (DockPane.IsFloat)
- DockPane.RestoreToPanel();
- else
- DockPane.Float();
- }
- base.WndProc(ref m);
- }
-
- internal void RefreshChanges()
- {
- if (IsDisposed)
- return;
-
- OnRefreshChanges();
- }
-
- protected virtual void OnRightToLeftLayoutChanged()
- {
- }
-
- protected virtual void OnRefreshChanges()
- {
- }
-
- protected internal abstract int MeasureHeight();
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCollection.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCollection.cs
deleted file mode 100644
index 43f0e90b29..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneCollection.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using System;
-using System.Collections.ObjectModel;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public class DockPaneCollection : ReadOnlyCollection
- {
- internal DockPaneCollection()
- : base(new List())
- {
- }
-
- internal int Add(DockPane pane)
- {
- if (Items.Contains(pane))
- return Items.IndexOf(pane);
-
- Items.Add(pane);
- return Count - 1;
- }
-
- internal void AddAt(DockPane pane, int index)
- {
- if (index < 0 || index > Items.Count - 1)
- return;
-
- if (Contains(pane))
- return;
-
- Items.Insert(index, pane);
- }
-
- internal void Dispose()
- {
- for (int i=Count - 1; i>=0; i--)
- this[i].Close();
- }
-
- internal void Remove(DockPane pane)
- {
- Items.Remove(pane);
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripBase.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripBase.cs
deleted file mode 100644
index 1f4b8ddd4e..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPaneStripBase.cs
+++ /dev/null
@@ -1,248 +0,0 @@
-using System;
-using System.Windows.Forms;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Collections;
-using System.Collections.Generic;
-using System.Security.Permissions;
-using System.Diagnostics.CodeAnalysis;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public abstract class DockPaneStripBase : Control
- {
- [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- protected internal class Tab : IDisposable
- {
- private IDockContent m_content;
-
- public Tab(IDockContent content)
- {
- m_content = content;
- }
-
- public IDockContent Content
- {
- get { return m_content; }
- }
-
- public Form ContentForm
- {
- get { return m_content as Form; }
- }
-
- public virtual void Dispose()
- {
- }
- }
-
- [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- protected sealed class TabCollection : IEnumerable
- {
- #region IEnumerable Members
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (int i = 0; i < Count; i++)
- yield return this[i];
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- for (int i = 0; i < Count; i++)
- yield return this[i];
- }
- #endregion
-
- internal TabCollection(DockPane pane)
- {
- m_dockPane = pane;
- }
-
- private DockPane m_dockPane;
- public DockPane DockPane
- {
- get { return m_dockPane; }
- }
-
- public int Count
- {
- get { return DockPane.DisplayingContents.Count; }
- }
-
- public Tab this[int index]
- {
- get
- {
- IDockContent content = DockPane.DisplayingContents[index];
- if (content == null)
- throw (new ArgumentOutOfRangeException("index"));
- return content.DockHandler.GetTab(DockPane.TabStripControl);
- }
- }
-
- public bool Contains(Tab tab)
- {
- return (IndexOf(tab) != -1);
- }
-
- public bool Contains(IDockContent content)
- {
- return (IndexOf(content) != -1);
- }
-
- public int IndexOf(Tab tab)
- {
- if (tab == null)
- return -1;
-
- return DockPane.DisplayingContents.IndexOf(tab.Content);
- }
-
- public int IndexOf(IDockContent content)
- {
- return DockPane.DisplayingContents.IndexOf(content);
- }
- }
-
- protected DockPaneStripBase(DockPane pane)
- {
- m_dockPane = pane;
-
- SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
- SetStyle(ControlStyles.Selectable, false);
- AllowDrop = true;
- }
-
- private DockPane m_dockPane;
- protected DockPane DockPane
- {
- get { return m_dockPane; }
- }
-
- protected DockPane.AppearanceStyle Appearance
- {
- get { return DockPane.Appearance; }
- }
-
- private TabCollection m_tabs = null;
- protected TabCollection Tabs
- {
- get
- {
- if (m_tabs == null)
- m_tabs = new TabCollection(DockPane);
-
- return m_tabs;
- }
- }
-
- internal void RefreshChanges()
- {
- if (IsDisposed)
- return;
-
- OnRefreshChanges();
- }
-
- protected virtual void OnRefreshChanges()
- {
- }
-
- protected internal abstract int MeasureHeight();
-
- protected internal abstract void EnsureTabVisible(IDockContent content);
-
- protected int HitTest()
- {
- return HitTest(PointToClient(Control.MousePosition));
- }
-
- protected internal abstract int HitTest(Point point);
-
- protected internal abstract GraphicsPath GetOutline(int index);
-
- protected internal virtual Tab CreateTab(IDockContent content)
- {
- return new Tab(content);
- }
-
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
-
- int index = HitTest();
- if (index != -1)
- {
- IDockContent content = Tabs[index].Content;
- if (DockPane.ActiveContent != content)
- DockPane.ActiveContent = content;
- }
-
- if (e.Button == MouseButtons.Left)
- {
- if (DockPane.DockPanel.AllowEndUserDocking && DockPane.AllowDockDragAndDrop && DockPane.ActiveContent.DockHandler.AllowEndUserDocking)
- DockPane.DockPanel.BeginDrag(DockPane.ActiveContent.DockHandler);
- }
- }
-
- protected bool HasTabPageContextMenu
- {
- get { return DockPane.HasTabPageContextMenu; }
- }
-
- protected void ShowTabPageContextMenu(Point position)
- {
- DockPane.ShowTabPageContextMenu(this, position);
- }
-
- protected override void OnMouseUp(MouseEventArgs e)
- {
- base.OnMouseUp(e);
-
- if (e.Button == MouseButtons.Right)
- ShowTabPageContextMenu(new Point(e.X, e.Y));
- }
-
- [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- protected override void WndProc(ref Message m)
- {
- if (m.Msg == (int)Win32.Msgs.WM_LBUTTONDBLCLK)
- {
- base.WndProc(ref m);
-
- int index = HitTest();
- if (DockPane.DockPanel.AllowEndUserDocking && index != -1)
- {
- IDockContent content = Tabs[index].Content;
- if (content.DockHandler.CheckDockState(!content.DockHandler.IsFloat) != DockState.Unknown)
- content.DockHandler.IsFloat = !content.DockHandler.IsFloat;
- }
-
- return;
- } else if (m.Msg == (int)Win32.Msgs.WM_MBUTTONUP) {
- base.WndProc(ref m);
- int index = HitTest();
- if (index != -1) {
- DockPane.CloseContent(Tabs[index].Content);
- }
- return;
- }
-
- base.WndProc(ref m);
- return;
- }
-
- protected override void OnDragOver(DragEventArgs drgevent)
- {
- base.OnDragOver(drgevent);
-
- int index = HitTest();
- if (index != -1)
- {
- IDockContent content = Tabs[index].Content;
- if (DockPane.ActiveContent != content)
- DockPane.ActiveContent = content;
- }
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.AutoHideWindow.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.AutoHideWindow.cs
deleted file mode 100644
index 99866addef..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.AutoHideWindow.cs
+++ /dev/null
@@ -1,612 +0,0 @@
-using System;
-using System.Windows.Forms;
-using System.Drawing;
-using System.Runtime.InteropServices;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- partial class DockPanel
- {
- private class AutoHideWindowControl : Panel, ISplitterDragSource
- {
- private class SplitterControl : SplitterBase
- {
- public SplitterControl(AutoHideWindowControl autoHideWindow)
- {
- m_autoHideWindow = autoHideWindow;
- }
-
- private AutoHideWindowControl m_autoHideWindow;
- private AutoHideWindowControl AutoHideWindow
- {
- get { return m_autoHideWindow; }
- }
-
- protected override int SplitterSize
- {
- get { return Measures.SplitterSize; }
- }
-
- protected override void StartDrag()
- {
- AutoHideWindow.DockPanel.BeginDrag(AutoHideWindow, AutoHideWindow.RectangleToScreen(Bounds));
- }
- }
-
- #region consts
- private const int ANIMATE_TIME = 100; // in mini-seconds
- #endregion
-
- private Timer m_timerMouseTrack;
- private SplitterControl m_splitter;
-
- public AutoHideWindowControl(DockPanel dockPanel)
- {
- m_dockPanel = dockPanel;
-
- m_timerMouseTrack = new Timer();
- m_timerMouseTrack.Tick += new EventHandler(TimerMouseTrack_Tick);
-
- Visible = false;
- m_splitter = new SplitterControl(this);
- Controls.Add(m_splitter);
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- m_timerMouseTrack.Dispose();
- }
- base.Dispose(disposing);
- }
-
- private DockPanel m_dockPanel = null;
- public DockPanel DockPanel
- {
- get { return m_dockPanel; }
- }
-
- private DockPane m_activePane = null;
- public DockPane ActivePane
- {
- get { return m_activePane; }
- }
- private void SetActivePane()
- {
- DockPane value = (ActiveContent == null ? null : ActiveContent.DockHandler.Pane);
-
- if (value == m_activePane)
- return;
-
- m_activePane = value;
- }
-
- private IDockContent m_activeContent = null;
- public IDockContent ActiveContent
- {
- get { return m_activeContent; }
- set
- {
- if (value == m_activeContent)
- return;
-
- if (value != null)
- {
- if (!DockHelper.IsDockStateAutoHide(value.DockHandler.DockState) || value.DockHandler.DockPanel != DockPanel)
- throw (new InvalidOperationException(Strings.DockPanel_ActiveAutoHideContent_InvalidValue));
- }
-
- DockPanel.SuspendLayout();
-
- if (m_activeContent != null)
- {
- if (m_activeContent.DockHandler.Form.ContainsFocus)
- DockPanel.ContentFocusManager.GiveUpFocus(m_activeContent);
- AnimateWindow(false);
- }
-
- m_activeContent = value;
- SetActivePane();
- if (ActivePane != null)
- ActivePane.ActiveContent = m_activeContent;
-
- if (m_activeContent != null)
- AnimateWindow(true);
-
- DockPanel.ResumeLayout();
- DockPanel.RefreshAutoHideStrip();
-
- SetTimerMouseTrack();
- }
- }
-
- public DockState DockState
- {
- get { return ActiveContent == null ? DockState.Unknown : ActiveContent.DockHandler.DockState; }
- }
-
- private bool m_flagAnimate = true;
- private bool FlagAnimate
- {
- get { return m_flagAnimate; }
- set { m_flagAnimate = value; }
- }
-
- private bool m_flagDragging = false;
- internal bool FlagDragging
- {
- get { return m_flagDragging; }
- set
- {
- if (m_flagDragging == value)
- return;
-
- m_flagDragging = value;
- SetTimerMouseTrack();
- }
- }
-
- private void AnimateWindow(bool show)
- {
- if (!FlagAnimate && Visible != show)
- {
- Visible = show;
- return;
- }
-
- Parent.SuspendLayout();
-
- Rectangle rectSource = GetRectangle(!show);
- Rectangle rectTarget = GetRectangle(show);
- int dxLoc, dyLoc;
- int dWidth, dHeight;
- dxLoc = dyLoc = dWidth = dHeight = 0;
- if (DockState == DockState.DockTopAutoHide)
- dHeight = show ? 1 : -1;
- else if (DockState == DockState.DockLeftAutoHide)
- dWidth = show ? 1 : -1;
- else if (DockState == DockState.DockRightAutoHide)
- {
- dxLoc = show ? -1 : 1;
- dWidth = show ? 1 : -1;
- }
- else if (DockState == DockState.DockBottomAutoHide)
- {
- dyLoc = (show ? -1 : 1);
- dHeight = (show ? 1 : -1);
- }
-
- if (show)
- {
- Bounds = DockPanel.GetAutoHideWindowBounds(new Rectangle(-rectTarget.Width, -rectTarget.Height, rectTarget.Width, rectTarget.Height));
- if (Visible == false)
- Visible = true;
- PerformLayout();
- }
-
- SuspendLayout();
-
- LayoutAnimateWindow(rectSource);
- if (Visible == false)
- Visible = true;
-
- int speedFactor = 1;
- int totalPixels = (rectSource.Width != rectTarget.Width) ?
- Math.Abs(rectSource.Width - rectTarget.Width) :
- Math.Abs(rectSource.Height - rectTarget.Height);
- int remainPixels = totalPixels;
- DateTime startingTime = DateTime.Now;
- while (rectSource != rectTarget)
- {
- DateTime startPerMove = DateTime.Now;
-
- rectSource.X += dxLoc * speedFactor;
- rectSource.Y += dyLoc * speedFactor;
- rectSource.Width += dWidth * speedFactor;
- rectSource.Height += dHeight * speedFactor;
- if (Math.Sign(rectTarget.X - rectSource.X) != Math.Sign(dxLoc))
- rectSource.X = rectTarget.X;
- if (Math.Sign(rectTarget.Y - rectSource.Y) != Math.Sign(dyLoc))
- rectSource.Y = rectTarget.Y;
- if (Math.Sign(rectTarget.Width - rectSource.Width) != Math.Sign(dWidth))
- rectSource.Width = rectTarget.Width;
- if (Math.Sign(rectTarget.Height - rectSource.Height) != Math.Sign(dHeight))
- rectSource.Height = rectTarget.Height;
-
- LayoutAnimateWindow(rectSource);
- if (Parent != null)
- Parent.Update();
-
- remainPixels -= speedFactor;
-
- while (true)
- {
- TimeSpan time = new TimeSpan(0, 0, 0, 0, ANIMATE_TIME);
- TimeSpan elapsedPerMove = DateTime.Now - startPerMove;
- TimeSpan elapsedTime = DateTime.Now - startingTime;
- if (((int)((time - elapsedTime).TotalMilliseconds)) <= 0)
- {
- speedFactor = remainPixels;
- break;
- }
- else
- speedFactor = remainPixels * (int)elapsedPerMove.TotalMilliseconds / (int)((time - elapsedTime).TotalMilliseconds);
- if (speedFactor >= 1)
- break;
- }
- }
- ResumeLayout();
- Parent.ResumeLayout();
- }
-
- private void LayoutAnimateWindow(Rectangle rect)
- {
- Bounds = DockPanel.GetAutoHideWindowBounds(rect);
-
- Rectangle rectClient = ClientRectangle;
-
- if (DockState == DockState.DockLeftAutoHide)
- ActivePane.Location = new Point(rectClient.Right - 2 - Measures.SplitterSize - ActivePane.Width, ActivePane.Location.Y);
- else if (DockState == DockState.DockTopAutoHide)
- ActivePane.Location = new Point(ActivePane.Location.X, rectClient.Bottom - 2 - Measures.SplitterSize - ActivePane.Height);
- }
-
- private Rectangle GetRectangle(bool show)
- {
- if (DockState == DockState.Unknown)
- return Rectangle.Empty;
-
- Rectangle rect = DockPanel.AutoHideWindowRectangle;
-
- if (show)
- return rect;
-
- if (DockState == DockState.DockLeftAutoHide)
- rect.Width = 0;
- else if (DockState == DockState.DockRightAutoHide)
- {
- rect.X += rect.Width;
- rect.Width = 0;
- }
- else if (DockState == DockState.DockTopAutoHide)
- rect.Height = 0;
- else
- {
- rect.Y += rect.Height;
- rect.Height = 0;
- }
-
- return rect;
- }
-
- private void SetTimerMouseTrack()
- {
- if (ActivePane == null || ActivePane.IsActivated || FlagDragging)
- {
- m_timerMouseTrack.Enabled = false;
- return;
- }
-
- // start the timer
- int hovertime = SystemInformation.MouseHoverTime ;
-
- // assign a default value 400 in case of setting Timer.Interval invalid value exception
- if (hovertime <= 0)
- hovertime = 400;
-
- m_timerMouseTrack.Interval = 2 * (int)hovertime;
- m_timerMouseTrack.Enabled = true;
- }
-
- protected virtual Rectangle DisplayingRectangle
- {
- get
- {
- Rectangle rect = ClientRectangle;
-
- // exclude the border and the splitter
- if (DockState == DockState.DockBottomAutoHide)
- {
- rect.Y += 2 + Measures.SplitterSize;
- rect.Height -= 2 + Measures.SplitterSize;
- }
- else if (DockState == DockState.DockRightAutoHide)
- {
- rect.X += 2 + Measures.SplitterSize;
- rect.Width -= 2 + Measures.SplitterSize;
- }
- else if (DockState == DockState.DockTopAutoHide)
- rect.Height -= 2 + Measures.SplitterSize;
- else if (DockState == DockState.DockLeftAutoHide)
- rect.Width -= 2 + Measures.SplitterSize;
-
- return rect;
- }
- }
-
- protected override void OnLayout(LayoutEventArgs levent)
- {
- DockPadding.All = 0;
- if (DockState == DockState.DockLeftAutoHide)
- {
- DockPadding.Right = 2;
- m_splitter.Dock = DockStyle.Right;
- }
- else if (DockState == DockState.DockRightAutoHide)
- {
- DockPadding.Left = 2;
- m_splitter.Dock = DockStyle.Left;
- }
- else if (DockState == DockState.DockTopAutoHide)
- {
- DockPadding.Bottom = 2;
- m_splitter.Dock = DockStyle.Bottom;
- }
- else if (DockState == DockState.DockBottomAutoHide)
- {
- DockPadding.Top = 2;
- m_splitter.Dock = DockStyle.Top;
- }
-
- Rectangle rectDisplaying = DisplayingRectangle;
- Rectangle rectHidden = new Rectangle(-rectDisplaying.Width, rectDisplaying.Y, rectDisplaying.Width, rectDisplaying.Height);
- foreach (Control c in Controls)
- {
- DockPane pane = c as DockPane;
- if (pane == null)
- continue;
-
-
- if (pane == ActivePane)
- pane.Bounds = rectDisplaying;
- else
- pane.Bounds = rectHidden;
- }
-
- base.OnLayout(levent);
- }
-
- protected override void OnPaint(PaintEventArgs e)
- {
- // Draw the border
- Graphics g = e.Graphics;
-
- if (DockState == DockState.DockBottomAutoHide)
- g.DrawLine(SystemPens.ControlLightLight, 0, 1, ClientRectangle.Right, 1);
- else if (DockState == DockState.DockRightAutoHide)
- g.DrawLine(SystemPens.ControlLightLight, 1, 0, 1, ClientRectangle.Bottom);
- else if (DockState == DockState.DockTopAutoHide)
- {
- g.DrawLine(SystemPens.ControlDark, 0, ClientRectangle.Height - 2, ClientRectangle.Right, ClientRectangle.Height - 2);
- g.DrawLine(SystemPens.ControlDarkDark, 0, ClientRectangle.Height - 1, ClientRectangle.Right, ClientRectangle.Height - 1);
- }
- else if (DockState == DockState.DockLeftAutoHide)
- {
- g.DrawLine(SystemPens.ControlDark, ClientRectangle.Width - 2, 0, ClientRectangle.Width - 2, ClientRectangle.Bottom);
- g.DrawLine(SystemPens.ControlDarkDark, ClientRectangle.Width - 1, 0, ClientRectangle.Width - 1, ClientRectangle.Bottom);
- }
-
- base.OnPaint(e);
- }
-
- public void RefreshActiveContent()
- {
- if (ActiveContent == null)
- return;
-
- if (!DockHelper.IsDockStateAutoHide(ActiveContent.DockHandler.DockState))
- {
- FlagAnimate = false;
- ActiveContent = null;
- FlagAnimate = true;
- }
- }
-
- public void RefreshActivePane()
- {
- SetTimerMouseTrack();
- }
-
- private void TimerMouseTrack_Tick(object sender, EventArgs e)
- {
- if (IsDisposed)
- return;
-
- if (ActivePane == null || ActivePane.IsActivated)
- {
- m_timerMouseTrack.Enabled = false;
- return;
- }
-
- DockPane pane = ActivePane;
- Point ptMouseInAutoHideWindow = PointToClient(Control.MousePosition);
- Point ptMouseInDockPanel = DockPanel.PointToClient(Control.MousePosition);
-
- Rectangle rectTabStrip = DockPanel.GetTabStripRectangle(pane.DockState);
-
- if (!ClientRectangle.Contains(ptMouseInAutoHideWindow) && !rectTabStrip.Contains(ptMouseInDockPanel))
- {
- ActiveContent = null;
- m_timerMouseTrack.Enabled = false;
- }
- }
-
- #region ISplitterDragSource Members
-
- void ISplitterDragSource.BeginDrag(Rectangle rectSplitter)
- {
- FlagDragging = true;
- }
-
- void ISplitterDragSource.EndDrag()
- {
- FlagDragging = false;
- }
-
- bool ISplitterDragSource.IsVertical
- {
- get { return (DockState == DockState.DockLeftAutoHide || DockState == DockState.DockRightAutoHide); }
- }
-
- Rectangle ISplitterDragSource.DragLimitBounds
- {
- get
- {
- Rectangle rectLimit = DockPanel.DockArea;
-
- if ((this as ISplitterDragSource).IsVertical)
- {
- rectLimit.X += MeasurePane.MinSize;
- rectLimit.Width -= 2 * MeasurePane.MinSize;
- }
- else
- {
- rectLimit.Y += MeasurePane.MinSize;
- rectLimit.Height -= 2 * MeasurePane.MinSize;
- }
-
- return DockPanel.RectangleToScreen(rectLimit);
- }
- }
-
- void ISplitterDragSource.MoveSplitter(int offset)
- {
- Rectangle rectDockArea = DockPanel.DockArea;
- IDockContent content = ActiveContent;
- if (DockState == DockState.DockLeftAutoHide && rectDockArea.Width > 0)
- {
- if (content.DockHandler.AutoHidePortion < 1)
- content.DockHandler.AutoHidePortion += ((double)offset) / (double)rectDockArea.Width;
- else
- content.DockHandler.AutoHidePortion = Width + offset;
- }
- else if (DockState == DockState.DockRightAutoHide && rectDockArea.Width > 0)
- {
- if (content.DockHandler.AutoHidePortion < 1)
- content.DockHandler.AutoHidePortion -= ((double)offset) / (double)rectDockArea.Width;
- else
- content.DockHandler.AutoHidePortion = Width - offset;
- }
- else if (DockState == DockState.DockBottomAutoHide && rectDockArea.Height > 0)
- {
- if (content.DockHandler.AutoHidePortion < 1)
- content.DockHandler.AutoHidePortion -= ((double)offset) / (double)rectDockArea.Height;
- else
- content.DockHandler.AutoHidePortion = Height - offset;
- }
- else if (DockState == DockState.DockTopAutoHide && rectDockArea.Height > 0)
- {
- if (content.DockHandler.AutoHidePortion < 1)
- content.DockHandler.AutoHidePortion += ((double)offset) / (double)rectDockArea.Height;
- else
- content.DockHandler.AutoHidePortion = Height + offset;
- }
- }
-
- #region IDragSource Members
-
- Control IDragSource.DragControl
- {
- get { return this; }
- }
-
- #endregion
-
- #endregion
- }
-
- private AutoHideWindowControl AutoHideWindow
- {
- get { return m_autoHideWindow; }
- }
-
- internal Control AutoHideControl
- {
- get { return m_autoHideWindow; }
- }
-
- internal void RefreshActiveAutoHideContent()
- {
- AutoHideWindow.RefreshActiveContent();
- }
-
- internal Rectangle AutoHideWindowRectangle
- {
- get
- {
- DockState state = AutoHideWindow.DockState;
- Rectangle rectDockArea = DockArea;
- if (ActiveAutoHideContent == null)
- return Rectangle.Empty;
-
- if (Parent == null)
- return Rectangle.Empty;
-
- Rectangle rect = Rectangle.Empty;
- double autoHideSize = ActiveAutoHideContent.DockHandler.AutoHidePortion;
- if (state == DockState.DockLeftAutoHide)
- {
- if (autoHideSize < 1)
- autoHideSize = rectDockArea.Width * autoHideSize;
- if (autoHideSize > rectDockArea.Width - MeasurePane.MinSize)
- autoHideSize = rectDockArea.Width - MeasurePane.MinSize;
- rect.X = rectDockArea.X;
- rect.Y = rectDockArea.Y;
- rect.Width = (int)autoHideSize;
- rect.Height = rectDockArea.Height;
- }
- else if (state == DockState.DockRightAutoHide)
- {
- if (autoHideSize < 1)
- autoHideSize = rectDockArea.Width * autoHideSize;
- if (autoHideSize > rectDockArea.Width - MeasurePane.MinSize)
- autoHideSize = rectDockArea.Width - MeasurePane.MinSize;
- rect.X = rectDockArea.X + rectDockArea.Width - (int)autoHideSize;
- rect.Y = rectDockArea.Y;
- rect.Width = (int)autoHideSize;
- rect.Height = rectDockArea.Height;
- }
- else if (state == DockState.DockTopAutoHide)
- {
- if (autoHideSize < 1)
- autoHideSize = rectDockArea.Height * autoHideSize;
- if (autoHideSize > rectDockArea.Height - MeasurePane.MinSize)
- autoHideSize = rectDockArea.Height - MeasurePane.MinSize;
- rect.X = rectDockArea.X;
- rect.Y = rectDockArea.Y;
- rect.Width = rectDockArea.Width;
- rect.Height = (int)autoHideSize;
- }
- else if (state == DockState.DockBottomAutoHide)
- {
- if (autoHideSize < 1)
- autoHideSize = rectDockArea.Height * autoHideSize;
- if (autoHideSize > rectDockArea.Height - MeasurePane.MinSize)
- autoHideSize = rectDockArea.Height - MeasurePane.MinSize;
- rect.X = rectDockArea.X;
- rect.Y = rectDockArea.Y + rectDockArea.Height - (int)autoHideSize;
- rect.Width = rectDockArea.Width;
- rect.Height = (int)autoHideSize;
- }
-
- return rect;
- }
- }
-
- internal Rectangle GetAutoHideWindowBounds(Rectangle rectAutoHideWindow)
- {
- if (DocumentStyle == DocumentStyle.SystemMdi ||
- DocumentStyle == DocumentStyle.DockingMdi)
- return (Parent == null) ? Rectangle.Empty : Parent.RectangleToClient(RectangleToScreen(rectAutoHideWindow));
- else
- return rectAutoHideWindow;
- }
-
- internal void RefreshAutoHideStrip()
- {
- AutoHideStripControl.RefreshChanges();
- }
-
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.DockDragHandler.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.DockDragHandler.cs
deleted file mode 100644
index dc3c15f1c7..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.DockDragHandler.cs
+++ /dev/null
@@ -1,811 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Windows.Forms;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.ComponentModel;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- partial class DockPanel
- {
- private sealed class DockDragHandler : DragHandler
- {
- private class DockIndicator : DragForm
- {
- #region IHitTest
- private interface IHitTest
- {
- DockStyle HitTest(Point pt);
- DockStyle Status { get; set; }
- }
- #endregion
-
- #region PanelIndicator
- private class PanelIndicator : PictureBox, IHitTest
- {
- private static Image _imagePanelLeft = Resources.DockIndicator_PanelLeft;
- private static Image _imagePanelRight = Resources.DockIndicator_PanelRight;
- private static Image _imagePanelTop = Resources.DockIndicator_PanelTop;
- private static Image _imagePanelBottom = Resources.DockIndicator_PanelBottom;
- private static Image _imagePanelFill = Resources.DockIndicator_PanelFill;
- private static Image _imagePanelLeftActive = Resources.DockIndicator_PanelLeft_Active;
- private static Image _imagePanelRightActive = Resources.DockIndicator_PanelRight_Active;
- private static Image _imagePanelTopActive = Resources.DockIndicator_PanelTop_Active;
- private static Image _imagePanelBottomActive = Resources.DockIndicator_PanelBottom_Active;
- private static Image _imagePanelFillActive = Resources.DockIndicator_PanelFill_Active;
-
- public PanelIndicator(DockStyle dockStyle)
- {
- m_dockStyle = dockStyle;
- SizeMode = PictureBoxSizeMode.AutoSize;
- Image = ImageInactive;
- }
-
- private DockStyle m_dockStyle;
- private DockStyle DockStyle
- {
- get { return m_dockStyle; }
- }
-
- private DockStyle m_status;
- public DockStyle Status
- {
- get { return m_status; }
- set
- {
- if (value != DockStyle && value != DockStyle.None)
- throw new InvalidEnumArgumentException();
-
- if (m_status == value)
- return;
-
- m_status = value;
- IsActivated = (m_status != DockStyle.None);
- }
- }
-
- private Image ImageInactive
- {
- get
- {
- if (DockStyle == DockStyle.Left)
- return _imagePanelLeft;
- else if (DockStyle == DockStyle.Right)
- return _imagePanelRight;
- else if (DockStyle == DockStyle.Top)
- return _imagePanelTop;
- else if (DockStyle == DockStyle.Bottom)
- return _imagePanelBottom;
- else if (DockStyle == DockStyle.Fill)
- return _imagePanelFill;
- else
- return null;
- }
- }
-
- private Image ImageActive
- {
- get
- {
- if (DockStyle == DockStyle.Left)
- return _imagePanelLeftActive;
- else if (DockStyle == DockStyle.Right)
- return _imagePanelRightActive;
- else if (DockStyle == DockStyle.Top)
- return _imagePanelTopActive;
- else if (DockStyle == DockStyle.Bottom)
- return _imagePanelBottomActive;
- else if (DockStyle == DockStyle.Fill)
- return _imagePanelFillActive;
- else
- return null;
- }
- }
-
- private bool m_isActivated = false;
- private bool IsActivated
- {
- get { return m_isActivated; }
- set
- {
- m_isActivated = value;
- Image = IsActivated ? ImageActive : ImageInactive;
- }
- }
-
- public DockStyle HitTest(Point pt)
- {
- return this.Visible && ClientRectangle.Contains(PointToClient(pt)) ? DockStyle : DockStyle.None;
- }
- }
- #endregion PanelIndicator
-
- #region PaneIndicator
- private class PaneIndicator : PictureBox, IHitTest
- {
- private struct HotSpotIndex
- {
- public HotSpotIndex(int x, int y, DockStyle dockStyle)
- {
- m_x = x;
- m_y = y;
- m_dockStyle = dockStyle;
- }
-
- private int m_x;
- public int X
- {
- get { return m_x; }
- }
-
- private int m_y;
- public int Y
- {
- get { return m_y; }
- }
-
- private DockStyle m_dockStyle;
- public DockStyle DockStyle
- {
- get { return m_dockStyle; }
- }
- }
-
- private static Bitmap _bitmapPaneDiamond = Resources.DockIndicator_PaneDiamond;
- private static Bitmap _bitmapPaneDiamondLeft = Resources.DockIndicator_PaneDiamond_Left;
- private static Bitmap _bitmapPaneDiamondRight = Resources.DockIndicator_PaneDiamond_Right;
- private static Bitmap _bitmapPaneDiamondTop = Resources.DockIndicator_PaneDiamond_Top;
- private static Bitmap _bitmapPaneDiamondBottom = Resources.DockIndicator_PaneDiamond_Bottom;
- private static Bitmap _bitmapPaneDiamondFill = Resources.DockIndicator_PaneDiamond_Fill;
- private static Bitmap _bitmapPaneDiamondHotSpot = Resources.DockIndicator_PaneDiamond_HotSpot;
- private static Bitmap _bitmapPaneDiamondHotSpotIndex = Resources.DockIndicator_PaneDiamond_HotSpotIndex;
- private static HotSpotIndex[] _hotSpots = new HotSpotIndex[]
- {
- new HotSpotIndex(1, 0, DockStyle.Top),
- new HotSpotIndex(0, 1, DockStyle.Left),
- new HotSpotIndex(1, 1, DockStyle.Fill),
- new HotSpotIndex(2, 1, DockStyle.Right),
- new HotSpotIndex(1, 2, DockStyle.Bottom)
- };
- private static GraphicsPath _displayingGraphicsPath = DrawHelper.CalculateGraphicsPathFromBitmap(_bitmapPaneDiamond);
-
- public PaneIndicator()
- {
- SizeMode = PictureBoxSizeMode.AutoSize;
- Image = _bitmapPaneDiamond;
- Region = new Region(DisplayingGraphicsPath);
- }
-
- public static GraphicsPath DisplayingGraphicsPath
- {
- get { return _displayingGraphicsPath; }
- }
-
- public DockStyle HitTest(Point pt)
- {
- if (!Visible)
- return DockStyle.None;
-
- pt = PointToClient(pt);
- if (!ClientRectangle.Contains(pt))
- return DockStyle.None;
-
- for (int i = _hotSpots.GetLowerBound(0); i <= _hotSpots.GetUpperBound(0); i++)
- {
- if (_bitmapPaneDiamondHotSpot.GetPixel(pt.X, pt.Y) == _bitmapPaneDiamondHotSpotIndex.GetPixel(_hotSpots[i].X, _hotSpots[i].Y))
- return _hotSpots[i].DockStyle;
- }
-
- return DockStyle.None;
- }
-
- private DockStyle m_status = DockStyle.None;
- public DockStyle Status
- {
- get { return m_status; }
- set
- {
- m_status = value;
- if (m_status == DockStyle.None)
- Image = _bitmapPaneDiamond;
- else if (m_status == DockStyle.Left)
- Image = _bitmapPaneDiamondLeft;
- else if (m_status == DockStyle.Right)
- Image = _bitmapPaneDiamondRight;
- else if (m_status == DockStyle.Top)
- Image = _bitmapPaneDiamondTop;
- else if (m_status == DockStyle.Bottom)
- Image = _bitmapPaneDiamondBottom;
- else if (m_status == DockStyle.Fill)
- Image = _bitmapPaneDiamondFill;
- }
- }
- }
- #endregion PaneIndicator
-
- #region consts
- private int _PanelIndicatorMargin = 10;
- #endregion
-
- private DockDragHandler m_dragHandler;
-
- public DockIndicator(DockDragHandler dragHandler)
- {
- m_dragHandler = dragHandler;
- Controls.AddRange(new Control[] {
- PaneDiamond,
- PanelLeft,
- PanelRight,
- PanelTop,
- PanelBottom,
- PanelFill
- });
- Region = new Region(Rectangle.Empty);
- }
-
- private PaneIndicator m_paneDiamond = null;
- private PaneIndicator PaneDiamond
- {
- get
- {
- if (m_paneDiamond == null)
- m_paneDiamond = new PaneIndicator();
-
- return m_paneDiamond;
- }
- }
-
- private PanelIndicator m_panelLeft = null;
- private PanelIndicator PanelLeft
- {
- get
- {
- if (m_panelLeft == null)
- m_panelLeft = new PanelIndicator(DockStyle.Left);
-
- return m_panelLeft;
- }
- }
-
- private PanelIndicator m_panelRight = null;
- private PanelIndicator PanelRight
- {
- get
- {
- if (m_panelRight == null)
- m_panelRight = new PanelIndicator(DockStyle.Right);
-
- return m_panelRight;
- }
- }
-
- private PanelIndicator m_panelTop = null;
- private PanelIndicator PanelTop
- {
- get
- {
- if (m_panelTop == null)
- m_panelTop = new PanelIndicator(DockStyle.Top);
-
- return m_panelTop;
- }
- }
-
- private PanelIndicator m_panelBottom = null;
- private PanelIndicator PanelBottom
- {
- get
- {
- if (m_panelBottom == null)
- m_panelBottom = new PanelIndicator(DockStyle.Bottom);
-
- return m_panelBottom;
- }
- }
-
- private PanelIndicator m_panelFill = null;
- private PanelIndicator PanelFill
- {
- get
- {
- if (m_panelFill == null)
- m_panelFill = new PanelIndicator(DockStyle.Fill);
-
- return m_panelFill;
- }
- }
-
- private bool m_fullPanelEdge = false;
- public bool FullPanelEdge
- {
- get { return m_fullPanelEdge; }
- set
- {
- if (m_fullPanelEdge == value)
- return;
-
- m_fullPanelEdge = value;
- RefreshChanges();
- }
- }
-
- public DockDragHandler DragHandler
- {
- get { return m_dragHandler; }
- }
-
- public DockPanel DockPanel
- {
- get { return DragHandler.DockPanel; }
- }
-
- private DockPane m_dockPane = null;
- public DockPane DockPane
- {
- get { return m_dockPane; }
- internal set
- {
- if (m_dockPane == value)
- return;
-
- DockPane oldDisplayingPane = DisplayingPane;
- m_dockPane = value;
- if (oldDisplayingPane != DisplayingPane)
- RefreshChanges();
- }
- }
-
- private IHitTest m_hitTest = null;
- private IHitTest HitTestResult
- {
- get { return m_hitTest; }
- set
- {
- if (m_hitTest == value)
- return;
-
- if (m_hitTest != null)
- m_hitTest.Status = DockStyle.None;
-
- m_hitTest = value;
- }
- }
-
- private DockPane DisplayingPane
- {
- get { return ShouldPaneDiamondVisible() ? DockPane : null; }
- }
-
- private void RefreshChanges()
- {
- Region region = new Region(Rectangle.Empty);
- Rectangle rectDockArea = FullPanelEdge ? DockPanel.DockArea : DockPanel.DocumentWindowBounds;
-
- rectDockArea = RectangleToClient(DockPanel.RectangleToScreen(rectDockArea));
- if (ShouldPanelIndicatorVisible(DockState.DockLeft))
- {
- PanelLeft.Location = new Point(rectDockArea.X + _PanelIndicatorMargin, rectDockArea.Y + (rectDockArea.Height - PanelRight.Height) / 2);
- PanelLeft.Visible = true;
- region.Union(PanelLeft.Bounds);
- }
- else
- PanelLeft.Visible = false;
-
- if (ShouldPanelIndicatorVisible(DockState.DockRight))
- {
- PanelRight.Location = new Point(rectDockArea.X + rectDockArea.Width - PanelRight.Width - _PanelIndicatorMargin, rectDockArea.Y + (rectDockArea.Height - PanelRight.Height) / 2);
- PanelRight.Visible = true;
- region.Union(PanelRight.Bounds);
- }
- else
- PanelRight.Visible = false;
-
- if (ShouldPanelIndicatorVisible(DockState.DockTop))
- {
- PanelTop.Location = new Point(rectDockArea.X + (rectDockArea.Width - PanelTop.Width) / 2, rectDockArea.Y + _PanelIndicatorMargin);
- PanelTop.Visible = true;
- region.Union(PanelTop.Bounds);
- }
- else
- PanelTop.Visible = false;
-
- if (ShouldPanelIndicatorVisible(DockState.DockBottom))
- {
- PanelBottom.Location = new Point(rectDockArea.X + (rectDockArea.Width - PanelBottom.Width) / 2, rectDockArea.Y + rectDockArea.Height - PanelBottom.Height - _PanelIndicatorMargin);
- PanelBottom.Visible = true;
- region.Union(PanelBottom.Bounds);
- }
- else
- PanelBottom.Visible = false;
-
- if (ShouldPanelIndicatorVisible(DockState.Document))
- {
- Rectangle rectDocumentWindow = RectangleToClient(DockPanel.RectangleToScreen(DockPanel.DocumentWindowBounds));
- PanelFill.Location = new Point(rectDocumentWindow.X + (rectDocumentWindow.Width - PanelFill.Width) / 2, rectDocumentWindow.Y + (rectDocumentWindow.Height - PanelFill.Height) / 2);
- PanelFill.Visible = true;
- region.Union(PanelFill.Bounds);
- }
- else
- PanelFill.Visible = false;
-
- if (ShouldPaneDiamondVisible())
- {
- Rectangle rect = RectangleToClient(DockPane.RectangleToScreen(DockPane.ClientRectangle));
- PaneDiamond.Location = new Point(rect.Left + (rect.Width - PaneDiamond.Width) / 2, rect.Top + (rect.Height - PaneDiamond.Height) / 2);
- PaneDiamond.Visible = true;
- using (GraphicsPath graphicsPath = PaneIndicator.DisplayingGraphicsPath.Clone() as GraphicsPath)
- {
- Point[] pts = new Point[]
- {
- new Point(PaneDiamond.Left, PaneDiamond.Top),
- new Point(PaneDiamond.Right, PaneDiamond.Top),
- new Point(PaneDiamond.Left, PaneDiamond.Bottom)
- };
- using (Matrix matrix = new Matrix(PaneDiamond.ClientRectangle, pts))
- {
- graphicsPath.Transform(matrix);
- }
- region.Union(graphicsPath);
- }
- }
- else
- PaneDiamond.Visible = false;
-
- Region = region;
- }
-
- private bool ShouldPanelIndicatorVisible(DockState dockState)
- {
- if (!Visible)
- return false;
-
- if (DockPanel.DockWindows[dockState].Visible)
- return false;
-
- return DragHandler.DragSource.IsDockStateValid(dockState);
- }
-
- private bool ShouldPaneDiamondVisible()
- {
- if (DockPane == null)
- return false;
-
- if (!DockPanel.AllowEndUserNestedDocking)
- return false;
-
- return DragHandler.DragSource.CanDockTo(DockPane);
- }
-
- public override void Show(bool bActivate)
- {
- base.Show(bActivate);
- Bounds = SystemInformation.VirtualScreen;
- RefreshChanges();
- }
-
- public void TestDrop()
- {
- Point pt = Control.MousePosition;
- DockPane = DockHelper.PaneAtPoint(pt, DockPanel);
-
- if (TestDrop(PanelLeft, pt) != DockStyle.None)
- HitTestResult = PanelLeft;
- else if (TestDrop(PanelRight, pt) != DockStyle.None)
- HitTestResult = PanelRight;
- else if (TestDrop(PanelTop, pt) != DockStyle.None)
- HitTestResult = PanelTop;
- else if (TestDrop(PanelBottom, pt) != DockStyle.None)
- HitTestResult = PanelBottom;
- else if (TestDrop(PanelFill, pt) != DockStyle.None)
- HitTestResult = PanelFill;
- else if (TestDrop(PaneDiamond, pt) != DockStyle.None)
- HitTestResult = PaneDiamond;
- else
- HitTestResult = null;
-
- if (HitTestResult != null)
- {
- if (HitTestResult is PaneIndicator)
- DragHandler.Outline.Show(DockPane, HitTestResult.Status);
- else
- DragHandler.Outline.Show(DockPanel, HitTestResult.Status, FullPanelEdge);
- }
- }
-
- private static DockStyle TestDrop(IHitTest hitTest, Point pt)
- {
- return hitTest.Status = hitTest.HitTest(pt);
- }
- }
-
- private class DockOutline : DockOutlineBase
- {
- public DockOutline()
- {
- m_dragForm = new DragForm();
- SetDragForm(Rectangle.Empty);
- DragForm.BackColor = SystemColors.ActiveCaption;
- DragForm.Opacity = 0.5;
- DragForm.Show(false);
- }
-
- DragForm m_dragForm;
- private DragForm DragForm
- {
- get { return m_dragForm; }
- }
-
- protected override void OnShow()
- {
- CalculateRegion();
- }
-
- protected override void OnClose()
- {
- DragForm.Close();
- }
-
- private void CalculateRegion()
- {
- if (SameAsOldValue)
- return;
-
- if (!FloatWindowBounds.IsEmpty)
- SetOutline(FloatWindowBounds);
- else if (DockTo is DockPanel)
- SetOutline(DockTo as DockPanel, Dock, (ContentIndex != 0));
- else if (DockTo is DockPane)
- SetOutline(DockTo as DockPane, Dock, ContentIndex);
- else
- SetOutline();
- }
-
- private void SetOutline()
- {
- SetDragForm(Rectangle.Empty);
- }
-
- private void SetOutline(Rectangle floatWindowBounds)
- {
- SetDragForm(floatWindowBounds);
- }
-
- private void SetOutline(DockPanel dockPanel, DockStyle dock, bool fullPanelEdge)
- {
- Rectangle rect = fullPanelEdge ? dockPanel.DockArea : dockPanel.DocumentWindowBounds;
- rect.Location = dockPanel.PointToScreen(rect.Location);
- if (dock == DockStyle.Top)
- {
- int height = dockPanel.GetDockWindowSize(DockState.DockTop);
- rect = new Rectangle(rect.X, rect.Y, rect.Width, height);
- }
- else if (dock == DockStyle.Bottom)
- {
- int height = dockPanel.GetDockWindowSize(DockState.DockBottom);
- rect = new Rectangle(rect.X, rect.Bottom - height, rect.Width, height);
- }
- else if (dock == DockStyle.Left)
- {
- int width = dockPanel.GetDockWindowSize(DockState.DockLeft);
- rect = new Rectangle(rect.X, rect.Y, width, rect.Height);
- }
- else if (dock == DockStyle.Right)
- {
- int width = dockPanel.GetDockWindowSize(DockState.DockRight);
- rect = new Rectangle(rect.Right - width, rect.Y, width, rect.Height);
- }
- else if (dock == DockStyle.Fill)
- {
- rect = dockPanel.DocumentWindowBounds;
- rect.Location = dockPanel.PointToScreen(rect.Location);
- }
-
- SetDragForm(rect);
- }
-
- private void SetOutline(DockPane pane, DockStyle dock, int contentIndex)
- {
- if (dock != DockStyle.Fill)
- {
- Rectangle rect = pane.DisplayingRectangle;
- if (dock == DockStyle.Right)
- rect.X += rect.Width / 2;
- if (dock == DockStyle.Bottom)
- rect.Y += rect.Height / 2;
- if (dock == DockStyle.Left || dock == DockStyle.Right)
- rect.Width -= rect.Width / 2;
- if (dock == DockStyle.Top || dock == DockStyle.Bottom)
- rect.Height -= rect.Height / 2;
- rect.Location = pane.PointToScreen(rect.Location);
-
- SetDragForm(rect);
- }
- else if (contentIndex == -1)
- {
- Rectangle rect = pane.DisplayingRectangle;
- rect.Location = pane.PointToScreen(rect.Location);
- SetDragForm(rect);
- }
- else
- {
- using (GraphicsPath path = pane.TabStripControl.GetOutline(contentIndex))
- {
- RectangleF rectF = path.GetBounds();
- Rectangle rect = new Rectangle((int)rectF.X, (int)rectF.Y, (int)rectF.Width, (int)rectF.Height);
- using (Matrix matrix = new Matrix(rect, new Point[] { new Point(0, 0), new Point(rect.Width, 0), new Point(0, rect.Height) }))
- {
- path.Transform(matrix);
- }
- Region region = new Region(path);
- SetDragForm(rect, region);
- }
- }
- }
-
- private void SetDragForm(Rectangle rect)
- {
- DragForm.Bounds = rect;
- if (rect == Rectangle.Empty)
- DragForm.Region = new Region(Rectangle.Empty);
- else if (DragForm.Region != null)
- DragForm.Region = null;
- }
-
- private void SetDragForm(Rectangle rect, Region region)
- {
- DragForm.Bounds = rect;
- DragForm.Region = region;
- }
- }
-
- public DockDragHandler(DockPanel panel)
- : base(panel)
- {
- }
-
- public new IDockDragSource DragSource
- {
- get { return base.DragSource as IDockDragSource; }
- set { base.DragSource = value; }
- }
-
- private DockOutlineBase m_outline;
- public DockOutlineBase Outline
- {
- get { return m_outline; }
- private set { m_outline = value; }
- }
-
- private DockIndicator m_indicator;
- private DockIndicator Indicator
- {
- get { return m_indicator; }
- set { m_indicator = value; }
- }
-
- private Rectangle m_floatOutlineBounds;
- private Rectangle FloatOutlineBounds
- {
- get { return m_floatOutlineBounds; }
- set { m_floatOutlineBounds = value; }
- }
-
- public void BeginDrag(IDockDragSource dragSource)
- {
- DragSource = dragSource;
-
- if (!BeginDrag())
- {
- DragSource = null;
- return;
- }
-
- Outline = new DockOutline();
- Indicator = new DockIndicator(this);
- Indicator.Show(false);
-
- FloatOutlineBounds = DragSource.BeginDrag(StartMousePosition);
- }
-
- protected override void OnDragging()
- {
- TestDrop();
- }
-
- protected override void OnEndDrag(bool abort)
- {
- DockPanel.SuspendLayout(true);
-
- Outline.Close();
- Indicator.Close();
-
- EndDrag(abort);
-
- DockPanel.ResumeLayout(true, true);
-
- DragSource = null;
- }
-
- private void TestDrop()
- {
- Outline.FlagTestDrop = false;
-
- Indicator.FullPanelEdge = ((Control.ModifierKeys & Keys.Shift) != 0);
-
- if ((Control.ModifierKeys & Keys.Control) == 0)
- {
- Indicator.TestDrop();
-
- if (!Outline.FlagTestDrop)
- {
- DockPane pane = DockHelper.PaneAtPoint(Control.MousePosition, DockPanel);
- if (pane != null && DragSource.IsDockStateValid(pane.DockState))
- pane.TestDrop(DragSource, Outline);
- }
-
- if (!Outline.FlagTestDrop && DragSource.IsDockStateValid(DockState.Float))
- {
- FloatWindow floatWindow = DockHelper.FloatWindowAtPoint(Control.MousePosition, DockPanel);
- if (floatWindow != null)
- floatWindow.TestDrop(DragSource, Outline);
- }
- }
- else
- Indicator.DockPane = DockHelper.PaneAtPoint(Control.MousePosition, DockPanel);
-
- if (!Outline.FlagTestDrop)
- {
- if (DragSource.IsDockStateValid(DockState.Float))
- {
- Rectangle rect = FloatOutlineBounds;
- rect.Offset(Control.MousePosition.X - StartMousePosition.X, Control.MousePosition.Y - StartMousePosition.Y);
- Outline.Show(rect);
- }
- }
-
- if (!Outline.FlagTestDrop)
- {
- Cursor.Current = Cursors.No;
- Outline.Show();
- }
- else
- Cursor.Current = DragControl.Cursor;
- }
-
- private void EndDrag(bool abort)
- {
- if (abort)
- return;
-
- if (!Outline.FloatWindowBounds.IsEmpty)
- DragSource.FloatAt(Outline.FloatWindowBounds);
- else if (Outline.DockTo is DockPane)
- {
- DockPane pane = Outline.DockTo as DockPane;
- DragSource.DockTo(pane, Outline.Dock, Outline.ContentIndex);
- }
- else if (Outline.DockTo is DockPanel)
- {
- DockPanel panel = Outline.DockTo as DockPanel;
- panel.UpdateDockWindowZOrder(Outline.Dock, Outline.FlagFullEdge);
- DragSource.DockTo(panel, Outline.Dock);
- }
- }
- }
-
- private DockDragHandler m_dockDragHandler = null;
- private DockDragHandler GetDockDragHandler()
- {
- if (m_dockDragHandler == null)
- m_dockDragHandler = new DockDragHandler(this);
- return m_dockDragHandler;
- }
-
- internal void BeginDrag(IDockDragSource dragSource)
- {
- GetDockDragHandler().BeginDrag(dragSource);
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.DragHandler.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.DragHandler.cs
deleted file mode 100644
index 46a1e09530..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.DragHandler.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Windows.Forms;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.ComponentModel;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- partial class DockPanel
- {
- ///
- /// DragHandlerBase is the base class for drag handlers. The derived class should:
- /// 1. Define its public method BeginDrag. From within this public BeginDrag method,
- /// DragHandlerBase.BeginDrag should be called to initialize the mouse capture
- /// and message filtering.
- /// 2. Override the OnDragging and OnEndDrag methods.
- ///
- private abstract class DragHandlerBase : NativeWindow, IMessageFilter
- {
- protected DragHandlerBase()
- {
- }
-
- protected abstract Control DragControl
- {
- get;
- }
-
- private Point m_startMousePosition = Point.Empty;
- protected Point StartMousePosition
- {
- get { return m_startMousePosition; }
- private set { m_startMousePosition = value; }
- }
-
- protected bool BeginDrag()
- {
- // Avoid re-entrance;
- lock (this)
- {
- if (DragControl == null)
- return false;
-
- StartMousePosition = Control.MousePosition;
-
- if (!NativeMethods.DragDetect(DragControl.Handle, StartMousePosition))
- return false;
-
- DragControl.FindForm().Capture = true;
- AssignHandle(DragControl.FindForm().Handle);
- Application.AddMessageFilter(this);
- return true;
- }
- }
-
- protected abstract void OnDragging();
-
- protected abstract void OnEndDrag(bool abort);
-
- private void EndDrag(bool abort)
- {
- ReleaseHandle();
- Application.RemoveMessageFilter(this);
- DragControl.FindForm().Capture = false;
-
- OnEndDrag(abort);
- }
-
- bool IMessageFilter.PreFilterMessage(ref Message m)
- {
- if (m.Msg == (int)Win32.Msgs.WM_MOUSEMOVE)
- OnDragging();
- else if (m.Msg == (int)Win32.Msgs.WM_LBUTTONUP)
- EndDrag(false);
- else if (m.Msg == (int)Win32.Msgs.WM_CAPTURECHANGED)
- EndDrag(true);
- else if (m.Msg == (int)Win32.Msgs.WM_KEYDOWN && (int)m.WParam == (int)Keys.Escape)
- EndDrag(true);
-
- return OnPreFilterMessage(ref m);
- }
-
- protected virtual bool OnPreFilterMessage(ref Message m)
- {
- return false;
- }
-
- protected sealed override void WndProc(ref Message m)
- {
- if (m.Msg == (int)Win32.Msgs.WM_CANCELMODE || m.Msg == (int)Win32.Msgs.WM_CAPTURECHANGED)
- EndDrag(true);
-
- base.WndProc(ref m);
- }
- }
-
- private abstract class DragHandler : DragHandlerBase
- {
- private DockPanel m_dockPanel;
-
- protected DragHandler(DockPanel dockPanel)
- {
- m_dockPanel = dockPanel;
- }
-
- public DockPanel DockPanel
- {
- get { return m_dockPanel; }
- }
-
- private IDragSource m_dragSource;
- protected IDragSource DragSource
- {
- get { return m_dragSource; }
- set { m_dragSource = value; }
- }
-
- protected sealed override Control DragControl
- {
- get { return DragSource == null ? null : DragSource.DragControl; }
- }
-
- protected sealed override bool OnPreFilterMessage(ref Message m)
- {
- if ((m.Msg == (int)Win32.Msgs.WM_KEYDOWN || m.Msg == (int)Win32.Msgs.WM_KEYUP) &&
- ((int)m.WParam == (int)Keys.ControlKey || (int)m.WParam == (int)Keys.ShiftKey))
- OnDragging();
-
- return base.OnPreFilterMessage(ref m);
- }
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.FocusManager.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.FocusManager.cs
deleted file mode 100644
index 9621c02037..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.FocusManager.cs
+++ /dev/null
@@ -1,571 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-using System.Windows.Forms;
-using System.Diagnostics.CodeAnalysis;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal interface IContentFocusManager
- {
- void Activate(IDockContent content);
- void GiveUpFocus(IDockContent content);
- void AddToList(IDockContent content);
- void RemoveFromList(IDockContent content);
- }
-
- partial class DockPanel
- {
- private interface IFocusManager
- {
- void SuspendFocusTracking();
- void ResumeFocusTracking();
- bool IsFocusTrackingSuspended { get; }
- IDockContent ActiveContent { get; }
- DockPane ActivePane { get; }
- IDockContent ActiveDocument { get; }
- DockPane ActiveDocumentPane { get; }
- }
-
- private class FocusManagerImpl : Component, IContentFocusManager, IFocusManager
- {
- private class HookEventArgs : EventArgs
- {
- [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
- public int HookCode;
- [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
- public IntPtr wParam;
- public IntPtr lParam;
- }
-
- private class LocalWindowsHook : IDisposable
- {
- // Internal properties
- private IntPtr m_hHook = IntPtr.Zero;
- private NativeMethods.HookProc m_filterFunc = null;
- private Win32.HookType m_hookType;
-
- // Event delegate
- public delegate void HookEventHandler(object sender, HookEventArgs e);
-
- // Event: HookInvoked
- public event HookEventHandler HookInvoked;
- protected void OnHookInvoked(HookEventArgs e)
- {
- if (HookInvoked != null)
- HookInvoked(this, e);
- }
-
- public LocalWindowsHook(Win32.HookType hook)
- {
- m_hookType = hook;
- m_filterFunc = new NativeMethods.HookProc(this.CoreHookProc);
- }
-
- // Default filter function
- public IntPtr CoreHookProc(int code, IntPtr wParam, IntPtr lParam)
- {
- if (code < 0)
- return NativeMethods.CallNextHookEx(m_hHook, code, wParam, lParam);
-
- // Let clients determine what to do
- HookEventArgs e = new HookEventArgs();
- e.HookCode = code;
- e.wParam = wParam;
- e.lParam = lParam;
- OnHookInvoked(e);
-
- // Yield to the next hook in the chain
- return NativeMethods.CallNextHookEx(m_hHook, code, wParam, lParam);
- }
-
- // Install the hook
- public void Install()
- {
- if (m_hHook != IntPtr.Zero)
- Uninstall();
-
- int threadId = NativeMethods.GetCurrentThreadId();
- m_hHook = NativeMethods.SetWindowsHookEx(m_hookType, m_filterFunc, IntPtr.Zero, threadId);
- }
-
- // Uninstall the hook
- public void Uninstall()
- {
- if (m_hHook != IntPtr.Zero)
- {
- NativeMethods.UnhookWindowsHookEx(m_hHook);
- m_hHook = IntPtr.Zero;
- }
- }
-
- ~LocalWindowsHook()
- {
- Dispose(false);
- }
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- protected virtual void Dispose(bool disposing)
- {
- Uninstall();
- }
- }
-
- private LocalWindowsHook m_localWindowsHook;
- private LocalWindowsHook.HookEventHandler m_hookEventHandler;
-
- public FocusManagerImpl(DockPanel dockPanel)
- {
- m_dockPanel = dockPanel;
- m_localWindowsHook = new LocalWindowsHook(Win32.HookType.WH_CALLWNDPROCRET);
- m_hookEventHandler = new LocalWindowsHook.HookEventHandler(HookEventHandler);
- m_localWindowsHook.HookInvoked += m_hookEventHandler;
- m_localWindowsHook.Install();
- }
-
- private DockPanel m_dockPanel;
- public DockPanel DockPanel
- {
- get { return m_dockPanel; }
- }
-
- private bool m_disposed = false;
- protected override void Dispose(bool disposing)
- {
- lock (this)
- {
- if (!m_disposed && disposing)
- {
- m_localWindowsHook.Dispose();
- m_disposed = true;
- }
-
- base.Dispose(disposing);
- }
- }
-
- private IDockContent m_contentActivating = null;
- private IDockContent ContentActivating
- {
- get { return m_contentActivating; }
- set { m_contentActivating = value; }
- }
-
- public void Activate(IDockContent content)
- {
- if (IsFocusTrackingSuspended)
- {
- ContentActivating = content;
- return;
- }
-
- if (content.IsDisposed)
- return;
-
- if (content == null)
- return;
- DockContentHandler handler = content.DockHandler;
- if (handler.Form.IsDisposed)
- return; // Should not reach here, but better than throwing an exception
- if (ContentContains(content, handler.ActiveWindowHandle))
- 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
- NativeMethods.SetFocus(handler.Form.Handle);
- }
- }
-
- private List m_listContent = new List();
- private List ListContent
- {
- get { return m_listContent; }
- }
- public void AddToList(IDockContent content)
- {
- if (ListContent.Contains(content) || IsInActiveList(content))
- return;
-
- ListContent.Add(content);
- }
-
- public void RemoveFromList(IDockContent content)
- {
- if (IsInActiveList(content))
- RemoveFromActiveList(content);
- if (ListContent.Contains(content))
- ListContent.Remove(content);
- }
-
- private IDockContent m_lastActiveContent = null;
- private IDockContent LastActiveContent
- {
- get { return m_lastActiveContent; }
- set { m_lastActiveContent = value; }
- }
-
- private bool IsInActiveList(IDockContent content)
- {
- return !(content.DockHandler.NextActive == null && LastActiveContent != content);
- }
-
- private void AddLastToActiveList(IDockContent content)
- {
- IDockContent last = LastActiveContent;
- if (last == content)
- return;
-
- DockContentHandler handler = content.DockHandler;
-
- if (IsInActiveList(content))
- RemoveFromActiveList(content);
-
- handler.PreviousActive = last;
- handler.NextActive = null;
- LastActiveContent = content;
- if (last != null)
- last.DockHandler.NextActive = LastActiveContent;
- }
-
- private void RemoveFromActiveList(IDockContent content)
- {
- if (LastActiveContent == content)
- LastActiveContent = content.DockHandler.PreviousActive;
-
- IDockContent prev = content.DockHandler.PreviousActive;
- IDockContent next = content.DockHandler.NextActive;
- if (prev != null)
- prev.DockHandler.NextActive = next;
- if (next != null)
- next.DockHandler.PreviousActive = prev;
-
- content.DockHandler.PreviousActive = null;
- content.DockHandler.NextActive = null;
- }
-
- public void GiveUpFocus(IDockContent content)
- {
- DockContentHandler handler = content.DockHandler;
- if (!handler.Form.ContainsFocus)
- return;
-
- if (IsFocusTrackingSuspended)
- DockPanel.DummyControl.Focus();
-
- if (LastActiveContent == content)
- {
- IDockContent prev = handler.PreviousActive;
- if (prev != null)
- Activate(prev);
- else if (ListContent.Count > 0)
- Activate(ListContent[ListContent.Count - 1]);
- }
- else if (LastActiveContent != null)
- Activate(LastActiveContent);
- else if (ListContent.Count > 0)
- Activate(ListContent[ListContent.Count - 1]);
- }
-
- private static bool ContentContains(IDockContent content, IntPtr hWnd)
- {
- Control control = Control.FromChildHandle(hWnd);
- for (Control parent = control; parent != null; parent = parent.Parent)
- if (parent == content.DockHandler.Form)
- return true;
-
- return false;
- }
-
- private int m_countSuspendFocusTracking = 0;
- public void SuspendFocusTracking()
- {
- m_countSuspendFocusTracking++;
- m_localWindowsHook.HookInvoked -= m_hookEventHandler;
- }
-
- public void ResumeFocusTracking()
- {
- if (m_countSuspendFocusTracking > 0)
- m_countSuspendFocusTracking--;
-
- if (m_countSuspendFocusTracking == 0)
- {
- if (ContentActivating != null)
- {
- Activate(ContentActivating);
- ContentActivating = null;
- }
- m_localWindowsHook.HookInvoked += m_hookEventHandler;
- if (!InRefreshActiveWindow)
- RefreshActiveWindow();
- }
- }
-
- public bool IsFocusTrackingSuspended
- {
- get { return m_countSuspendFocusTracking != 0; }
- }
-
- // Windows hook event handler
- private void HookEventHandler(object sender, HookEventArgs e)
- {
- Win32.Msgs msg = (Win32.Msgs)Marshal.ReadInt32(e.lParam, IntPtr.Size * 3);
-
- if (msg == Win32.Msgs.WM_KILLFOCUS)
- {
- IntPtr wParam = Marshal.ReadIntPtr(e.lParam, IntPtr.Size * 2);
- DockPane pane = GetPaneFromHandle(wParam);
- if (pane == null)
- RefreshActiveWindow();
- }
- else if (msg == Win32.Msgs.WM_SETFOCUS)
- RefreshActiveWindow();
- }
-
- private DockPane GetPaneFromHandle(IntPtr hWnd)
- {
- Control control = Control.FromChildHandle(hWnd);
-
- IDockContent content = null;
- DockPane pane = null;
- for (; control != null; control = control.Parent)
- {
- content = control as IDockContent;
- if (content != null)
- content.DockHandler.ActiveWindowHandle = hWnd;
-
- if (content != null && content.DockHandler.DockPanel == DockPanel)
- return content.DockHandler.Pane;
-
- pane = control as DockPane;
- if (pane != null && pane.DockPanel == DockPanel)
- break;
- }
-
- return pane;
- }
-
- private bool m_inRefreshActiveWindow = false;
- private bool InRefreshActiveWindow
- {
- get { return m_inRefreshActiveWindow; }
- }
-
- private void RefreshActiveWindow()
- {
- SuspendFocusTracking();
- m_inRefreshActiveWindow = true;
-
- DockPane oldActivePane = ActivePane;
- IDockContent oldActiveContent = ActiveContent;
- IDockContent oldActiveDocument = ActiveDocument;
-
- SetActivePane();
- SetActiveContent();
- SetActiveDocumentPane();
- SetActiveDocument();
- DockPanel.AutoHideWindow.RefreshActivePane();
-
- ResumeFocusTracking();
- m_inRefreshActiveWindow = false;
-
- if (oldActiveContent != ActiveContent)
- DockPanel.OnActiveContentChanged(EventArgs.Empty);
- if (oldActiveDocument != ActiveDocument)
- DockPanel.OnActiveDocumentChanged(EventArgs.Empty);
- if (oldActivePane != ActivePane)
- DockPanel.OnActivePaneChanged(EventArgs.Empty);
- }
-
- private DockPane m_activePane = null;
- public DockPane ActivePane
- {
- get { return m_activePane; }
- }
-
- private void SetActivePane()
- {
- DockPane value = GetPaneFromHandle(NativeMethods.GetFocus());
- if (m_activePane == value)
- return;
-
- if (m_activePane != null)
- m_activePane.SetIsActivated(false);
-
- m_activePane = value;
-
- if (m_activePane != null)
- m_activePane.SetIsActivated(true);
- }
-
- private IDockContent m_activeContent = null;
- public IDockContent ActiveContent
- {
- get { return m_activeContent; }
- }
-
- internal void SetActiveContent()
- {
- IDockContent value = ActivePane == null ? null : ActivePane.ActiveContent;
-
- if (m_activeContent == value)
- return;
-
- if (m_activeContent != null)
- m_activeContent.DockHandler.IsActivated = false;
-
- m_activeContent = value;
-
- if (m_activeContent != null)
- {
- m_activeContent.DockHandler.IsActivated = true;
- if (!DockHelper.IsDockStateAutoHide((m_activeContent.DockHandler.DockState)))
- AddLastToActiveList(m_activeContent);
- }
- }
-
- private DockPane m_activeDocumentPane = null;
- public DockPane ActiveDocumentPane
- {
- get { return m_activeDocumentPane; }
- }
-
- private void SetActiveDocumentPane()
- {
- DockPane value = null;
-
- if (ActivePane != null && ActivePane.DockState == DockState.Document)
- value = ActivePane;
-
- if (value == null && DockPanel.DockWindows != null)
- {
- if (ActiveDocumentPane == null)
- value = DockPanel.DockWindows[DockState.Document].DefaultPane;
- else if (ActiveDocumentPane.DockPanel != DockPanel || ActiveDocumentPane.DockState != DockState.Document)
- value = DockPanel.DockWindows[DockState.Document].DefaultPane;
- else
- value = ActiveDocumentPane;
- }
-
- if (m_activeDocumentPane == value)
- return;
-
- if (m_activeDocumentPane != null)
- m_activeDocumentPane.SetIsActiveDocumentPane(false);
-
- m_activeDocumentPane = value;
-
- if (m_activeDocumentPane != null)
- m_activeDocumentPane.SetIsActiveDocumentPane(true);
- }
-
- private IDockContent m_activeDocument = null;
- public IDockContent ActiveDocument
- {
- get { return m_activeDocument; }
- }
-
- private void SetActiveDocument()
- {
- IDockContent value = ActiveDocumentPane == null ? null : ActiveDocumentPane.ActiveContent;
-
- if (m_activeDocument == value)
- return;
-
- m_activeDocument = value;
- }
- }
-
- private IFocusManager FocusManager
- {
- get { return m_focusManager; }
- }
-
- internal IContentFocusManager ContentFocusManager
- {
- get { return m_focusManager; }
- }
-
- internal void SaveFocus()
- {
- DummyControl.Focus();
- }
-
- [Browsable(false)]
- public IDockContent ActiveContent
- {
- get { return FocusManager.ActiveContent; }
- }
-
- [Browsable(false)]
- public DockPane ActivePane
- {
- get { return FocusManager.ActivePane; }
- }
-
- [Browsable(false)]
- public IDockContent ActiveDocument
- {
- get { return FocusManager.ActiveDocument; }
- }
-
- [Browsable(false)]
- public DockPane ActiveDocumentPane
- {
- get { return FocusManager.ActiveDocumentPane; }
- }
-
- private static readonly object ActiveDocumentChangedEvent = new object();
- [LocalizedCategory("Category_PropertyChanged")]
- [LocalizedDescription("DockPanel_ActiveDocumentChanged_Description")]
- public event EventHandler ActiveDocumentChanged
- {
- add { Events.AddHandler(ActiveDocumentChangedEvent, value); }
- remove { Events.RemoveHandler(ActiveDocumentChangedEvent, value); }
- }
- protected virtual void OnActiveDocumentChanged(EventArgs e)
- {
- EventHandler handler = (EventHandler)Events[ActiveDocumentChangedEvent];
- if (handler != null)
- handler(this, e);
- }
-
- private static readonly object ActiveContentChangedEvent = new object();
- [LocalizedCategory("Category_PropertyChanged")]
- [LocalizedDescription("DockPanel_ActiveContentChanged_Description")]
- public event EventHandler ActiveContentChanged
- {
- add { Events.AddHandler(ActiveContentChangedEvent, value); }
- remove { Events.RemoveHandler(ActiveContentChangedEvent, value); }
- }
- protected void OnActiveContentChanged(EventArgs e)
- {
- EventHandler handler = (EventHandler)Events[ActiveContentChangedEvent];
- if (handler != null)
- handler(this, e);
- }
-
- private static readonly object ActivePaneChangedEvent = new object();
- [LocalizedCategory("Category_PropertyChanged")]
- [LocalizedDescription("DockPanel_ActivePaneChanged_Description")]
- public event EventHandler ActivePaneChanged
- {
- add { Events.AddHandler(ActivePaneChangedEvent, value); }
- remove { Events.RemoveHandler(ActivePaneChangedEvent, value); }
- }
- protected virtual void OnActivePaneChanged(EventArgs e)
- {
- EventHandler handler = (EventHandler)Events[ActivePaneChangedEvent];
- if (handler != null)
- handler(this, e);
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.MdiClientController.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.MdiClientController.cs
deleted file mode 100644
index a167a927d6..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.MdiClientController.cs
+++ /dev/null
@@ -1,430 +0,0 @@
-using System;
-using System.Drawing;
-using System.Windows.Forms;
-using System.ComponentModel;
-using System.ComponentModel.Design;
-using System.Runtime.InteropServices;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- partial class DockPanel
- {
- // This class comes from Jacob Slusser's MdiClientController class:
- // http://www.codeproject.com/cs/miscctrl/mdiclientcontroller.asp
- private class MdiClientController : NativeWindow, IComponent, IDisposable
- {
- private bool m_autoScroll = true;
- private BorderStyle m_borderStyle = BorderStyle.Fixed3D;
- private MdiClient m_mdiClient = null;
- private Form m_parentForm = null;
- private ISite m_site = null;
-
- public MdiClientController()
- {
- }
-
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- protected virtual void Dispose(bool disposing)
- {
- if (disposing)
- {
- lock (this)
- {
- if (Site != null && Site.Container != null)
- Site.Container.Remove(this);
-
- if (Disposed != null)
- Disposed(this, EventArgs.Empty);
- }
- }
- }
-
- public bool AutoScroll
- {
- get { return m_autoScroll; }
- set
- {
- // By default the MdiClient control scrolls. It can appear though that
- // there are no scrollbars by turning them off when the non-client
- // area is calculated. I decided to expose this method following
- // the .NET vernacular of an AutoScroll property.
- m_autoScroll = value;
- if (MdiClient != null)
- UpdateStyles();
- }
- }
-
- public BorderStyle BorderStyle
- {
- set
- {
- // Error-check the enum.
- if (!Enum.IsDefined(typeof(BorderStyle), value))
- throw new InvalidEnumArgumentException();
-
- m_borderStyle = value;
-
- if (MdiClient == null)
- return;
-
- // This property can actually be visible in design-mode,
- // but to keep it consistent with the others,
- // prevent this from being show at design-time.
- if (Site != null && Site.DesignMode)
- return;
-
- // There is no BorderStyle property exposed by the MdiClient class,
- // but this can be controlled by Win32 functions. A Win32 ExStyle
- // of WS_EX_CLIENTEDGE is equivalent to a Fixed3D border and a
- // Style of WS_BORDER is equivalent to a FixedSingle border.
-
- // This code is inspired Jason Dori's article:
- // "Adding designable borders to user controls".
- // http://www.codeproject.com/cs/miscctrl/CsAddingBorders.asp
-
- // 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);
-
- // Add or remove style flags as necessary.
- switch (m_borderStyle)
- {
- case BorderStyle.Fixed3D:
- exStyle |= (int)Win32.WindowExStyles.WS_EX_CLIENTEDGE;
- style &= ~((int)Win32.WindowStyles.WS_BORDER);
- break;
-
- case BorderStyle.FixedSingle:
- exStyle &= ~((int)Win32.WindowExStyles.WS_EX_CLIENTEDGE);
- style |= (int)Win32.WindowStyles.WS_BORDER;
- break;
-
- case BorderStyle.None:
- style &= ~((int)Win32.WindowStyles.WS_BORDER);
- exStyle &= ~((int)Win32.WindowExStyles.WS_EX_CLIENTEDGE);
- break;
- }
-
- // 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();
- }
- }
-
- public MdiClient MdiClient
- {
- get { return m_mdiClient; }
- }
-
- [Browsable(false)]
- public Form ParentForm
- {
- get { return m_parentForm; }
- set
- {
- // If the ParentForm has previously been set,
- // unwire events connected to the old parent.
- if (m_parentForm != null)
- {
- m_parentForm.HandleCreated -= new EventHandler(ParentFormHandleCreated);
- m_parentForm.MdiChildActivate -= new EventHandler(ParentFormMdiChildActivate);
- }
-
- m_parentForm = value;
-
- if (m_parentForm == null)
- return;
-
- // If the parent form has not been created yet,
- // wait to initialize the MDI client until it is.
- if (m_parentForm.IsHandleCreated)
- {
- InitializeMdiClient();
- RefreshProperties();
- }
- else
- m_parentForm.HandleCreated += new EventHandler(ParentFormHandleCreated);
-
- m_parentForm.MdiChildActivate += new EventHandler(ParentFormMdiChildActivate);
- }
- }
-
- public ISite Site
- {
- get { return m_site; }
- set
- {
- m_site = value;
-
- if (m_site == null)
- return;
-
- // If the component is dropped onto a form during design-time,
- // set the ParentForm property.
- IDesignerHost host = (value.GetService(typeof(IDesignerHost)) as IDesignerHost);
- if (host != null)
- {
- Form parent = host.RootComponent as Form;
- if (parent != null)
- ParentForm = parent;
- }
- }
- }
-
- public void RenewMdiClient()
- {
- // Reinitialize the MdiClient and its properties.
- InitializeMdiClient();
- RefreshProperties();
- }
-
- public event EventHandler Disposed;
-
- public event EventHandler HandleAssigned;
-
- public event EventHandler MdiChildActivate;
-
- public event LayoutEventHandler Layout;
-
- protected virtual void OnHandleAssigned(EventArgs e)
- {
- // Raise the HandleAssigned event.
- if (HandleAssigned != null)
- HandleAssigned(this, e);
- }
-
- protected virtual void OnMdiChildActivate(EventArgs e)
- {
- // Raise the MdiChildActivate event
- if (MdiChildActivate != null)
- MdiChildActivate(this, e);
- }
-
- protected virtual void OnLayout(LayoutEventArgs e)
- {
- // Raise the Layout event
- if (Layout != null)
- Layout(this, e);
- }
-
- public event PaintEventHandler Paint;
-
- protected virtual void OnPaint(PaintEventArgs e)
- {
- // Raise the Paint event.
- if (Paint != null)
- Paint(this, e);
- }
-
- protected override void WndProc(ref Message m)
- {
- switch (m.Msg)
- {
- case (int)Win32.Msgs.WM_NCCALCSIZE:
- // If AutoScroll is set to false, hide the scrollbars when the control
- // calculates its non-client area.
- if (!AutoScroll)
- NativeMethods.ShowScrollBar(m.HWnd, (int)Win32.ScrollBars.SB_BOTH, 0 /*false*/);
- break;
- }
-
- base.WndProc(ref m);
- }
-
- private void ParentFormHandleCreated(object sender, EventArgs e)
- {
- // The form has been created, unwire the event, and initialize the MdiClient.
- this.m_parentForm.HandleCreated -= new EventHandler(ParentFormHandleCreated);
- InitializeMdiClient();
- RefreshProperties();
- }
-
- private void ParentFormMdiChildActivate(object sender, EventArgs e)
- {
- OnMdiChildActivate(e);
- }
-
- private void MdiClientLayout(object sender, LayoutEventArgs e)
- {
- OnLayout(e);
- }
-
- private void MdiClientHandleDestroyed(object sender, EventArgs e)
- {
- // If the MdiClient handle has been released, drop the reference and
- // release the handle.
- if (m_mdiClient != null)
- {
- m_mdiClient.HandleDestroyed -= new EventHandler(MdiClientHandleDestroyed);
- m_mdiClient = null;
- }
-
- ReleaseHandle();
- }
-
- private void InitializeMdiClient()
- {
- // If the mdiClient has previously been set, unwire events connected
- // to the old MDI.
- if (MdiClient != null)
- {
- MdiClient.HandleDestroyed -= new EventHandler(MdiClientHandleDestroyed);
- MdiClient.Layout -= new LayoutEventHandler(MdiClientLayout);
- }
-
- if (ParentForm == null)
- return;
-
- // Get the MdiClient from the parent form.
- foreach (Control control in ParentForm.Controls)
- {
- // If the form is an MDI container, it will contain an MdiClient control
- // just as it would any other control.
-
- m_mdiClient = control as MdiClient;
- if (m_mdiClient == null)
- continue;
-
- // Assign the MdiClient Handle to the NativeWindow.
- ReleaseHandle();
- AssignHandle(MdiClient.Handle);
-
- // Raise the HandleAssigned event.
- OnHandleAssigned(EventArgs.Empty);
-
- // Monitor the MdiClient for when its handle is destroyed.
- MdiClient.HandleDestroyed += new EventHandler(MdiClientHandleDestroyed);
- MdiClient.Layout += new LayoutEventHandler(MdiClientLayout);
-
- break;
- }
- }
-
- private void RefreshProperties()
- {
- // Refresh all the properties
- BorderStyle = m_borderStyle;
- AutoScroll = m_autoScroll;
- }
-
- private void UpdateStyles()
- {
- // 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.
- NativeMethods.SetWindowPos(MdiClient.Handle, IntPtr.Zero, 0, 0, 0, 0,
- Win32.FlagsSetWindowPos.SWP_NOACTIVATE |
- Win32.FlagsSetWindowPos.SWP_NOMOVE |
- Win32.FlagsSetWindowPos.SWP_NOSIZE |
- Win32.FlagsSetWindowPos.SWP_NOZORDER |
- Win32.FlagsSetWindowPos.SWP_NOOWNERZORDER |
- Win32.FlagsSetWindowPos.SWP_FRAMECHANGED);
- }
- }
-
- private MdiClientController m_mdiClientController = null;
- private MdiClientController GetMdiClientController()
- {
- if (m_mdiClientController == null)
- {
- m_mdiClientController = new MdiClientController();
- m_mdiClientController.HandleAssigned += new EventHandler(MdiClientHandleAssigned);
- m_mdiClientController.MdiChildActivate += new EventHandler(ParentFormMdiChildActivate);
- m_mdiClientController.Layout += new LayoutEventHandler(MdiClient_Layout);
- }
-
- return m_mdiClientController;
- }
-
- private void ParentFormMdiChildActivate(object sender, EventArgs e)
- {
- if (GetMdiClientController().ParentForm == null)
- return;
-
- IDockContent content = GetMdiClientController().ParentForm.ActiveMdiChild as IDockContent;
- if (content == null)
- return;
-
- if (content.DockHandler.DockPanel == this && content.DockHandler.Pane != null)
- content.DockHandler.Pane.ActiveContent = content;
- }
-
- private bool MdiClientExists
- {
- get { return GetMdiClientController().MdiClient != null; }
- }
-
- private void SetMdiClientBounds(Rectangle bounds)
- {
- GetMdiClientController().MdiClient.Bounds = bounds;
- }
-
- private void SuspendMdiClientLayout()
- {
- if (GetMdiClientController().MdiClient != null)
- GetMdiClientController().MdiClient.PerformLayout();
- }
-
- private void ResumeMdiClientLayout(bool perform)
- {
- if (GetMdiClientController().MdiClient != null)
- GetMdiClientController().MdiClient.ResumeLayout(perform);
- }
-
- private void PerformMdiClientLayout()
- {
- if (GetMdiClientController().MdiClient != null)
- GetMdiClientController().MdiClient.PerformLayout();
- }
-
- // Called when:
- // 1. DockPanel.DocumentStyle changed
- // 2. DockPanel.Visible changed
- // 3. MdiClientController.Handle assigned
- private void SetMdiClient()
- {
- MdiClientController controller = GetMdiClientController();
-
- if (this.DocumentStyle == DocumentStyle.DockingMdi)
- {
- controller.AutoScroll = false;
- controller.BorderStyle = BorderStyle.None;
- if (MdiClientExists)
- controller.MdiClient.Dock = DockStyle.Fill;
- }
- else if (DocumentStyle == DocumentStyle.DockingSdi || DocumentStyle == DocumentStyle.DockingWindow)
- {
- controller.AutoScroll = true;
- controller.BorderStyle = BorderStyle.Fixed3D;
- if (MdiClientExists)
- controller.MdiClient.Dock = DockStyle.Fill;
- }
- else if (this.DocumentStyle == DocumentStyle.SystemMdi)
- {
- controller.AutoScroll = true;
- controller.BorderStyle = BorderStyle.Fixed3D;
- if (controller.MdiClient != null)
- {
- controller.MdiClient.Dock = DockStyle.None;
- controller.MdiClient.Bounds = SystemMdiClientBounds;
- }
- }
- }
-
- internal Rectangle RectangleToMdiClient(Rectangle rect)
- {
- if (MdiClientExists)
- return GetMdiClientController().MdiClient.RectangleToClient(rect);
- else
- return Rectangle.Empty;
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.Persistor.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.Persistor.cs
deleted file mode 100644
index 5ecbc114d7..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.Persistor.cs
+++ /dev/null
@@ -1,780 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.Windows.Forms;
-using System.Drawing;
-using WeifenLuo.WinFormsUI.Docking;
-using System.IO;
-using System.Text;
-using System.Xml;
-using System.Globalization;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- partial class DockPanel
- {
- private static class Persistor
- {
- private const string ConfigFileVersion = "1.0";
- private static string[] CompatibleConfigFileVersions = new string[] { };
-
- private class DummyContent : DockContent
- {
- }
-
- private struct DockPanelStruct
- {
- private double m_dockLeftPortion;
- public double DockLeftPortion
- {
- get { return m_dockLeftPortion; }
- set { m_dockLeftPortion = value; }
- }
-
- private double m_dockRightPortion;
- public double DockRightPortion
- {
- get { return m_dockRightPortion; }
- set { m_dockRightPortion = value; }
- }
-
- private double m_dockTopPortion;
- public double DockTopPortion
- {
- get { return m_dockTopPortion; }
- set { m_dockTopPortion = value; }
- }
-
- private double m_dockBottomPortion;
- public double DockBottomPortion
- {
- get { return m_dockBottomPortion; }
- set { m_dockBottomPortion = value; }
- }
-
- private int m_indexActiveDocumentPane;
- public int IndexActiveDocumentPane
- {
- get { return m_indexActiveDocumentPane; }
- set { m_indexActiveDocumentPane = value; }
- }
-
- private int m_indexActivePane;
- public int IndexActivePane
- {
- get { return m_indexActivePane; }
- set { m_indexActivePane = value; }
- }
- }
-
- private struct ContentStruct
- {
- private string m_persistString;
- public string PersistString
- {
- get { return m_persistString; }
- set { m_persistString = value; }
- }
-
- private double m_autoHidePortion;
- public double AutoHidePortion
- {
- get { return m_autoHidePortion; }
- set { m_autoHidePortion = value; }
- }
-
- private bool m_isHidden;
- public bool IsHidden
- {
- get { return m_isHidden; }
- set { m_isHidden = value; }
- }
-
- private bool m_isFloat;
- public bool IsFloat
- {
- get { return m_isFloat; }
- set { m_isFloat = value; }
- }
- }
-
- private struct PaneStruct
- {
- private DockState m_dockState;
- public DockState DockState
- {
- get { return m_dockState; }
- set { m_dockState = value; }
- }
-
- private int m_indexActiveContent;
- public int IndexActiveContent
- {
- get { return m_indexActiveContent; }
- set { m_indexActiveContent = value; }
- }
-
- private int[] m_indexContents;
- public int[] IndexContents
- {
- get { return m_indexContents; }
- set { m_indexContents = value; }
- }
-
- private int m_zOrderIndex;
- public int ZOrderIndex
- {
- get { return m_zOrderIndex; }
- set { m_zOrderIndex = value; }
- }
- }
-
- private struct NestedPane
- {
- private int m_indexPane;
- public int IndexPane
- {
- get { return m_indexPane; }
- set { m_indexPane = value; }
- }
-
- private int m_indexPrevPane;
- public int IndexPrevPane
- {
- get { return m_indexPrevPane; }
- set { m_indexPrevPane = value; }
- }
-
- private DockAlignment m_alignment;
- public DockAlignment Alignment
- {
- get { return m_alignment; }
- set { m_alignment = value; }
- }
-
- private double m_proportion;
- public double Proportion
- {
- get { return m_proportion; }
- set { m_proportion = value; }
- }
- }
-
- private struct DockWindowStruct
- {
- private DockState m_dockState;
- public DockState DockState
- {
- get { return m_dockState; }
- set { m_dockState = value; }
- }
-
- private int m_zOrderIndex;
- public int ZOrderIndex
- {
- get { return m_zOrderIndex; }
- set { m_zOrderIndex = value; }
- }
-
- private NestedPane[] m_nestedPanes;
- public NestedPane[] NestedPanes
- {
- get { return m_nestedPanes; }
- set { m_nestedPanes = value; }
- }
- }
-
- private struct FloatWindowStruct
- {
- private Rectangle m_bounds;
- public Rectangle Bounds
- {
- get { return m_bounds; }
- set { m_bounds = value; }
- }
-
- private int m_zOrderIndex;
- public int ZOrderIndex
- {
- get { return m_zOrderIndex; }
- set { m_zOrderIndex = value; }
- }
-
- private NestedPane[] m_nestedPanes;
- public NestedPane[] NestedPanes
- {
- get { return m_nestedPanes; }
- set { m_nestedPanes = value; }
- }
- }
-
- public static void SaveAsXml(DockPanel dockPanel, string fileName)
- {
- SaveAsXml(dockPanel, fileName, Encoding.Unicode);
- }
-
- public static void SaveAsXml(DockPanel dockPanel, string fileName, Encoding encoding)
- {
- FileStream fs = new FileStream(fileName, FileMode.Create);
- try
- {
- SaveAsXml(dockPanel, fs, encoding);
- }
- finally
- {
- fs.Close();
- }
- }
-
- public static void SaveAsXml(DockPanel dockPanel, Stream stream, Encoding encoding)
- {
- SaveAsXml(dockPanel, stream, encoding, false);
- }
-
- public static void SaveAsXml(DockPanel dockPanel, Stream stream, Encoding encoding, bool upstream)
- {
- XmlTextWriter xmlOut = new XmlTextWriter(stream, encoding);
-
- // Use indenting for readability
- xmlOut.Formatting = Formatting.Indented;
-
- if (!upstream)
- xmlOut.WriteStartDocument();
-
- // Always begin file with identification and warning
- xmlOut.WriteComment(Strings.DockPanel_Persistor_XmlFileComment1);
- xmlOut.WriteComment(Strings.DockPanel_Persistor_XmlFileComment2);
-
- // Associate a version number with the root element so that future version of the code
- // will be able to be backwards compatible or at least recognise out of date versions
- xmlOut.WriteStartElement("DockPanel");
- xmlOut.WriteAttributeString("FormatVersion", ConfigFileVersion);
- xmlOut.WriteAttributeString("DockLeftPortion", dockPanel.DockLeftPortion.ToString(CultureInfo.InvariantCulture));
- 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));
-
- // Contents
- xmlOut.WriteStartElement("Contents");
- xmlOut.WriteAttributeString("Count", dockPanel.Contents.Count.ToString(CultureInfo.InvariantCulture));
- foreach (IDockContent content in dockPanel.Contents)
- {
- xmlOut.WriteStartElement("Content");
- xmlOut.WriteAttributeString("ID", dockPanel.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteAttributeString("PersistString", content.DockHandler.PersistString);
- xmlOut.WriteAttributeString("AutoHidePortion", content.DockHandler.AutoHidePortion.ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteAttributeString("IsHidden", content.DockHandler.IsHidden.ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteAttributeString("IsFloat", content.DockHandler.IsFloat.ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteEndElement();
- }
- xmlOut.WriteEndElement();
-
- // Panes
- xmlOut.WriteStartElement("Panes");
- xmlOut.WriteAttributeString("Count", dockPanel.Panes.Count.ToString(CultureInfo.InvariantCulture));
- foreach (DockPane pane in dockPanel.Panes)
- {
- xmlOut.WriteStartElement("Pane");
- xmlOut.WriteAttributeString("ID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteAttributeString("DockState", pane.DockState.ToString());
- xmlOut.WriteAttributeString("ActiveContent", dockPanel.Contents.IndexOf(pane.ActiveContent).ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteStartElement("Contents");
- xmlOut.WriteAttributeString("Count", pane.Contents.Count.ToString(CultureInfo.InvariantCulture));
- foreach (IDockContent content in pane.Contents)
- {
- xmlOut.WriteStartElement("Content");
- xmlOut.WriteAttributeString("ID", pane.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteAttributeString("RefID", dockPanel.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteEndElement();
- }
- xmlOut.WriteEndElement();
- xmlOut.WriteEndElement();
- }
- xmlOut.WriteEndElement();
-
- // DockWindows
- xmlOut.WriteStartElement("DockWindows");
- int dockWindowId = 0;
- foreach (DockWindow dw in dockPanel.DockWindows)
- {
- xmlOut.WriteStartElement("DockWindow");
- xmlOut.WriteAttributeString("ID", dockWindowId.ToString(CultureInfo.InvariantCulture));
- dockWindowId++;
- xmlOut.WriteAttributeString("DockState", dw.DockState.ToString());
- xmlOut.WriteAttributeString("ZOrderIndex", dockPanel.Controls.IndexOf(dw).ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteStartElement("NestedPanes");
- xmlOut.WriteAttributeString("Count", dw.NestedPanes.Count.ToString(CultureInfo.InvariantCulture));
- foreach (DockPane pane in dw.NestedPanes)
- {
- xmlOut.WriteStartElement("Pane");
- xmlOut.WriteAttributeString("ID", dw.NestedPanes.IndexOf(pane).ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture));
- NestedDockingStatus status = pane.NestedDockingStatus;
- xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PreviousPane).ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString());
- xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteEndElement();
- }
- xmlOut.WriteEndElement();
- xmlOut.WriteEndElement();
- }
- xmlOut.WriteEndElement();
-
- // FloatWindows
- RectangleConverter rectConverter = new RectangleConverter();
- xmlOut.WriteStartElement("FloatWindows");
- xmlOut.WriteAttributeString("Count", dockPanel.FloatWindows.Count.ToString(CultureInfo.InvariantCulture));
- foreach (FloatWindow fw in dockPanel.FloatWindows)
- {
- xmlOut.WriteStartElement("FloatWindow");
- xmlOut.WriteAttributeString("ID", dockPanel.FloatWindows.IndexOf(fw).ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteAttributeString("Bounds", rectConverter.ConvertToInvariantString(fw.Bounds));
- xmlOut.WriteAttributeString("ZOrderIndex", fw.DockPanel.FloatWindows.IndexOf(fw).ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteStartElement("NestedPanes");
- xmlOut.WriteAttributeString("Count", fw.NestedPanes.Count.ToString(CultureInfo.InvariantCulture));
- foreach (DockPane pane in fw.NestedPanes)
- {
- xmlOut.WriteStartElement("Pane");
- xmlOut.WriteAttributeString("ID", fw.NestedPanes.IndexOf(pane).ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture));
- NestedDockingStatus status = pane.NestedDockingStatus;
- xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PreviousPane).ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString());
- xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture));
- xmlOut.WriteEndElement();
- }
- xmlOut.WriteEndElement();
- xmlOut.WriteEndElement();
- }
- xmlOut.WriteEndElement(); //
-
- xmlOut.WriteEndElement();
-
- if (!upstream)
- {
- xmlOut.WriteEndDocument();
- xmlOut.Close();
- }
- else
- xmlOut.Flush();
- }
-
- public static void LoadFromXml(DockPanel dockPanel, string fileName, DeserializeDockContent deserializeContent)
- {
- FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
- try
- {
- LoadFromXml(dockPanel, fs, deserializeContent);
- }
- finally
- {
- fs.Close();
- }
- }
-
- public static void LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent)
- {
- LoadFromXml(dockPanel, stream, deserializeContent, true);
- }
-
- private static ContentStruct[] LoadContents(XmlTextReader xmlIn)
- {
- int countOfContents = Convert.ToInt32(xmlIn.GetAttribute("Count"), CultureInfo.InvariantCulture);
- ContentStruct[] contents = new ContentStruct[countOfContents];
- MoveToNextElement(xmlIn);
- for (int i = 0; i < countOfContents; i++)
- {
- int id = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture);
- if (xmlIn.Name != "Content" || id != i)
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
-
- contents[i].PersistString = xmlIn.GetAttribute("PersistString");
- contents[i].AutoHidePortion = Convert.ToDouble(xmlIn.GetAttribute("AutoHidePortion"), CultureInfo.InvariantCulture);
- contents[i].IsHidden = Convert.ToBoolean(xmlIn.GetAttribute("IsHidden"), CultureInfo.InvariantCulture);
- contents[i].IsFloat = Convert.ToBoolean(xmlIn.GetAttribute("IsFloat"), CultureInfo.InvariantCulture);
- MoveToNextElement(xmlIn);
- }
-
- return contents;
- }
-
- private static PaneStruct[] LoadPanes(XmlTextReader xmlIn)
- {
- EnumConverter dockStateConverter = new EnumConverter(typeof(DockState));
- int countOfPanes = Convert.ToInt32(xmlIn.GetAttribute("Count"), CultureInfo.InvariantCulture);
- PaneStruct[] panes = new PaneStruct[countOfPanes];
- MoveToNextElement(xmlIn);
- for (int i = 0; i < countOfPanes; i++)
- {
- int id = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture);
- if (xmlIn.Name != "Pane" || id != i)
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
-
- panes[i].DockState = (DockState)dockStateConverter.ConvertFrom(xmlIn.GetAttribute("DockState"));
- panes[i].IndexActiveContent = Convert.ToInt32(xmlIn.GetAttribute("ActiveContent"), CultureInfo.InvariantCulture);
- panes[i].ZOrderIndex = -1;
-
- MoveToNextElement(xmlIn);
- if (xmlIn.Name != "Contents")
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
- int countOfPaneContents = Convert.ToInt32(xmlIn.GetAttribute("Count"), CultureInfo.InvariantCulture);
- panes[i].IndexContents = new int[countOfPaneContents];
- MoveToNextElement(xmlIn);
- for (int j = 0; j < countOfPaneContents; j++)
- {
- int id2 = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture);
- if (xmlIn.Name != "Content" || id2 != j)
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
-
- panes[i].IndexContents[j] = Convert.ToInt32(xmlIn.GetAttribute("RefID"), CultureInfo.InvariantCulture);
- MoveToNextElement(xmlIn);
- }
- }
-
- return panes;
- }
-
- private static DockWindowStruct[] LoadDockWindows(XmlTextReader xmlIn, DockPanel dockPanel)
- {
- EnumConverter dockStateConverter = new EnumConverter(typeof(DockState));
- EnumConverter dockAlignmentConverter = new EnumConverter(typeof(DockAlignment));
- int countOfDockWindows = dockPanel.DockWindows.Count;
- DockWindowStruct[] dockWindows = new DockWindowStruct[countOfDockWindows];
- MoveToNextElement(xmlIn);
- for (int i = 0; i < countOfDockWindows; i++)
- {
- int id = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture);
- if (xmlIn.Name != "DockWindow" || id != i)
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
-
- dockWindows[i].DockState = (DockState)dockStateConverter.ConvertFrom(xmlIn.GetAttribute("DockState"));
- dockWindows[i].ZOrderIndex = Convert.ToInt32(xmlIn.GetAttribute("ZOrderIndex"), CultureInfo.InvariantCulture);
- MoveToNextElement(xmlIn);
- if (xmlIn.Name != "DockList" && xmlIn.Name != "NestedPanes")
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
- int countOfNestedPanes = Convert.ToInt32(xmlIn.GetAttribute("Count"), CultureInfo.InvariantCulture);
- dockWindows[i].NestedPanes = new NestedPane[countOfNestedPanes];
- MoveToNextElement(xmlIn);
- for (int j = 0; j < countOfNestedPanes; j++)
- {
- int id2 = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture);
- if (xmlIn.Name != "Pane" || id2 != j)
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
- dockWindows[i].NestedPanes[j].IndexPane = Convert.ToInt32(xmlIn.GetAttribute("RefID"), CultureInfo.InvariantCulture);
- dockWindows[i].NestedPanes[j].IndexPrevPane = Convert.ToInt32(xmlIn.GetAttribute("PrevPane"), CultureInfo.InvariantCulture);
- dockWindows[i].NestedPanes[j].Alignment = (DockAlignment)dockAlignmentConverter.ConvertFrom(xmlIn.GetAttribute("Alignment"));
- dockWindows[i].NestedPanes[j].Proportion = Convert.ToDouble(xmlIn.GetAttribute("Proportion"), CultureInfo.InvariantCulture);
- MoveToNextElement(xmlIn);
- }
- }
-
- return dockWindows;
- }
-
- private static FloatWindowStruct[] LoadFloatWindows(XmlTextReader xmlIn)
- {
- EnumConverter dockAlignmentConverter = new EnumConverter(typeof(DockAlignment));
- RectangleConverter rectConverter = new RectangleConverter();
- int countOfFloatWindows = Convert.ToInt32(xmlIn.GetAttribute("Count"), CultureInfo.InvariantCulture);
- FloatWindowStruct[] floatWindows = new FloatWindowStruct[countOfFloatWindows];
- MoveToNextElement(xmlIn);
- for (int i = 0; i < countOfFloatWindows; i++)
- {
- int id = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture);
- if (xmlIn.Name != "FloatWindow" || id != i)
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
-
- floatWindows[i].Bounds = (Rectangle)rectConverter.ConvertFromInvariantString(xmlIn.GetAttribute("Bounds"));
- floatWindows[i].ZOrderIndex = Convert.ToInt32(xmlIn.GetAttribute("ZOrderIndex"), CultureInfo.InvariantCulture);
- MoveToNextElement(xmlIn);
- if (xmlIn.Name != "DockList" && xmlIn.Name != "NestedPanes")
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
- int countOfNestedPanes = Convert.ToInt32(xmlIn.GetAttribute("Count"), CultureInfo.InvariantCulture);
- floatWindows[i].NestedPanes = new NestedPane[countOfNestedPanes];
- MoveToNextElement(xmlIn);
- for (int j = 0; j < countOfNestedPanes; j++)
- {
- int id2 = Convert.ToInt32(xmlIn.GetAttribute("ID"), CultureInfo.InvariantCulture);
- if (xmlIn.Name != "Pane" || id2 != j)
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
- floatWindows[i].NestedPanes[j].IndexPane = Convert.ToInt32(xmlIn.GetAttribute("RefID"), CultureInfo.InvariantCulture);
- floatWindows[i].NestedPanes[j].IndexPrevPane = Convert.ToInt32(xmlIn.GetAttribute("PrevPane"), CultureInfo.InvariantCulture);
- floatWindows[i].NestedPanes[j].Alignment = (DockAlignment)dockAlignmentConverter.ConvertFrom(xmlIn.GetAttribute("Alignment"));
- floatWindows[i].NestedPanes[j].Proportion = Convert.ToDouble(xmlIn.GetAttribute("Proportion"), CultureInfo.InvariantCulture);
- MoveToNextElement(xmlIn);
- }
- }
-
- return floatWindows;
- }
-
- public static void LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent, bool closeStream)
- {
-
- if (dockPanel.Contents.Count != 0)
- throw new InvalidOperationException(Strings.DockPanel_LoadFromXml_AlreadyInitialized);
-
- XmlTextReader xmlIn = new XmlTextReader(stream);
- xmlIn.WhitespaceHandling = WhitespaceHandling.None;
- xmlIn.MoveToContent();
-
- while (!xmlIn.Name.Equals("DockPanel"))
- {
- if (!MoveToNextElement(xmlIn))
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
- }
-
- string formatVersion = xmlIn.GetAttribute("FormatVersion");
- if (!IsFormatVersionValid(formatVersion))
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidFormatVersion);
-
- DockPanelStruct dockPanelStruct = new DockPanelStruct();
- dockPanelStruct.DockLeftPortion = Convert.ToDouble(xmlIn.GetAttribute("DockLeftPortion"), CultureInfo.InvariantCulture);
- dockPanelStruct.DockRightPortion = Convert.ToDouble(xmlIn.GetAttribute("DockRightPortion"), CultureInfo.InvariantCulture);
- dockPanelStruct.DockTopPortion = Convert.ToDouble(xmlIn.GetAttribute("DockTopPortion"), CultureInfo.InvariantCulture);
- dockPanelStruct.DockBottomPortion = Convert.ToDouble(xmlIn.GetAttribute("DockBottomPortion"), CultureInfo.InvariantCulture);
- dockPanelStruct.IndexActiveDocumentPane = Convert.ToInt32(xmlIn.GetAttribute("ActiveDocumentPane"), CultureInfo.InvariantCulture);
- dockPanelStruct.IndexActivePane = Convert.ToInt32(xmlIn.GetAttribute("ActivePane"), CultureInfo.InvariantCulture);
-
- // Load Contents
- MoveToNextElement(xmlIn);
- if (xmlIn.Name != "Contents")
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
- ContentStruct[] contents = LoadContents(xmlIn);
-
- // Load Panes
- if (xmlIn.Name != "Panes")
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
- PaneStruct[] panes = LoadPanes(xmlIn);
-
- // Load DockWindows
- if (xmlIn.Name != "DockWindows")
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
- DockWindowStruct[] dockWindows = LoadDockWindows(xmlIn, dockPanel);
-
- // Load FloatWindows
- if (xmlIn.Name != "FloatWindows")
- throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
- FloatWindowStruct[] floatWindows = LoadFloatWindows(xmlIn);
-
- if (closeStream)
- xmlIn.Close();
-
- dockPanel.SuspendLayout(true);
-
- dockPanel.DockLeftPortion = dockPanelStruct.DockLeftPortion;
- dockPanel.DockRightPortion = dockPanelStruct.DockRightPortion;
- dockPanel.DockTopPortion = dockPanelStruct.DockTopPortion;
- dockPanel.DockBottomPortion = dockPanelStruct.DockBottomPortion;
-
- // Set DockWindow ZOrders
- int prevMaxDockWindowZOrder = int.MaxValue;
- for (int i = 0; i < dockWindows.Length; i++)
- {
- int maxDockWindowZOrder = -1;
- int index = -1;
- for (int j = 0; j < dockWindows.Length; j++)
- {
- if (dockWindows[j].ZOrderIndex > maxDockWindowZOrder && dockWindows[j].ZOrderIndex < prevMaxDockWindowZOrder)
- {
- maxDockWindowZOrder = dockWindows[j].ZOrderIndex;
- index = j;
- }
- }
-
- dockPanel.DockWindows[dockWindows[index].DockState].BringToFront();
- prevMaxDockWindowZOrder = maxDockWindowZOrder;
- }
-
- // Create Contents
- for (int i = 0; i < contents.Length; i++)
- {
- IDockContent content = deserializeContent(contents[i].PersistString);
- if (content == null)
- content = new DummyContent();
- content.DockHandler.DockPanel = dockPanel;
- content.DockHandler.AutoHidePortion = contents[i].AutoHidePortion;
- content.DockHandler.IsHidden = true;
- content.DockHandler.IsFloat = contents[i].IsFloat;
- }
-
- // Create panes
- for (int i = 0; i < panes.Length; i++)
- {
- DockPane pane = null;
- for (int j = 0; j < panes[i].IndexContents.Length; j++)
- {
- IDockContent content = dockPanel.Contents[panes[i].IndexContents[j]];
- if (j == 0)
- pane = dockPanel.DockPaneFactory.CreateDockPane(content, panes[i].DockState, false);
- else if (panes[i].DockState == DockState.Float)
- content.DockHandler.FloatPane = pane;
- else
- content.DockHandler.PanelPane = pane;
- }
- }
-
- // Assign Panes to DockWindows
- for (int i = 0; i < dockWindows.Length; i++)
- {
- for (int j = 0; j < dockWindows[i].NestedPanes.Length; j++)
- {
- DockWindow dw = dockPanel.DockWindows[dockWindows[i].DockState];
- int indexPane = dockWindows[i].NestedPanes[j].IndexPane;
- DockPane pane = dockPanel.Panes[indexPane];
- int indexPrevPane = dockWindows[i].NestedPanes[j].IndexPrevPane;
- DockPane prevPane = (indexPrevPane == -1) ? dw.NestedPanes.GetDefaultPreviousPane(pane) : dockPanel.Panes[indexPrevPane];
- DockAlignment alignment = dockWindows[i].NestedPanes[j].Alignment;
- double proportion = dockWindows[i].NestedPanes[j].Proportion;
- pane.DockTo(dw, prevPane, alignment, proportion);
- if (panes[indexPane].DockState == dw.DockState)
- panes[indexPane].ZOrderIndex = dockWindows[i].ZOrderIndex;
- }
- }
-
- // Create float windows
- for (int i = 0; i < floatWindows.Length; i++)
- {
- FloatWindow fw = null;
- for (int j = 0; j < floatWindows[i].NestedPanes.Length; j++)
- {
- int indexPane = floatWindows[i].NestedPanes[j].IndexPane;
- DockPane pane = dockPanel.Panes[indexPane];
- if (j == 0)
- fw = dockPanel.FloatWindowFactory.CreateFloatWindow(dockPanel, pane, floatWindows[i].Bounds);
- else
- {
- int indexPrevPane = floatWindows[i].NestedPanes[j].IndexPrevPane;
- DockPane prevPane = indexPrevPane == -1 ? null : dockPanel.Panes[indexPrevPane];
- DockAlignment alignment = floatWindows[i].NestedPanes[j].Alignment;
- double proportion = floatWindows[i].NestedPanes[j].Proportion;
- pane.DockTo(fw, prevPane, alignment, proportion);
- if (panes[indexPane].DockState == fw.DockState)
- panes[indexPane].ZOrderIndex = floatWindows[i].ZOrderIndex;
- }
- }
- }
-
- // sort IDockContent by its Pane's ZOrder
- int[] sortedContents = null;
- if (contents.Length > 0)
- {
- sortedContents = new int[contents.Length];
- for (int i = 0; i < contents.Length; i++)
- sortedContents[i] = i;
-
- int lastDocument = contents.Length;
- for (int i = 0; i < contents.Length - 1; i++)
- {
- for (int j = i + 1; j < contents.Length; j++)
- {
- DockPane pane1 = dockPanel.Contents[sortedContents[i]].DockHandler.Pane;
- int ZOrderIndex1 = pane1 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane1)].ZOrderIndex;
- DockPane pane2 = dockPanel.Contents[sortedContents[j]].DockHandler.Pane;
- int ZOrderIndex2 = pane2 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane2)].ZOrderIndex;
- if (ZOrderIndex1 > ZOrderIndex2)
- {
- int temp = sortedContents[i];
- sortedContents[i] = sortedContents[j];
- sortedContents[j] = temp;
- }
- }
- }
- }
-
- // show non-document IDockContent first to avoid screen flickers
- for (int i = 0; i < contents.Length; i++)
- {
- IDockContent content = dockPanel.Contents[sortedContents[i]];
- if (content.DockHandler.Pane != null && content.DockHandler.Pane.DockState != DockState.Document)
- content.DockHandler.IsHidden = contents[sortedContents[i]].IsHidden;
- }
-
- // after all non-document IDockContent, show document IDockContent
- for (int i = 0; i < contents.Length; i++)
- {
- IDockContent content = dockPanel.Contents[sortedContents[i]];
- if (content.DockHandler.Pane != null && content.DockHandler.Pane.DockState == DockState.Document)
- content.DockHandler.IsHidden = contents[sortedContents[i]].IsHidden;
- }
-
- for (int i = 0; i < panes.Length; i++)
- dockPanel.Panes[i].ActiveContent = panes[i].IndexActiveContent == -1 ? null : dockPanel.Contents[panes[i].IndexActiveContent];
-
- if (dockPanelStruct.IndexActiveDocumentPane != -1)
- dockPanel.Panes[dockPanelStruct.IndexActiveDocumentPane].Activate();
-
- if (dockPanelStruct.IndexActivePane != -1)
- dockPanel.Panes[dockPanelStruct.IndexActivePane].Activate();
-
- for (int i = dockPanel.Contents.Count - 1; i >= 0; i--)
- if (dockPanel.Contents[i] is DummyContent)
- dockPanel.Contents[i].DockHandler.Form.Close();
-
- dockPanel.ResumeLayout(true, true);
- }
-
- private static bool MoveToNextElement(XmlTextReader xmlIn)
- {
- if (!xmlIn.Read())
- return false;
-
- while (xmlIn.NodeType == XmlNodeType.EndElement)
- {
- if (!xmlIn.Read())
- return false;
- }
-
- return true;
- }
-
- private static bool IsFormatVersionValid(string formatVersion)
- {
- if (formatVersion == ConfigFileVersion)
- return true;
-
- foreach (string s in CompatibleConfigFileVersions)
- if (s == formatVersion)
- return true;
-
- return false;
- }
- }
-
- public void SaveAsXml(string fileName)
- {
- Persistor.SaveAsXml(this, fileName);
- }
-
- public void SaveAsXml(string fileName, Encoding encoding)
- {
- Persistor.SaveAsXml(this, fileName, encoding);
- }
-
- public void SaveAsXml(Stream stream, Encoding encoding)
- {
- Persistor.SaveAsXml(this, stream, encoding);
- }
-
- public void SaveAsXml(Stream stream, Encoding encoding, bool upstream)
- {
- Persistor.SaveAsXml(this, stream, encoding, upstream);
- }
-
- public void LoadFromXml(string fileName, DeserializeDockContent deserializeContent)
- {
- Persistor.LoadFromXml(this, fileName, deserializeContent);
- }
-
- public void LoadFromXml(Stream stream, DeserializeDockContent deserializeContent)
- {
- Persistor.LoadFromXml(this, stream, deserializeContent);
- }
-
- public void LoadFromXml(Stream stream, DeserializeDockContent deserializeContent, bool closeStream)
- {
- Persistor.LoadFromXml(this, stream, deserializeContent, closeStream);
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.SplitterDragHandler.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.SplitterDragHandler.cs
deleted file mode 100644
index 8689e166fd..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.SplitterDragHandler.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Windows.Forms;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.ComponentModel;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- partial class DockPanel
- {
- private sealed class SplitterDragHandler : DragHandler
- {
- private class SplitterOutline
- {
- public SplitterOutline()
- {
- m_dragForm = new DragForm();
- SetDragForm(Rectangle.Empty);
- DragForm.BackColor = Color.Black;
- DragForm.Opacity = 0.7;
- DragForm.Show(false);
- }
-
- DragForm m_dragForm;
- private DragForm DragForm
- {
- get { return m_dragForm; }
- }
-
- public void Show(Rectangle rect)
- {
- SetDragForm(rect);
- }
-
- public void Close()
- {
- DragForm.Close();
- }
-
- private void SetDragForm(Rectangle rect)
- {
- DragForm.Bounds = rect;
- if (rect == Rectangle.Empty)
- DragForm.Region = new Region(Rectangle.Empty);
- else if (DragForm.Region != null)
- DragForm.Region = null;
- }
- }
-
- public SplitterDragHandler(DockPanel dockPanel)
- : base(dockPanel)
- {
- }
-
- public new ISplitterDragSource DragSource
- {
- get { return base.DragSource as ISplitterDragSource; }
- private set { base.DragSource = value; }
- }
-
- private SplitterOutline m_outline;
- private SplitterOutline Outline
- {
- get { return m_outline; }
- set { m_outline = value; }
- }
-
- private Rectangle m_rectSplitter;
- private Rectangle RectSplitter
- {
- get { return m_rectSplitter; }
- set { m_rectSplitter = value; }
- }
-
- public void BeginDrag(ISplitterDragSource dragSource, Rectangle rectSplitter)
- {
- DragSource = dragSource;
- RectSplitter = rectSplitter;
-
- if (!BeginDrag())
- {
- DragSource = null;
- return;
- }
-
- Outline = new SplitterOutline();
- Outline.Show(rectSplitter);
- DragSource.BeginDrag(rectSplitter);
- }
-
- protected override void OnDragging()
- {
- Outline.Show(GetSplitterOutlineBounds(Control.MousePosition));
- }
-
- protected override void OnEndDrag(bool abort)
- {
- DockPanel.SuspendLayout(true);
-
- Outline.Close();
-
- if (!abort)
- DragSource.MoveSplitter(GetMovingOffset(Control.MousePosition));
-
- DragSource.EndDrag();
- DockPanel.ResumeLayout(true, true);
- }
-
- private int GetMovingOffset(Point ptMouse)
- {
- Rectangle rect = GetSplitterOutlineBounds(ptMouse);
- if (DragSource.IsVertical)
- return rect.X - RectSplitter.X;
- else
- return rect.Y - RectSplitter.Y;
- }
-
- private Rectangle GetSplitterOutlineBounds(Point ptMouse)
- {
- Rectangle rectLimit = DragSource.DragLimitBounds;
-
- Rectangle rect = RectSplitter;
- if (rectLimit.Width <= 0 || rectLimit.Height <= 0)
- return rect;
-
- if (DragSource.IsVertical)
- {
- rect.X += ptMouse.X - StartMousePosition.X;
- rect.Height = rectLimit.Height;
- }
- else
- {
- rect.Y += ptMouse.Y - StartMousePosition.Y;
- rect.Width = rectLimit.Width;
- }
-
- if (rect.Left < rectLimit.Left)
- rect.X = rectLimit.X;
- if (rect.Top < rectLimit.Top)
- rect.Y = rectLimit.Y;
- if (rect.Right > rectLimit.Right)
- rect.X -= rect.Right - rectLimit.Right;
- if (rect.Bottom > rectLimit.Bottom)
- rect.Y -= rect.Bottom - rectLimit.Bottom;
-
- return rect;
- }
- }
-
- private SplitterDragHandler m_splitterDragHandler = null;
- private SplitterDragHandler GetSplitterDragHandler()
- {
- if (m_splitterDragHandler == null)
- m_splitterDragHandler = new SplitterDragHandler(this);
- return m_splitterDragHandler;
- }
-
- internal void BeginDrag(ISplitterDragSource dragSource, Rectangle rectSplitter)
- {
- GetSplitterDragHandler().BeginDrag(dragSource, rectSplitter);
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.bmp
deleted file mode 100644
index 10d6858f94..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.cs
deleted file mode 100644
index 6827c9d801..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanel.cs
+++ /dev/null
@@ -1,986 +0,0 @@
-using System;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Windows.Forms;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-using System.IO;
-using System.Text;
-using System.Diagnostics.CodeAnalysis;
-using System.Collections.Generic;
-
-// To simplify the process of finding the toolbox bitmap resource:
-// #1 Create an internal class called "resfinder" outside of the root namespace.
-// #2 Use "resfinder" in the toolbox bitmap attribute instead of the control name.
-// #3 use the "." string to locate the resource.
-// See: http://www.bobpowell.net/toolboxbitmap.htm
-internal class resfinder
-{
-}
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "0#")]
- public delegate IDockContent DeserializeDockContent(string persistString);
-
- [LocalizedDescription("DockPanel_Description")]
- [Designer(typeof(System.Windows.Forms.Design.ControlDesigner))]
- [ToolboxBitmap(typeof(resfinder), "WeifenLuo.WinFormsUI.Docking.DockPanel.bmp")]
- [DefaultProperty("DocumentStyle")]
- [DefaultEvent("ActiveContentChanged")]
- public partial class DockPanel : Panel
- {
- private FocusManagerImpl m_focusManager;
- private DockPanelExtender m_extender;
- private DockPaneCollection m_panes;
- private FloatWindowCollection m_floatWindows;
- private AutoHideWindowControl m_autoHideWindow;
- private DockWindowCollection m_dockWindows;
- private DockContent m_dummyContent;
- private Control m_dummyControl;
-
- public DockPanel()
- {
- m_focusManager = new FocusManagerImpl(this);
- m_extender = new DockPanelExtender(this);
- m_panes = new DockPaneCollection();
- m_floatWindows = new FloatWindowCollection();
-
- SuspendLayout();
-
- m_autoHideWindow = new AutoHideWindowControl(this);
- m_autoHideWindow.Visible = false;
- SetAutoHideWindowParent();
-
- m_dummyControl = new DummyControl();
- m_dummyControl.Bounds = new Rectangle(0, 0, 1, 1);
- Controls.Add(m_dummyControl);
-
- m_dockWindows = new DockWindowCollection(this);
- Controls.AddRange(new Control[] {
- DockWindows[DockState.Document],
- DockWindows[DockState.DockLeft],
- DockWindows[DockState.DockRight],
- DockWindows[DockState.DockTop],
- DockWindows[DockState.DockBottom]
- });
-
- m_dummyContent = new DockContent();
- ResumeLayout();
- }
-
- private AutoHideStripBase m_autoHideStripControl = null;
- internal AutoHideStripBase AutoHideStripControl
- {
- get
- {
- if (m_autoHideStripControl == null)
- {
- m_autoHideStripControl = AutoHideStripFactory.CreateAutoHideStrip(this);
- Controls.Add(m_autoHideStripControl);
- }
- return m_autoHideStripControl;
- }
- }
- internal void ResetAutoHideStripControl()
- {
- if (m_autoHideStripControl != null)
- m_autoHideStripControl.Dispose();
-
- m_autoHideStripControl = null;
- }
-
- private void MdiClientHandleAssigned(object sender, EventArgs e)
- {
- SetMdiClient();
- PerformLayout();
- }
-
- private void MdiClient_Layout(object sender, LayoutEventArgs e)
- {
- if (DocumentStyle != DocumentStyle.DockingMdi)
- return;
-
- foreach (DockPane pane in Panes)
- if (pane.DockState == DockState.Document)
- pane.SetContentBounds();
-
- InvalidateWindowRegion();
- }
-
- private bool m_disposed = false;
- protected override void Dispose(bool disposing)
- {
- lock (this)
- {
- if (!m_disposed && disposing)
- {
- m_focusManager.Dispose();
- if (m_mdiClientController != null)
- {
- m_mdiClientController.HandleAssigned -= new EventHandler(MdiClientHandleAssigned);
- m_mdiClientController.MdiChildActivate -= new EventHandler(ParentFormMdiChildActivate);
- m_mdiClientController.Layout -= new LayoutEventHandler(MdiClient_Layout);
- m_mdiClientController.Dispose();
- }
- FloatWindows.Dispose();
- Panes.Dispose();
- DummyContent.Dispose();
-
- m_disposed = true;
- }
-
- base.Dispose(disposing);
- }
- }
-
- [Browsable(false)]
- public IDockContent ActiveAutoHideContent
- {
- get { return AutoHideWindow.ActiveContent; }
- set { AutoHideWindow.ActiveContent = value; }
- }
-
- private bool m_allowEndUserDocking = true;
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockPanel_AllowEndUserDocking_Description")]
- [DefaultValue(true)]
- public bool AllowEndUserDocking
- {
- get { return m_allowEndUserDocking; }
- set { m_allowEndUserDocking = value; }
- }
-
- private bool m_allowEndUserNestedDocking = true;
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockPanel_AllowEndUserNestedDocking_Description")]
- [DefaultValue(true)]
- public bool AllowEndUserNestedDocking
- {
- get { return m_allowEndUserNestedDocking; }
- set { m_allowEndUserNestedDocking = value; }
- }
-
- private DockContentCollection m_contents = new DockContentCollection();
- [Browsable(false)]
- public DockContentCollection Contents
- {
- get { return m_contents; }
- }
-
- internal DockContent DummyContent
- {
- get { return m_dummyContent; }
- }
-
- private bool m_rightToLeftLayout = false;
- [DefaultValue(false)]
- [LocalizedCategory("Appearance")]
- [LocalizedDescription("DockPanel_RightToLeftLayout_Description")]
- public bool RightToLeftLayout
- {
- get { return m_rightToLeftLayout; }
- set
- {
- if (m_rightToLeftLayout == value)
- return;
-
- m_rightToLeftLayout = value;
- foreach (FloatWindow floatWindow in FloatWindows)
- floatWindow.RightToLeftLayout = value;
- }
- }
-
- protected override void OnRightToLeftChanged(EventArgs e)
- {
- base.OnRightToLeftChanged(e);
- foreach (FloatWindow floatWindow in FloatWindows)
- {
- if (floatWindow.RightToLeft != RightToLeft)
- floatWindow.RightToLeft = RightToLeft;
- }
- }
-
- private bool m_showDocumentIcon = false;
- [DefaultValue(false)]
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockPanel_ShowDocumentIcon_Description")]
- public bool ShowDocumentIcon
- {
- get { return m_showDocumentIcon; }
- set
- {
- if (m_showDocumentIcon == value)
- return;
-
- m_showDocumentIcon = value;
- Refresh();
- }
- }
-
- [Browsable(false)]
- public DockPanelExtender Extender
- {
- get { return m_extender; }
- }
-
- public DockPanelExtender.IDockPaneFactory DockPaneFactory
- {
- get { return Extender.DockPaneFactory; }
- }
-
- public DockPanelExtender.IFloatWindowFactory FloatWindowFactory
- {
- get { return Extender.FloatWindowFactory; }
- }
-
- internal DockPanelExtender.IDockPaneCaptionFactory DockPaneCaptionFactory
- {
- get { return Extender.DockPaneCaptionFactory; }
- }
-
- internal DockPanelExtender.IDockPaneStripFactory DockPaneStripFactory
- {
- get { return Extender.DockPaneStripFactory; }
- }
-
- internal DockPanelExtender.IAutoHideStripFactory AutoHideStripFactory
- {
- get { return Extender.AutoHideStripFactory; }
- }
-
- [Browsable(false)]
- public DockPaneCollection Panes
- {
- get { return m_panes; }
- }
-
- internal Rectangle DockArea
- {
- get
- {
- return new Rectangle(DockPadding.Left, DockPadding.Top,
- ClientRectangle.Width - DockPadding.Left - DockPadding.Right,
- ClientRectangle.Height - DockPadding.Top - DockPadding.Bottom);
- }
- }
-
- private double m_dockBottomPortion = 0.25;
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockPanel_DockBottomPortion_Description")]
- [DefaultValue(0.25)]
- public double DockBottomPortion
- {
- get { return m_dockBottomPortion; }
- set
- {
- if (value <= 0)
- throw new ArgumentOutOfRangeException("value");
-
- if (value == m_dockBottomPortion)
- return;
-
- m_dockBottomPortion = value;
-
- if (m_dockBottomPortion < 1 && m_dockTopPortion < 1)
- {
- if (m_dockTopPortion + m_dockBottomPortion > 1)
- m_dockTopPortion = 1 - m_dockBottomPortion;
- }
-
- PerformLayout();
- }
- }
-
- private double m_dockLeftPortion = 0.25;
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockPanel_DockLeftPortion_Description")]
- [DefaultValue(0.25)]
- public double DockLeftPortion
- {
- get { return m_dockLeftPortion; }
- set
- {
- if (value <= 0)
- throw new ArgumentOutOfRangeException("value");
-
- if (value == m_dockLeftPortion)
- return;
-
- m_dockLeftPortion = value;
-
- if (m_dockLeftPortion < 1 && m_dockRightPortion < 1)
- {
- if (m_dockLeftPortion + m_dockRightPortion > 1)
- m_dockRightPortion = 1 - m_dockLeftPortion;
- }
- PerformLayout();
- }
- }
-
- private double m_dockRightPortion = 0.25;
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockPanel_DockRightPortion_Description")]
- [DefaultValue(0.25)]
- public double DockRightPortion
- {
- get { return m_dockRightPortion; }
- set
- {
- if (value <= 0)
- throw new ArgumentOutOfRangeException("value");
-
- if (value == m_dockRightPortion)
- return;
-
- m_dockRightPortion = value;
-
- if (m_dockLeftPortion < 1 && m_dockRightPortion < 1)
- {
- if (m_dockLeftPortion + m_dockRightPortion > 1)
- m_dockLeftPortion = 1 - m_dockRightPortion;
- }
- PerformLayout();
- }
- }
-
- private double m_dockTopPortion = 0.25;
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockPanel_DockTopPortion_Description")]
- [DefaultValue(0.25)]
- public double DockTopPortion
- {
- get { return m_dockTopPortion; }
- set
- {
- if (value <= 0)
- throw new ArgumentOutOfRangeException("value");
-
- if (value == m_dockTopPortion)
- return;
-
- m_dockTopPortion = value;
-
- if (m_dockTopPortion < 1 && m_dockBottomPortion < 1)
- {
- if (m_dockTopPortion + m_dockBottomPortion > 1)
- m_dockBottomPortion = 1 - m_dockTopPortion;
- }
- PerformLayout();
- }
- }
-
- [Browsable(false)]
- public DockWindowCollection DockWindows
- {
- get { return m_dockWindows; }
- }
-
- public void UpdateDockWindowZOrder(DockStyle dockStyle, bool fullPanelEdge)
- {
- if (dockStyle == DockStyle.Left)
- {
- if (fullPanelEdge)
- DockWindows[DockState.DockLeft].SendToBack();
- else
- DockWindows[DockState.DockLeft].BringToFront();
- }
- else if (dockStyle == DockStyle.Right)
- {
- if (fullPanelEdge)
- DockWindows[DockState.DockRight].SendToBack();
- else
- DockWindows[DockState.DockRight].BringToFront();
- }
- else if (dockStyle == DockStyle.Top)
- {
- if (fullPanelEdge)
- DockWindows[DockState.DockTop].SendToBack();
- else
- DockWindows[DockState.DockTop].BringToFront();
- }
- else if (dockStyle == DockStyle.Bottom)
- {
- if (fullPanelEdge)
- DockWindows[DockState.DockBottom].SendToBack();
- else
- DockWindows[DockState.DockBottom].BringToFront();
- }
- }
-
- public int DocumentsCount
- {
- get
- {
- int count = 0;
- foreach (IDockContent content in Documents)
- count++;
-
- return count;
- }
- }
-
- public IDockContent[] DocumentsToArray()
- {
- int count = DocumentsCount;
- IDockContent[] documents = new IDockContent[count];
- int i = 0;
- foreach (IDockContent content in Documents)
- {
- documents[i] = content;
- i++;
- }
-
- return documents;
- }
-
- public IEnumerable Documents
- {
- get
- {
- foreach (IDockContent content in Contents)
- {
- if (content.DockHandler.DockState == DockState.Document)
- yield return content;
- }
- }
- }
-
- private Rectangle DocumentRectangle
- {
- get
- {
- Rectangle rect = DockArea;
- if (DockWindows[DockState.DockLeft].VisibleNestedPanes.Count != 0)
- {
- rect.X += (int)(DockArea.Width * DockLeftPortion);
- rect.Width -= (int)(DockArea.Width * DockLeftPortion);
- }
- if (DockWindows[DockState.DockRight].VisibleNestedPanes.Count != 0)
- rect.Width -= (int)(DockArea.Width * DockRightPortion);
- if (DockWindows[DockState.DockTop].VisibleNestedPanes.Count != 0)
- {
- rect.Y += (int)(DockArea.Height * DockTopPortion);
- rect.Height -= (int)(DockArea.Height * DockTopPortion);
- }
- if (DockWindows[DockState.DockBottom].VisibleNestedPanes.Count != 0)
- rect.Height -= (int)(DockArea.Height * DockBottomPortion);
-
- return rect;
- }
- }
-
- private Control DummyControl
- {
- get { return m_dummyControl; }
- }
-
- [Browsable(false)]
- public FloatWindowCollection FloatWindows
- {
- get { return m_floatWindows; }
- }
-
- private Size m_defaultFloatWindowSize = new Size(300, 300);
- [Category("Layout")]
- [LocalizedDescription("DockPanel_DefaultFloatWindowSize_Description")]
- public Size DefaultFloatWindowSize
- {
- get { return m_defaultFloatWindowSize; }
- set { m_defaultFloatWindowSize = value; }
- }
- private bool ShouldSerializeDefaultFloatWindowSize()
- {
- return DefaultFloatWindowSize != new Size(300, 300);
- }
-
- private DocumentStyle m_documentStyle = DocumentStyle.DockingMdi;
- [LocalizedCategory("Category_Docking")]
- [LocalizedDescription("DockPanel_DocumentStyle_Description")]
- [DefaultValue(DocumentStyle.DockingMdi)]
- public DocumentStyle DocumentStyle
- {
- get { return m_documentStyle; }
- set
- {
- if (value == m_documentStyle)
- return;
-
- if (!Enum.IsDefined(typeof(DocumentStyle), value))
- throw new InvalidEnumArgumentException();
-
- if (value == DocumentStyle.SystemMdi && DockWindows[DockState.Document].VisibleNestedPanes.Count > 0)
- throw new InvalidEnumArgumentException();
-
- m_documentStyle = value;
-
- SuspendLayout(true);
-
- SetAutoHideWindowParent();
- SetMdiClient();
- InvalidateWindowRegion();
-
- foreach (IDockContent content in Contents)
- {
- if (content.DockHandler.DockState == DockState.Document)
- content.DockHandler.SetPaneAndVisible(content.DockHandler.Pane);
- }
-
- PerformMdiClientLayout();
-
- ResumeLayout(true, true);
- }
- }
-
- private int GetDockWindowSize(DockState dockState)
- {
- if (dockState == DockState.DockLeft || dockState == DockState.DockRight)
- {
- int width = ClientRectangle.Width - DockPadding.Left - DockPadding.Right;
- int dockLeftSize = m_dockLeftPortion >= 1 ? (int)m_dockLeftPortion : (int)(width * m_dockLeftPortion);
- int dockRightSize = m_dockRightPortion >= 1 ? (int)m_dockRightPortion : (int)(width * m_dockRightPortion);
-
- if (dockLeftSize < MeasurePane.MinSize)
- dockLeftSize = MeasurePane.MinSize;
- if (dockRightSize < MeasurePane.MinSize)
- dockRightSize = MeasurePane.MinSize;
-
- if (dockLeftSize + dockRightSize > width - MeasurePane.MinSize)
- {
- int adjust = (dockLeftSize + dockRightSize) - (width - MeasurePane.MinSize);
- dockLeftSize -= adjust / 2;
- dockRightSize -= adjust / 2;
- }
-
- return dockState == DockState.DockLeft ? dockLeftSize : dockRightSize;
- }
- else if (dockState == DockState.DockTop || dockState == DockState.DockBottom)
- {
- int height = ClientRectangle.Height - DockPadding.Top - DockPadding.Bottom;
- int dockTopSize = m_dockTopPortion >= 1 ? (int)m_dockTopPortion : (int)(height * m_dockTopPortion);
- int dockBottomSize = m_dockBottomPortion >= 1 ? (int)m_dockBottomPortion : (int)(height * m_dockBottomPortion);
-
- if (dockTopSize < MeasurePane.MinSize)
- dockTopSize = MeasurePane.MinSize;
- if (dockBottomSize < MeasurePane.MinSize)
- dockBottomSize = MeasurePane.MinSize;
-
- if (dockTopSize + dockBottomSize > height - MeasurePane.MinSize)
- {
- int adjust = (dockTopSize + dockBottomSize) - (height - MeasurePane.MinSize);
- dockTopSize -= adjust / 2;
- dockBottomSize -= adjust / 2;
- }
-
- return dockState == DockState.DockTop ? dockTopSize : dockBottomSize;
- }
- else
- return 0;
- }
-
- protected override void OnLayout(LayoutEventArgs levent)
- {
- SuspendLayout(true);
-
- AutoHideStripControl.Bounds = ClientRectangle;
-
- CalculateDockPadding();
-
- DockWindows[DockState.DockLeft].Width = GetDockWindowSize(DockState.DockLeft);
- DockWindows[DockState.DockRight].Width = GetDockWindowSize(DockState.DockRight);
- DockWindows[DockState.DockTop].Height = GetDockWindowSize(DockState.DockTop);
- DockWindows[DockState.DockBottom].Height = GetDockWindowSize(DockState.DockBottom);
-
- AutoHideWindow.Bounds = GetAutoHideWindowBounds(AutoHideWindowRectangle);
-
- DockWindows[DockState.Document].BringToFront();
- AutoHideWindow.BringToFront();
-
- base.OnLayout(levent);
-
- if (DocumentStyle == DocumentStyle.SystemMdi && MdiClientExists)
- {
- SetMdiClientBounds(SystemMdiClientBounds);
- InvalidateWindowRegion();
- }
- else if (DocumentStyle == DocumentStyle.DockingMdi)
- InvalidateWindowRegion();
-
- ResumeLayout(true, true);
- }
-
- internal Rectangle GetTabStripRectangle(DockState dockState)
- {
- return AutoHideStripControl.GetTabStripRectangle(dockState);
- }
-
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
-
- Graphics g = e.Graphics;
- g.FillRectangle(SystemBrushes.AppWorkspace, ClientRectangle);
- }
-
- internal void AddContent(IDockContent content)
- {
- if (content == null)
- throw(new ArgumentNullException());
-
- if (!Contents.Contains(content))
- {
- Contents.Add(content);
- OnContentAdded(new DockContentEventArgs(content));
- }
- }
-
- internal void AddPane(DockPane pane)
- {
- if (Panes.Contains(pane))
- return;
-
- Panes.Add(pane);
- }
-
- internal void AddFloatWindow(FloatWindow floatWindow)
- {
- if (FloatWindows.Contains(floatWindow))
- return;
-
- FloatWindows.Add(floatWindow);
- }
-
- private void CalculateDockPadding()
- {
- DockPadding.All = 0;
-
- int height = AutoHideStripControl.MeasureHeight();
-
- if (AutoHideStripControl.GetNumberOfPanes(DockState.DockLeftAutoHide) > 0)
- DockPadding.Left = height;
- if (AutoHideStripControl.GetNumberOfPanes(DockState.DockRightAutoHide) > 0)
- DockPadding.Right = height;
- if (AutoHideStripControl.GetNumberOfPanes(DockState.DockTopAutoHide) > 0)
- DockPadding.Top = height;
- if (AutoHideStripControl.GetNumberOfPanes(DockState.DockBottomAutoHide) > 0)
- DockPadding.Bottom = height;
- }
-
- internal void RemoveContent(IDockContent content)
- {
- if (content == null)
- throw(new ArgumentNullException());
-
- if (Contents.Contains(content))
- {
- Contents.Remove(content);
- OnContentRemoved(new DockContentEventArgs(content));
- }
- }
-
- internal void RemovePane(DockPane pane)
- {
- if (!Panes.Contains(pane))
- return;
-
- Panes.Remove(pane);
- }
-
- internal void RemoveFloatWindow(FloatWindow floatWindow)
- {
- if (!FloatWindows.Contains(floatWindow))
- return;
-
- FloatWindows.Remove(floatWindow);
- }
-
- public void SetPaneIndex(DockPane pane, int index)
- {
- int oldIndex = Panes.IndexOf(pane);
- if (oldIndex == -1)
- throw(new ArgumentException(Strings.DockPanel_SetPaneIndex_InvalidPane));
-
- if (index < 0 || index > Panes.Count - 1)
- if (index != -1)
- throw(new ArgumentOutOfRangeException(Strings.DockPanel_SetPaneIndex_InvalidIndex));
-
- if (oldIndex == index)
- return;
- if (oldIndex == Panes.Count - 1 && index == -1)
- return;
-
- Panes.Remove(pane);
- if (index == -1)
- Panes.Add(pane);
- else if (oldIndex < index)
- Panes.AddAt(pane, index - 1);
- else
- Panes.AddAt(pane, index);
- }
-
- public void SuspendLayout(bool allWindows)
- {
- FocusManager.SuspendFocusTracking();
- SuspendLayout();
- if (allWindows)
- SuspendMdiClientLayout();
- }
-
- public void ResumeLayout(bool performLayout, bool allWindows)
- {
- FocusManager.ResumeFocusTracking();
- ResumeLayout(performLayout);
- if (allWindows)
- ResumeMdiClientLayout(performLayout);
- }
-
- internal Form ParentForm
- {
- get
- {
- if (!IsParentFormValid())
- throw new InvalidOperationException(Strings.DockPanel_ParentForm_Invalid);
-
- return GetMdiClientController().ParentForm;
- }
- }
-
- private bool IsParentFormValid()
- {
- if (DocumentStyle == DocumentStyle.DockingSdi || DocumentStyle == DocumentStyle.DockingWindow)
- return true;
-
- if (!MdiClientExists)
- GetMdiClientController().RenewMdiClient();
-
- return (MdiClientExists);
- }
-
- protected override void OnParentChanged(EventArgs e)
- {
- SetAutoHideWindowParent();
- GetMdiClientController().ParentForm = (this.Parent as Form);
- base.OnParentChanged (e);
- }
-
- private void SetAutoHideWindowParent()
- {
- Control parent;
- if (DocumentStyle == DocumentStyle.DockingMdi ||
- DocumentStyle == DocumentStyle.SystemMdi)
- parent = this.Parent;
- else
- parent = this;
- if (AutoHideWindow.Parent != parent)
- {
- AutoHideWindow.Parent = parent;
- AutoHideWindow.BringToFront();
- }
- }
-
- protected override void OnVisibleChanged(EventArgs e)
- {
- base.OnVisibleChanged (e);
-
- if (Visible)
- SetMdiClient();
- }
-
- private Rectangle SystemMdiClientBounds
- {
- get
- {
- if (!IsParentFormValid() || !Visible)
- return Rectangle.Empty;
-
- Rectangle rect = ParentForm.RectangleToClient(RectangleToScreen(DocumentWindowBounds));
- return rect;
- }
- }
-
- internal Rectangle DocumentWindowBounds
- {
- get
- {
- Rectangle rectDocumentBounds = DisplayRectangle;
- if (DockWindows[DockState.DockLeft].Visible)
- {
- rectDocumentBounds.X += DockWindows[DockState.DockLeft].Width;
- rectDocumentBounds.Width -= DockWindows[DockState.DockLeft].Width;
- }
- if (DockWindows[DockState.DockRight].Visible)
- rectDocumentBounds.Width -= DockWindows[DockState.DockRight].Width;
- if (DockWindows[DockState.DockTop].Visible)
- {
- rectDocumentBounds.Y += DockWindows[DockState.DockTop].Height;
- rectDocumentBounds.Height -= DockWindows[DockState.DockTop].Height;
- }
- if (DockWindows[DockState.DockBottom].Visible)
- rectDocumentBounds.Height -= DockWindows[DockState.DockBottom].Height;
-
- return rectDocumentBounds;
-
- }
- }
-
- private PaintEventHandler m_dummyControlPaintEventHandler = null;
- private void InvalidateWindowRegion()
- {
- if (DesignMode)
- return;
-
- if (m_dummyControlPaintEventHandler == null)
- m_dummyControlPaintEventHandler = new PaintEventHandler(DummyControl_Paint);
-
- DummyControl.Paint += m_dummyControlPaintEventHandler;
- DummyControl.Invalidate();
- }
-
- void DummyControl_Paint(object sender, PaintEventArgs e)
- {
- DummyControl.Paint -= m_dummyControlPaintEventHandler;
- UpdateWindowRegion();
- }
-
- private void UpdateWindowRegion()
- {
- if (this.DocumentStyle == DocumentStyle.DockingMdi)
- UpdateWindowRegion_ClipContent();
- else if (this.DocumentStyle == DocumentStyle.DockingSdi ||
- this.DocumentStyle == DocumentStyle.DockingWindow)
- UpdateWindowRegion_FullDocumentArea();
- else if (this.DocumentStyle == DocumentStyle.SystemMdi)
- UpdateWindowRegion_EmptyDocumentArea();
- }
-
- private void UpdateWindowRegion_FullDocumentArea()
- {
- SetRegion(null);
- }
-
- private void UpdateWindowRegion_EmptyDocumentArea()
- {
- Rectangle rect = DocumentWindowBounds;
- SetRegion(new Rectangle[] { rect });
- }
-
- private void UpdateWindowRegion_ClipContent()
- {
- int count = 0;
- foreach (DockPane pane in this.Panes)
- {
- if (!pane.Visible || pane.DockState != DockState.Document)
- continue;
-
- count ++;
- }
-
- if (count == 0)
- {
- SetRegion(null);
- return;
- }
-
- Rectangle[] rects = new Rectangle[count];
- int i = 0;
- foreach (DockPane pane in this.Panes)
- {
- if (!pane.Visible || pane.DockState != DockState.Document)
- continue;
-
- rects[i] = RectangleToClient(pane.RectangleToScreen(pane.ContentRectangle));
- i++;
- }
-
- SetRegion(rects);
- }
-
- private Rectangle[] m_clipRects = null;
- private void SetRegion(Rectangle[] clipRects)
- {
- if (!IsClipRectsChanged(clipRects))
- return;
-
- m_clipRects = clipRects;
-
- if (m_clipRects == null || m_clipRects.GetLength(0) == 0)
- Region = null;
- else
- {
- Region region = new Region(new Rectangle(0, 0, this.Width, this.Height));
- foreach (Rectangle rect in m_clipRects)
- region.Exclude(rect);
- Region = region;
- }
- }
-
- private bool IsClipRectsChanged(Rectangle[] clipRects)
- {
- if (clipRects == null && m_clipRects == null)
- return false;
- else if ((clipRects == null) != (m_clipRects == null))
- return true;
-
- foreach (Rectangle rect in clipRects)
- {
- bool matched = false;
- foreach (Rectangle rect2 in m_clipRects)
- {
- if (rect == rect2)
- {
- matched = true;
- break;
- }
- }
- if (!matched)
- return true;
- }
-
- foreach (Rectangle rect2 in m_clipRects)
- {
- bool matched = false;
- foreach (Rectangle rect in clipRects)
- {
- if (rect == rect2)
- {
- matched = true;
- break;
- }
- }
- if (!matched)
- return true;
- }
- return false;
- }
-
- private static readonly object ContentAddedEvent = new object();
- [LocalizedCategory("Category_DockingNotification")]
- [LocalizedDescription("DockPanel_ContentAdded_Description")]
- public event EventHandler ContentAdded
- {
- add { Events.AddHandler(ContentAddedEvent, value); }
- remove { Events.RemoveHandler(ContentAddedEvent, value); }
- }
- protected virtual void OnContentAdded(DockContentEventArgs e)
- {
- EventHandler handler = (EventHandler)Events[ContentAddedEvent];
- if (handler != null)
- handler(this, e);
- }
-
- private static readonly object ContentRemovedEvent = new object();
- [LocalizedCategory("Category_DockingNotification")]
- [LocalizedDescription("DockPanel_ContentRemoved_Description")]
- public event EventHandler ContentRemoved
- {
- add { Events.AddHandler(ContentRemovedEvent, value); }
- remove { Events.RemoveHandler(ContentRemovedEvent, value); }
- }
- protected virtual void OnContentRemoved(DockContentEventArgs e)
- {
- EventHandler handler = (EventHandler)Events[ContentRemovedEvent];
- if (handler != null)
- handler(this, e);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanelExtender.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanelExtender.cs
deleted file mode 100644
index e304ea7551..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockPanelExtender.cs
+++ /dev/null
@@ -1,225 +0,0 @@
-using System;
-using System.Drawing;
-using System.Diagnostics.CodeAnalysis;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public sealed class DockPanelExtender
- {
- [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- public interface IDockPaneFactory
- {
- DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show);
- [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")]
- DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show);
- DockPane CreateDockPane(IDockContent content, DockPane previousPane, DockAlignment alignment, double proportion, bool show);
- [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters", MessageId = "1#")]
- DockPane CreateDockPane(IDockContent content, Rectangle floatWindowBounds, bool show);
- }
-
- [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- public interface IFloatWindowFactory
- {
- FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane);
- FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds);
- }
-
- [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- public interface IDockPaneCaptionFactory
- {
- DockPaneCaptionBase CreateDockPaneCaption(DockPane pane);
- }
-
- [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- public interface IDockPaneStripFactory
- {
- DockPaneStripBase CreateDockPaneStrip(DockPane pane);
- }
-
- [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")]
- public interface IAutoHideStripFactory
- {
- AutoHideStripBase CreateAutoHideStrip(DockPanel panel);
- }
-
- #region DefaultDockPaneFactory
- private class DefaultDockPaneFactory : IDockPaneFactory
- {
- public DockPane CreateDockPane(IDockContent content, DockState visibleState, bool show)
- {
- return new DockPane(content, visibleState, show);
- }
-
- public DockPane CreateDockPane(IDockContent content, FloatWindow floatWindow, bool show)
- {
- return new DockPane(content, floatWindow, show);
- }
-
- public DockPane CreateDockPane(IDockContent content, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
- {
- return new DockPane(content, prevPane, alignment, proportion, show);
- }
-
- public DockPane CreateDockPane(IDockContent content, Rectangle floatWindowBounds, bool show)
- {
- return new DockPane(content, floatWindowBounds, show);
- }
- }
- #endregion
-
- #region DefaultFloatWindowFactory
- private class DefaultFloatWindowFactory : IFloatWindowFactory
- {
- public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane)
- {
- return new FloatWindow(dockPanel, pane);
- }
-
- public FloatWindow CreateFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
- {
- return new FloatWindow(dockPanel, pane, bounds);
- }
- }
- #endregion
-
- #region DefaultDockPaneCaptionFactory
- private class DefaultDockPaneCaptionFactory : IDockPaneCaptionFactory
- {
- public DockPaneCaptionBase CreateDockPaneCaption(DockPane pane)
- {
- return new VS2005DockPaneCaption(pane);
- }
- }
- #endregion
-
- #region DefaultDockPaneTabStripFactory
- private class DefaultDockPaneStripFactory : IDockPaneStripFactory
- {
- public DockPaneStripBase CreateDockPaneStrip(DockPane pane)
- {
- return new VS2005DockPaneStrip(pane);
- }
- }
- #endregion
-
- #region DefaultAutoHideStripFactory
- private class DefaultAutoHideStripFactory : IAutoHideStripFactory
- {
- public AutoHideStripBase CreateAutoHideStrip(DockPanel panel)
- {
- return new VS2005AutoHideStrip(panel);
- }
- }
- #endregion
-
- internal DockPanelExtender(DockPanel dockPanel)
- {
- m_dockPanel = dockPanel;
- }
-
- private DockPanel m_dockPanel;
- private DockPanel DockPanel
- {
- get { return m_dockPanel; }
- }
-
- private IDockPaneFactory m_dockPaneFactory = null;
- public IDockPaneFactory DockPaneFactory
- {
- get
- {
- if (m_dockPaneFactory == null)
- m_dockPaneFactory = new DefaultDockPaneFactory();
-
- return m_dockPaneFactory;
- }
- set
- {
- if (DockPanel.Panes.Count > 0)
- throw new InvalidOperationException();
-
- m_dockPaneFactory = value;
- }
- }
-
- private IFloatWindowFactory m_floatWindowFactory = null;
- public IFloatWindowFactory FloatWindowFactory
- {
- get
- {
- if (m_floatWindowFactory == null)
- m_floatWindowFactory = new DefaultFloatWindowFactory();
-
- return m_floatWindowFactory;
- }
- set
- {
- if (DockPanel.FloatWindows.Count > 0)
- throw new InvalidOperationException();
-
- m_floatWindowFactory = value;
- }
- }
-
- private IDockPaneCaptionFactory m_dockPaneCaptionFactory = null;
- public IDockPaneCaptionFactory DockPaneCaptionFactory
- {
- get
- {
- if (m_dockPaneCaptionFactory == null)
- m_dockPaneCaptionFactory = new DefaultDockPaneCaptionFactory();
-
- return m_dockPaneCaptionFactory;
- }
- set
- {
- if (DockPanel.Panes.Count > 0)
- throw new InvalidOperationException();
-
- m_dockPaneCaptionFactory = value;
- }
- }
-
- private IDockPaneStripFactory m_dockPaneStripFactory = null;
- public IDockPaneStripFactory DockPaneStripFactory
- {
- get
- {
- if (m_dockPaneStripFactory == null)
- m_dockPaneStripFactory = new DefaultDockPaneStripFactory();
-
- return m_dockPaneStripFactory;
- }
- set
- {
- if (DockPanel.Contents.Count > 0)
- throw new InvalidOperationException();
-
- m_dockPaneStripFactory = value;
- }
- }
-
- private IAutoHideStripFactory m_autoHideStripFactory = null;
- public IAutoHideStripFactory AutoHideStripFactory
- {
- get
- {
- if (m_autoHideStripFactory == null)
- m_autoHideStripFactory = new DefaultAutoHideStripFactory();
-
- return m_autoHideStripFactory;
- }
- set
- {
- if (DockPanel.Contents.Count > 0)
- throw new InvalidOperationException();
-
- if (m_autoHideStripFactory == value)
- return;
-
- m_autoHideStripFactory = value;
- DockPanel.ResetAutoHideStripControl();
- }
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindow.SplitterControl.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindow.SplitterControl.cs
deleted file mode 100644
index 3eaa653907..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindow.SplitterControl.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public partial class DockWindow
- {
- private class SplitterControl : SplitterBase
- {
- protected override int SplitterSize
- {
- get { return Measures.SplitterSize; }
- }
-
- protected override void StartDrag()
- {
- DockWindow window = Parent as DockWindow;
- if (window == null)
- return;
-
- window.DockPanel.BeginDrag(window, window.RectangleToScreen(Bounds));
- }
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindow.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindow.cs
deleted file mode 100644
index 4bbf423ae0..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindow.cs
+++ /dev/null
@@ -1,243 +0,0 @@
-using System;
-using System.Windows.Forms;
-using System.Drawing;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- [ToolboxItem(false)]
- public partial class DockWindow : Panel, INestedPanesContainer, ISplitterDragSource
- {
- private DockPanel m_dockPanel;
- private DockState m_dockState;
- private SplitterControl m_splitter;
- private NestedPaneCollection m_nestedPanes;
-
- internal DockWindow(DockPanel dockPanel, DockState dockState)
- {
- m_nestedPanes = new NestedPaneCollection(this);
- m_dockPanel = dockPanel;
- m_dockState = dockState;
- Visible = false;
-
- SuspendLayout();
-
- if (DockState == DockState.DockLeft || DockState == DockState.DockRight ||
- DockState == DockState.DockTop || DockState == DockState.DockBottom)
- {
- m_splitter = new SplitterControl();
- Controls.Add(m_splitter);
- }
-
- if (DockState == DockState.DockLeft)
- {
- Dock = DockStyle.Left;
- m_splitter.Dock = DockStyle.Right;
- }
- else if (DockState == DockState.DockRight)
- {
- Dock = DockStyle.Right;
- m_splitter.Dock = DockStyle.Left;
- }
- else if (DockState == DockState.DockTop)
- {
- Dock = DockStyle.Top;
- m_splitter.Dock = DockStyle.Bottom;
- }
- else if (DockState == DockState.DockBottom)
- {
- Dock = DockStyle.Bottom;
- m_splitter.Dock = DockStyle.Top;
- }
- else if (DockState == DockState.Document)
- {
- Dock = DockStyle.Fill;
- }
-
- ResumeLayout();
- }
-
- public VisibleNestedPaneCollection VisibleNestedPanes
- {
- get { return NestedPanes.VisibleNestedPanes; }
- }
-
- public NestedPaneCollection NestedPanes
- {
- get { return m_nestedPanes; }
- }
-
- public DockPanel DockPanel
- {
- get { return m_dockPanel; }
- }
-
- public DockState DockState
- {
- get { return m_dockState; }
- }
-
- public bool IsFloat
- {
- get { return DockState == DockState.Float; }
- }
-
- internal DockPane DefaultPane
- {
- get { return VisibleNestedPanes.Count == 0 ? null : VisibleNestedPanes[0]; }
- }
-
- public virtual Rectangle DisplayingRectangle
- {
- get
- {
- Rectangle rect = ClientRectangle;
- // if DockWindow is document, exclude the border
- if (DockState == DockState.Document)
- {
- rect.X += 1;
- rect.Y += 1;
- rect.Width -= 2;
- rect.Height -= 2;
- }
- // exclude the splitter
- else if (DockState == DockState.DockLeft)
- rect.Width -= Measures.SplitterSize;
- else if (DockState == DockState.DockRight)
- {
- rect.X += Measures.SplitterSize;
- rect.Width -= Measures.SplitterSize;
- }
- else if (DockState == DockState.DockTop)
- rect.Height -= Measures.SplitterSize;
- else if (DockState == DockState.DockBottom)
- {
- rect.Y += Measures.SplitterSize;
- rect.Height -= Measures.SplitterSize;
- }
-
- return rect;
- }
- }
-
- protected override void OnPaint(PaintEventArgs e)
- {
- // if DockWindow is document, draw the border
- if (DockState == DockState.Document)
- e.Graphics.DrawRectangle(SystemPens.ControlDark, ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width - 1, ClientRectangle.Height - 1);
-
- base.OnPaint(e);
- }
-
- protected override void OnLayout(LayoutEventArgs levent)
- {
- VisibleNestedPanes.Refresh();
- if (VisibleNestedPanes.Count == 0)
- {
- if (Visible)
- Visible = false;
- }
- else if (!Visible)
- {
- Visible = true;
- VisibleNestedPanes.Refresh();
- }
-
- base.OnLayout (levent);
- }
-
- #region ISplitterDragSource Members
-
- void ISplitterDragSource.BeginDrag(Rectangle rectSplitter)
- {
- }
-
- void ISplitterDragSource.EndDrag()
- {
- }
-
- bool ISplitterDragSource.IsVertical
- {
- get { return (DockState == DockState.DockLeft || DockState == DockState.DockRight); }
- }
-
- Rectangle ISplitterDragSource.DragLimitBounds
- {
- get
- {
- Rectangle rectLimit = DockPanel.DockArea;
- Point location;
- if ((Control.ModifierKeys & Keys.Shift) == 0)
- location = Location;
- else
- location = DockPanel.DockArea.Location;
-
- if (((ISplitterDragSource)this).IsVertical)
- {
- rectLimit.X += MeasurePane.MinSize;
- rectLimit.Width -= 2 * MeasurePane.MinSize;
- rectLimit.Y = location.Y;
- if ((Control.ModifierKeys & Keys.Shift) == 0)
- rectLimit.Height = Height;
- }
- else
- {
- rectLimit.Y += MeasurePane.MinSize;
- rectLimit.Height -= 2 * MeasurePane.MinSize;
- rectLimit.X = location.X;
- if ((Control.ModifierKeys & Keys.Shift) == 0)
- rectLimit.Width = Width;
- }
-
- return DockPanel.RectangleToScreen(rectLimit);
- }
- }
-
- void ISplitterDragSource.MoveSplitter(int offset)
- {
- if ((Control.ModifierKeys & Keys.Shift) != 0)
- SendToBack();
-
- Rectangle rectDockArea = DockPanel.DockArea;
- if (DockState == DockState.DockLeft && rectDockArea.Width > 0)
- {
- if (DockPanel.DockLeftPortion > 1)
- DockPanel.DockLeftPortion = Width + offset;
- else
- DockPanel.DockLeftPortion += ((double)offset) / (double)rectDockArea.Width;
- }
- else if (DockState == DockState.DockRight && rectDockArea.Width > 0)
- {
- if (DockPanel.DockRightPortion > 1)
- DockPanel.DockRightPortion = Width - offset;
- else
- DockPanel.DockRightPortion -= ((double)offset) / (double)rectDockArea.Width;
- }
- else if (DockState == DockState.DockBottom && rectDockArea.Height > 0)
- {
- if (DockPanel.DockBottomPortion > 1)
- DockPanel.DockBottomPortion = Height - offset;
- else
- DockPanel.DockBottomPortion -= ((double)offset) / (double)rectDockArea.Height;
- }
- else if (DockState == DockState.DockTop && rectDockArea.Height > 0)
- {
- if (DockPanel.DockTopPortion > 1)
- DockPanel.DockTopPortion = Height + offset;
- else
- DockPanel.DockTopPortion += ((double)offset) / (double)rectDockArea.Height;
- }
- }
-
- #region IDragSource Members
-
- Control IDragSource.DragControl
- {
- get { return this; }
- }
-
- #endregion
- #endregion
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindowCollection.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindowCollection.cs
deleted file mode 100644
index edb114145f..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DockWindowCollection.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public class DockWindowCollection : ReadOnlyCollection
- {
- internal DockWindowCollection(DockPanel dockPanel)
- : base(new List())
- {
- Items.Add(new DockWindow(dockPanel, DockState.Document));
- Items.Add(new DockWindow(dockPanel, DockState.DockLeft));
- Items.Add(new DockWindow(dockPanel, DockState.DockRight));
- Items.Add(new DockWindow(dockPanel, DockState.DockTop));
- Items.Add(new DockWindow(dockPanel, DockState.DockBottom));
- }
-
- public DockWindow this [DockState dockState]
- {
- get
- {
- if (dockState == DockState.Document)
- return Items[0];
- else if (dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide)
- return Items[1];
- else if (dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide)
- return Items[2];
- else if (dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide)
- return Items[3];
- else if (dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide)
- return Items[4];
-
- throw (new ArgumentOutOfRangeException());
- }
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DragForm.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DragForm.cs
deleted file mode 100644
index 08187e9d96..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DragForm.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- // Inspired by Chris Sano's article:
- // http://msdn.microsoft.com/smartclient/default.aspx?pull=/library/en-us/dnwinforms/html/colorpicker.asp
- // In Sano's article, the DragForm needs to meet the following criteria:
- // (1) it was not to show up in the task bar;
- // ShowInTaskBar = false
- // (2) it needed to be the top-most window;
- // TopMost = true (not necessary here)
- // (3) its icon could not show up in the ALT+TAB window if the user pressed ALT+TAB during a drag-and-drop;
- // FormBorderStyle = FormBorderStyle.None;
- // Create with WS_EX_TOOLWINDOW window style.
- // Compares with the solution in the artile by setting FormBorderStyle as FixedToolWindow,
- // and then clip the window caption and border, this way is much simplier.
- // (4) it was not to steal focus from the application when displayed.
- // User Win32 ShowWindow API with SW_SHOWNOACTIVATE
- // In addition, this form should only for display and therefore should act as transparent, otherwise
- // WindowFromPoint will return this form, instead of the control beneath. Need BOTH of the following to
- // achieve this (don't know why, spent hours to try it out :( ):
- // 1. Enabled = false;
- // 2. WM_NCHITTEST returns HTTRANSPARENT
- internal class DragForm : Form
- {
- public DragForm()
- {
- FormBorderStyle = FormBorderStyle.None;
- ShowInTaskbar = false;
- SetStyle(ControlStyles.Selectable, false);
- Enabled = false;
- }
-
- protected override CreateParams CreateParams
- {
- get
- {
- CreateParams createParams = base.CreateParams;
- createParams.ExStyle |= (int)Win32.WindowExStyles.WS_EX_TOOLWINDOW;
- return createParams;
- }
- }
-
- protected override void WndProc(ref Message m)
- {
- if (m.Msg == (int)Win32.Msgs.WM_NCHITTEST)
- {
- m.Result = (IntPtr)Win32.HitTest.HTTRANSPARENT;
- return;
- }
-
- base.WndProc (ref m);
- }
-
- public virtual void Show(bool bActivate)
- {
- if (bActivate)
- Show();
- else
- NativeMethods.ShowWindow(Handle, (int)Win32.ShowWindowStyles.SW_SHOWNOACTIVATE);
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DummyControl.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DummyControl.cs
deleted file mode 100644
index 99832c018d..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/DummyControl.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal class DummyControl : Control
- {
- public DummyControl()
- {
- SetStyle(ControlStyles.Selectable, false);
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Enums.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Enums.cs
deleted file mode 100644
index ba7587f1fa..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Enums.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- [Flags]
- [Serializable]
- [Editor(typeof(DockAreasEditor), typeof(System.Drawing.Design.UITypeEditor))]
- public enum DockAreas
- {
- Float = 1,
- DockLeft = 2,
- DockRight = 4,
- DockTop = 8,
- DockBottom = 16,
- Document = 32
- }
-
- public enum DockState
- {
- Unknown = 0,
- Float = 1,
- DockTopAutoHide = 2,
- DockLeftAutoHide = 3,
- DockBottomAutoHide = 4,
- DockRightAutoHide = 5,
- Document = 6,
- DockTop = 7,
- DockLeft = 8,
- DockBottom = 9,
- DockRight = 10,
- Hidden = 11
- }
-
- public enum DockAlignment
- {
- Left,
- Right,
- Top,
- Bottom
- }
-
- public enum DocumentStyle
- {
- DockingMdi,
- DockingWindow,
- DockingSdi,
- SystemMdi,
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/FloatWindow.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/FloatWindow.cs
deleted file mode 100644
index ee17428fe7..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/FloatWindow.cs
+++ /dev/null
@@ -1,436 +0,0 @@
-using System;
-using System.Collections;
-using System.Drawing;
-using System.Windows.Forms;
-using System.Runtime.InteropServices;
-using System.Security.Permissions;
-using System.Diagnostics.CodeAnalysis;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public class FloatWindow : Form, INestedPanesContainer, IDockDragSource
- {
- private NestedPaneCollection m_nestedPanes;
- internal const int WM_CHECKDISPOSE = (int)(Win32.Msgs.WM_USER + 1);
-
- internal protected FloatWindow(DockPanel dockPanel, DockPane pane)
- {
- InternalConstruct(dockPanel, pane, false, Rectangle.Empty);
- }
-
- internal protected FloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
- {
- InternalConstruct(dockPanel, pane, true, bounds);
- }
-
- private void InternalConstruct(DockPanel dockPanel, DockPane pane, bool boundsSpecified, Rectangle bounds)
- {
- if (dockPanel == null)
- throw(new ArgumentNullException(Strings.FloatWindow_Constructor_NullDockPanel));
-
- m_nestedPanes = new NestedPaneCollection(this);
-
- FormBorderStyle = FormBorderStyle.SizableToolWindow;
- ShowInTaskbar = false;
- if (dockPanel.RightToLeft != RightToLeft)
- RightToLeft = dockPanel.RightToLeft;
- if (RightToLeftLayout != dockPanel.RightToLeftLayout)
- RightToLeftLayout = dockPanel.RightToLeftLayout;
-
- SuspendLayout();
- if (boundsSpecified)
- {
- Bounds = bounds;
- StartPosition = FormStartPosition.Manual;
- }
- else
- {
- StartPosition = FormStartPosition.WindowsDefaultLocation;
- Size = dockPanel.DefaultFloatWindowSize;
- }
-
- m_dockPanel = dockPanel;
- Owner = DockPanel.FindForm();
- DockPanel.AddFloatWindow(this);
- if (pane != null)
- pane.FloatWindow = this;
-
- ResumeLayout();
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- if (DockPanel != null)
- DockPanel.RemoveFloatWindow(this);
- m_dockPanel = null;
- }
- base.Dispose(disposing);
- }
-
- private bool m_allowEndUserDocking = true;
- public bool AllowEndUserDocking
- {
- get { return m_allowEndUserDocking; }
- set { m_allowEndUserDocking = value; }
- }
-
- public NestedPaneCollection NestedPanes
- {
- get { return m_nestedPanes; }
- }
-
- public VisibleNestedPaneCollection VisibleNestedPanes
- {
- get { return NestedPanes.VisibleNestedPanes; }
- }
-
- private DockPanel m_dockPanel;
- public DockPanel DockPanel
- {
- get { return m_dockPanel; }
- }
-
- public DockState DockState
- {
- get { return DockState.Float; }
- }
-
- public bool IsFloat
- {
- get { return DockState == DockState.Float; }
- }
-
- internal bool IsDockStateValid(DockState dockState)
- {
- foreach (DockPane pane in NestedPanes)
- foreach (IDockContent content in pane.Contents)
- if (!DockHelper.IsDockStateValid(dockState, content.DockHandler.DockAreas))
- return false;
-
- return true;
- }
-
- protected override void OnActivated(EventArgs e)
- {
- DockPanel.FloatWindows.BringWindowToFront(this);
- base.OnActivated (e);
- }
-
- protected override void OnLayout(LayoutEventArgs levent)
- {
- VisibleNestedPanes.Refresh();
- RefreshChanges();
- Visible = (VisibleNestedPanes.Count > 0);
- SetText();
-
- base.OnLayout(levent);
- }
-
-
- [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.Windows.Forms.Control.set_Text(System.String)")]
- internal void SetText()
- {
- DockPane theOnlyPane = (VisibleNestedPanes.Count == 1) ? VisibleNestedPanes[0] : null;
-
- if (theOnlyPane == null)
- Text = " "; // use " " instead of string.Empty because the whole title bar will disappear when ControlBox is set to false.
- else if (theOnlyPane.ActiveContent == null)
- Text = " ";
- else
- Text = theOnlyPane.ActiveContent.DockHandler.TabText;
- }
-
- protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
- {
- Rectangle rectWorkArea = SystemInformation.VirtualScreen;
-
- if (y + height > rectWorkArea.Bottom)
- y -= (y + height) - rectWorkArea.Bottom;
-
- if (y < rectWorkArea.Top)
- y += rectWorkArea.Top - y;
-
- base.SetBoundsCore (x, y, width, height, specified);
- }
-
- [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- protected override void WndProc(ref Message m)
- {
- if (m.Msg == (int)Win32.Msgs.WM_NCLBUTTONDOWN)
- {
- if (IsDisposed)
- return;
-
- uint result = NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
- if (result == 2 && DockPanel.AllowEndUserDocking && this.AllowEndUserDocking) // HITTEST_CAPTION
- {
- Activate();
- m_dockPanel.BeginDrag(this);
- }
- else
- base.WndProc(ref m);
-
- return;
- }
- else if (m.Msg == (int)Win32.Msgs.WM_NCRBUTTONDOWN)
- {
- uint result = 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;
- if (theOnlyPane != null && theOnlyPane.ActiveContent != null)
- {
- theOnlyPane.ShowTabPageContextMenu(this, PointToClient(Control.MousePosition));
- return;
- }
- }
-
- base.WndProc(ref m);
- return;
- }
- else if (m.Msg == (int)Win32.Msgs.WM_CLOSE)
- {
- if (NestedPanes.Count == 0)
- {
- base.WndProc(ref m);
- return;
- }
-
- for (int i = NestedPanes.Count - 1; i >= 0; i--)
- {
- DockContentCollection contents = NestedPanes[i].Contents;
- for (int j = contents.Count - 1; j >= 0; j--)
- {
- IDockContent content = contents[j];
- if (content.DockHandler.DockState != DockState.Float)
- continue;
-
- if (!content.DockHandler.CloseButton)
- continue;
-
- if (content.DockHandler.HideOnClose)
- content.DockHandler.Hide();
- else
- content.DockHandler.Close();
- }
- }
-
- return;
- }
- else if (m.Msg == (int)Win32.Msgs.WM_NCLBUTTONDBLCLK)
- {
- uint result = NativeMethods.SendMessage(this.Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, (uint)m.LParam);
- if (result != 2) // HITTEST_CAPTION
- {
- base.WndProc(ref m);
- return;
- }
-
- DockPanel.SuspendLayout(true);
-
- // Restore to panel
- foreach (DockPane pane in NestedPanes)
- {
- if (pane.DockState != DockState.Float)
- continue;
- pane.RestoreToPanel();
- }
-
-
- DockPanel.ResumeLayout(true, true);
- return;
- }
- else if (m.Msg == WM_CHECKDISPOSE)
- {
- if (NestedPanes.Count == 0)
- Dispose();
-
- return;
- }
-
- base.WndProc(ref m);
- }
-
- internal void RefreshChanges()
- {
- if (IsDisposed)
- return;
-
- if (VisibleNestedPanes.Count == 0)
- {
- ControlBox = true;
- return;
- }
-
- for (int i=VisibleNestedPanes.Count - 1; i>=0; i--)
- {
- DockContentCollection contents = VisibleNestedPanes[i].Contents;
- for (int j=contents.Count - 1; j>=0; j--)
- {
- IDockContent content = contents[j];
- if (content.DockHandler.DockState != DockState.Float)
- continue;
-
- if (content.DockHandler.CloseButton)
- {
- ControlBox = true;
- return;
- }
- }
- }
- ControlBox = false;
- }
-
- public virtual Rectangle DisplayingRectangle
- {
- get { return ClientRectangle; }
- }
-
- internal void TestDrop(IDockDragSource dragSource, DockOutlineBase dockOutline)
- {
- if (VisibleNestedPanes.Count == 1)
- {
- DockPane pane = VisibleNestedPanes[0];
- if (!dragSource.CanDockTo(pane))
- return;
-
- Point ptMouse = Control.MousePosition;
- uint lParam = Win32Helper.MakeLong(ptMouse.X, ptMouse.Y);
- if (NativeMethods.SendMessage(Handle, (int)Win32.Msgs.WM_NCHITTEST, 0, lParam) == (uint)Win32.HitTest.HTCAPTION)
- dockOutline.Show(VisibleNestedPanes[0], -1);
- }
- }
-
- #region IDockDragSource Members
-
- #region IDragSource Members
-
- Control IDragSource.DragControl
- {
- get { return this; }
- }
-
- #endregion
-
- bool IDockDragSource.IsDockStateValid(DockState dockState)
- {
- return IsDockStateValid(dockState);
- }
-
- bool IDockDragSource.CanDockTo(DockPane pane)
- {
- if (!IsDockStateValid(pane.DockState))
- return false;
-
- if (pane.FloatWindow == this)
- return false;
-
- return true;
- }
-
- Rectangle IDockDragSource.BeginDrag(Point ptMouse)
- {
- return Bounds;
- }
-
- public void FloatAt(Rectangle floatWindowBounds)
- {
- Bounds = floatWindowBounds;
- }
-
- public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex)
- {
- if (dockStyle == DockStyle.Fill)
- {
- for (int i = NestedPanes.Count - 1; i >= 0; i--)
- {
- DockPane paneFrom = NestedPanes[i];
- for (int j = paneFrom.Contents.Count - 1; j >= 0; j--)
- {
- IDockContent c = paneFrom.Contents[j];
- c.DockHandler.Pane = pane;
- if (contentIndex != -1)
- pane.SetContentIndex(c, contentIndex);
- }
- }
- }
- else
- {
- DockAlignment alignment = DockAlignment.Left;
- if (dockStyle == DockStyle.Left)
- alignment = DockAlignment.Left;
- else if (dockStyle == DockStyle.Right)
- alignment = DockAlignment.Right;
- else if (dockStyle == DockStyle.Top)
- alignment = DockAlignment.Top;
- else if (dockStyle == DockStyle.Bottom)
- alignment = DockAlignment.Bottom;
-
- MergeNestedPanes(VisibleNestedPanes, pane.NestedPanesContainer.NestedPanes, pane, alignment, 0.5);
- }
- }
-
- public void DockTo(DockPanel panel, DockStyle dockStyle)
- {
- if (panel != DockPanel)
- throw new ArgumentException(Strings.IDockDragSource_DockTo_InvalidPanel, "panel");
-
- NestedPaneCollection nestedPanesTo = null;
-
- if (dockStyle == DockStyle.Top)
- nestedPanesTo = DockPanel.DockWindows[DockState.DockTop].NestedPanes;
- else if (dockStyle == DockStyle.Bottom)
- nestedPanesTo = DockPanel.DockWindows[DockState.DockBottom].NestedPanes;
- else if (dockStyle == DockStyle.Left)
- nestedPanesTo = DockPanel.DockWindows[DockState.DockLeft].NestedPanes;
- else if (dockStyle == DockStyle.Right)
- nestedPanesTo = DockPanel.DockWindows[DockState.DockRight].NestedPanes;
- else if (dockStyle == DockStyle.Fill)
- nestedPanesTo = DockPanel.DockWindows[DockState.Document].NestedPanes;
-
- DockPane prevPane = null;
- for (int i = nestedPanesTo.Count - 1; i >= 0; i--)
- if (nestedPanesTo[i] != VisibleNestedPanes[0])
- prevPane = nestedPanesTo[i];
- MergeNestedPanes(VisibleNestedPanes, nestedPanesTo, prevPane, DockAlignment.Left, 0.5);
- }
-
- private static void MergeNestedPanes(VisibleNestedPaneCollection nestedPanesFrom, NestedPaneCollection nestedPanesTo, DockPane prevPane, DockAlignment alignment, double proportion)
- {
- if (nestedPanesFrom.Count == 0)
- return;
-
- int count = nestedPanesFrom.Count;
- DockPane[] panes = new DockPane[count];
- DockPane[] prevPanes = new DockPane[count];
- DockAlignment[] alignments = new DockAlignment[count];
- double[] proportions = new double[count];
-
- for (int i = 0; i < count; i++)
- {
- panes[i] = nestedPanesFrom[i];
- prevPanes[i] = nestedPanesFrom[i].NestedDockingStatus.PreviousPane;
- alignments[i] = nestedPanesFrom[i].NestedDockingStatus.Alignment;
- proportions[i] = nestedPanesFrom[i].NestedDockingStatus.Proportion;
- }
-
- DockPane pane = panes[0].DockTo(nestedPanesTo.Container, prevPane, alignment, proportion);
- panes[0].DockState = nestedPanesTo.DockState;
-
- for (int i = 1; i < count; i++)
- {
- for (int j = i; j < count; j++)
- {
- if (prevPanes[j] == panes[i - 1])
- prevPanes[j] = pane;
- }
- pane = panes[i].DockTo(nestedPanesTo.Container, prevPanes[i], alignments[i], proportions[i]);
- panes[i].DockState = nestedPanesTo.DockState;
- }
- }
-
- #endregion
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/FloatWindowCollection.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/FloatWindowCollection.cs
deleted file mode 100644
index 03f81b5de8..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/FloatWindowCollection.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public class FloatWindowCollection : ReadOnlyCollection
- {
- internal FloatWindowCollection()
- : base(new List())
- {
- }
-
- internal int Add(FloatWindow fw)
- {
- if (Items.Contains(fw))
- return Items.IndexOf(fw);
-
- Items.Add(fw);
- return Count - 1;
- }
-
- internal void Dispose()
- {
- for (int i=Count - 1; i>=0; i--)
- this[i].Close();
- }
-
- internal void Remove(FloatWindow fw)
- {
- Items.Remove(fw);
- }
-
- internal void BringWindowToFront(FloatWindow fw)
- {
- Items.Remove(fw);
- Items.Add(fw);
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Helpers/DockHelper.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Helpers/DockHelper.cs
deleted file mode 100644
index 885dd0f7e6..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Helpers/DockHelper.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-using System;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal static class DockHelper
- {
- public static bool IsDockStateAutoHide(DockState dockState)
- {
- if (dockState == DockState.DockLeftAutoHide ||
- dockState == DockState.DockRightAutoHide ||
- dockState == DockState.DockTopAutoHide ||
- dockState == DockState.DockBottomAutoHide)
- return true;
- else
- return false;
- }
-
- public static bool IsDockStateValid(DockState dockState, DockAreas dockableAreas)
- {
- if (((dockableAreas & DockAreas.Float) == 0) &&
- (dockState == DockState.Float))
- return false;
- else if (((dockableAreas & DockAreas.Document) == 0) &&
- (dockState == DockState.Document))
- return false;
- else if (((dockableAreas & DockAreas.DockLeft) == 0) &&
- (dockState == DockState.DockLeft || dockState == DockState.DockLeftAutoHide))
- return false;
- else if (((dockableAreas & DockAreas.DockRight) == 0) &&
- (dockState == DockState.DockRight || dockState == DockState.DockRightAutoHide))
- return false;
- else if (((dockableAreas & DockAreas.DockTop) == 0) &&
- (dockState == DockState.DockTop || dockState == DockState.DockTopAutoHide))
- return false;
- else if (((dockableAreas & DockAreas.DockBottom) == 0) &&
- (dockState == DockState.DockBottom || dockState == DockState.DockBottomAutoHide))
- return false;
- else
- return true;
- }
-
- public static bool IsDockWindowState(DockState state)
- {
- if (state == DockState.DockTop || state == DockState.DockBottom || state == DockState.DockLeft ||
- state == DockState.DockRight || state == DockState.Document)
- return true;
- else
- return false;
- }
-
- public static DockState ToggleAutoHideState(DockState state)
- {
- if (state == DockState.DockLeft)
- return DockState.DockLeftAutoHide;
- else if (state == DockState.DockRight)
- return DockState.DockRightAutoHide;
- else if (state == DockState.DockTop)
- return DockState.DockTopAutoHide;
- else if (state == DockState.DockBottom)
- return DockState.DockBottomAutoHide;
- else if (state == DockState.DockLeftAutoHide)
- return DockState.DockLeft;
- else if (state == DockState.DockRightAutoHide)
- return DockState.DockRight;
- else if (state == DockState.DockTopAutoHide)
- return DockState.DockTop;
- else if (state == DockState.DockBottomAutoHide)
- return DockState.DockBottom;
- else
- return state;
- }
-
- public static DockPane PaneAtPoint(Point pt, DockPanel dockPanel)
- {
- for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent)
- {
- IDockContent content = control as IDockContent;
- if (content != null && content.DockHandler.DockPanel == dockPanel)
- return content.DockHandler.Pane;
-
- DockPane pane = control as DockPane;
- if (pane != null && pane.DockPanel == dockPanel)
- return pane;
- }
-
- return null;
- }
-
- public static FloatWindow FloatWindowAtPoint(Point pt, DockPanel dockPanel)
- {
- for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent)
- {
- FloatWindow floatWindow = control as FloatWindow;
- if (floatWindow != null && floatWindow.DockPanel == dockPanel)
- return floatWindow;
- }
-
- return null;
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Helpers/DrawHelper.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Helpers/DrawHelper.cs
deleted file mode 100644
index cf8ab98a8e..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Helpers/DrawHelper.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-using System;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Drawing.Imaging;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal static class DrawHelper
- {
- public static Point RtlTransform(Control control, Point point)
- {
- if (control.RightToLeft != RightToLeft.Yes)
- return point;
- else
- return new Point(control.Right - point.X, point.Y);
- }
-
- public static Rectangle RtlTransform(Control control, Rectangle rectangle)
- {
- if (control.RightToLeft != RightToLeft.Yes)
- return rectangle;
- else
- return new Rectangle(control.ClientRectangle.Right - rectangle.Right, rectangle.Y, rectangle.Width, rectangle.Height);
- }
-
- public static GraphicsPath GetRoundedCornerTab(GraphicsPath graphicsPath, Rectangle rect, bool upCorner)
- {
- if (graphicsPath == null)
- graphicsPath = new GraphicsPath();
- else
- graphicsPath.Reset();
-
- int curveSize = 6;
- if (upCorner)
- {
- graphicsPath.AddLine(rect.Left, rect.Bottom, rect.Left, rect.Top + curveSize / 2);
- graphicsPath.AddArc(new Rectangle(rect.Left, rect.Top, curveSize, curveSize), 180, 90);
- graphicsPath.AddLine(rect.Left + curveSize / 2, rect.Top, rect.Right - curveSize / 2, rect.Top);
- graphicsPath.AddArc(new Rectangle(rect.Right - curveSize, rect.Top, curveSize, curveSize), -90, 90);
- graphicsPath.AddLine(rect.Right, rect.Top + curveSize / 2, rect.Right, rect.Bottom);
- }
- else
- {
- graphicsPath.AddLine(rect.Right, rect.Top, rect.Right, rect.Bottom - curveSize / 2);
- graphicsPath.AddArc(new Rectangle(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize), 0, 90);
- graphicsPath.AddLine(rect.Right - curveSize / 2, rect.Bottom, rect.Left + curveSize / 2, rect.Bottom);
- graphicsPath.AddArc(new Rectangle(rect.Left, rect.Bottom - curveSize, curveSize, curveSize), 90, 90);
- graphicsPath.AddLine(rect.Left, rect.Bottom - curveSize / 2, rect.Left, rect.Top);
- }
-
- return graphicsPath;
- }
-
- public static GraphicsPath CalculateGraphicsPathFromBitmap(Bitmap bitmap)
- {
- return CalculateGraphicsPathFromBitmap(bitmap, Color.Empty);
- }
-
- // From http://edu.cnzz.cn/show_3281.html
- public static GraphicsPath CalculateGraphicsPathFromBitmap(Bitmap bitmap, Color colorTransparent)
- {
- GraphicsPath graphicsPath = new GraphicsPath();
- if (colorTransparent == Color.Empty)
- colorTransparent = bitmap.GetPixel(0, 0);
-
- for(int row = 0; row < bitmap.Height; row ++)
- {
- int colOpaquePixel = 0;
- for(int col = 0; col < bitmap.Width; col ++)
- {
- if(bitmap.GetPixel(col, row) != colorTransparent)
- {
- colOpaquePixel = col;
- int colNext = col;
- for(colNext = colOpaquePixel; colNext < bitmap.Width; colNext ++)
- if(bitmap.GetPixel(colNext, row) == colorTransparent)
- break;
-
- graphicsPath.AddRectangle(new Rectangle(colOpaquePixel, row, colNext - colOpaquePixel, 1));
- col = colNext;
- }
- }
- }
- return graphicsPath;
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Helpers/ResourceHelper.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Helpers/ResourceHelper.cs
deleted file mode 100644
index 30f3594423..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Helpers/ResourceHelper.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Drawing;
-using System.Reflection;
-using System.Resources;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal static class ResourceHelper
- {
- private static ResourceManager _resourceManager = null;
-
- private static ResourceManager ResourceManager
- {
- get
- {
- if (_resourceManager == null)
- _resourceManager = new ResourceManager("WeifenLuo.WinFormsUI.Docking.Strings", typeof(ResourceHelper).Assembly);
- return _resourceManager;
- }
-
- }
-
- public static string GetString(string name)
- {
- return ResourceManager.GetString(name);
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Helpers/Win32Helper.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Helpers/Win32Helper.cs
deleted file mode 100644
index 473d7c5e61..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Helpers/Win32Helper.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal static class Win32Helper
- {
- public static Control ControlAtPoint(Point pt)
- {
- return Control.FromChildHandle(NativeMethods.WindowFromPoint(pt));
- }
-
- public static uint MakeLong(int low, int high)
- {
- return (uint)((high << 16) + low);
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/InertButtonBase.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/InertButtonBase.cs
deleted file mode 100644
index 92d5731d71..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/InertButtonBase.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Windows.Forms;
-using System.Drawing;
-using System.Drawing.Imaging;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal abstract class InertButtonBase : Control
- {
- protected InertButtonBase()
- {
- SetStyle(ControlStyles.SupportsTransparentBackColor, true);
- BackColor = Color.Transparent;
- }
-
- public abstract Bitmap Image
- {
- get;
- }
-
- private bool m_isMouseOver = false;
- protected bool IsMouseOver
- {
- get { return m_isMouseOver; }
- private set
- {
- if (m_isMouseOver == value)
- return;
-
- m_isMouseOver = value;
- Invalidate();
- }
- }
-
- protected override Size DefaultSize
- {
- get { return Resources.DockPane_Close.Size; }
- }
-
- protected override void OnMouseMove(MouseEventArgs e)
- {
- base.OnMouseMove(e);
- bool over = ClientRectangle.Contains(e.X, e.Y);
- if (IsMouseOver != over)
- IsMouseOver = over;
- }
-
- protected override void OnMouseEnter(EventArgs e)
- {
- base.OnMouseEnter(e);
- if (!IsMouseOver)
- IsMouseOver = true;
- }
-
- protected override void OnMouseLeave(EventArgs e)
- {
- base.OnMouseLeave(e);
- if (IsMouseOver)
- IsMouseOver = false;
- }
-
- protected override void OnPaint(PaintEventArgs e)
- {
- if (IsMouseOver && Enabled)
- {
- using (Pen pen = new Pen(ForeColor))
- {
- e.Graphics.DrawRectangle(pen, Rectangle.Inflate(ClientRectangle, -1, -1));
- }
- }
-
- using (ImageAttributes imageAttributes = new ImageAttributes())
- {
- ColorMap[] colorMap = new ColorMap[2];
- colorMap[0] = new ColorMap();
- colorMap[0].OldColor = Color.FromArgb(0, 0, 0);
- colorMap[0].NewColor = ForeColor;
- colorMap[1] = new ColorMap();
- colorMap[1].OldColor = Image.GetPixel(0, 0);
- colorMap[1].NewColor = Color.Transparent;
-
- imageAttributes.SetRemapTable(colorMap);
-
- e.Graphics.DrawImage(
- Image,
- new Rectangle(0, 0, Image.Width, Image.Height),
- 0, 0,
- Image.Width,
- Image.Height,
- GraphicsUnit.Pixel,
- imageAttributes);
- }
-
- base.OnPaint(e);
- }
-
- public void RefreshChanges()
- {
- if (IsDisposed)
- return;
-
- bool mouseOver = ClientRectangle.Contains(PointToClient(Control.MousePosition));
- if (mouseOver != IsMouseOver)
- IsMouseOver = mouseOver;
-
- OnRefreshChanges();
- }
-
- protected virtual void OnRefreshChanges()
- {
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Interfaces.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Interfaces.cs
deleted file mode 100644
index 32f3914b34..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Interfaces.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public interface IDockContent
- {
- DockContentHandler DockHandler { get; }
- bool IsDisposed { get; }
- }
-
- public interface INestedPanesContainer
- {
- DockState DockState { get; }
- Rectangle DisplayingRectangle { get; }
- NestedPaneCollection NestedPanes { get; }
- VisibleNestedPaneCollection VisibleNestedPanes { get; }
- bool IsFloat { get; }
- }
-
- internal interface IDragSource
- {
- Control DragControl { get; }
- }
-
- internal interface IDockDragSource : IDragSource
- {
- Rectangle BeginDrag(Point ptMouse);
- bool IsDockStateValid(DockState dockState);
- bool CanDockTo(DockPane pane);
- void FloatAt(Rectangle floatWindowBounds);
- void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex);
- void DockTo(DockPanel panel, DockStyle dockStyle);
- }
-
- internal interface ISplitterDragSource : IDragSource
- {
- void BeginDrag(Rectangle rectSplitter);
- void EndDrag();
- bool IsVertical { get; }
- Rectangle DragLimitBounds { get; }
- void MoveSplitter(int offset);
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Localization.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Localization.cs
deleted file mode 100644
index c6f71afa53..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Localization.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System;
-using System.ComponentModel;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- [AttributeUsage(AttributeTargets.All)]
- internal sealed class LocalizedDescriptionAttribute : DescriptionAttribute
- {
- private bool m_initialized = false;
-
- public LocalizedDescriptionAttribute(string key) : base(key)
- {
- }
-
- public override string Description
- {
- get
- {
- if (!m_initialized)
- {
- string key = base.Description;
- DescriptionValue = ResourceHelper.GetString(key);
- if (DescriptionValue == null)
- DescriptionValue = String.Empty;
-
- m_initialized = true;
- }
-
- return DescriptionValue;
- }
- }
- }
-
- [AttributeUsage(AttributeTargets.All)]
- internal sealed class LocalizedCategoryAttribute : CategoryAttribute
- {
- public LocalizedCategoryAttribute(string key) : base(key)
- {
- }
-
- protected override string GetLocalizedString(string key)
- {
- return ResourceHelper.GetString(key);
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Measures.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Measures.cs
deleted file mode 100644
index d1c591f394..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Measures.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal static class Measures
- {
- public const int SplitterSize = 4;
- }
-
- internal static class MeasurePane
- {
- public const int MinSize = 24;
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/NestedDockingStatus.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/NestedDockingStatus.cs
deleted file mode 100644
index 8d0de44ae5..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/NestedDockingStatus.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-using System;
-using System.Drawing;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public sealed class NestedDockingStatus
- {
- internal NestedDockingStatus(DockPane pane)
- {
- m_dockPane = pane;
- }
-
- private DockPane m_dockPane = null;
- public DockPane DockPane
- {
- get { return m_dockPane; }
- }
-
- private NestedPaneCollection m_nestedPanes = null;
- public NestedPaneCollection NestedPanes
- {
- get { return m_nestedPanes; }
- }
-
- private DockPane m_previousPane = null;
- public DockPane PreviousPane
- {
- get { return m_previousPane; }
- }
-
- private DockAlignment m_alignment = DockAlignment.Left;
- public DockAlignment Alignment
- {
- get { return m_alignment; }
- }
-
- private double m_proportion = 0.5;
- public double Proportion
- {
- get { return m_proportion; }
- }
-
- private bool m_isDisplaying = false;
- public bool IsDisplaying
- {
- get { return m_isDisplaying; }
- }
-
- private DockPane m_displayingPreviousPane = null;
- public DockPane DisplayingPreviousPane
- {
- get { return m_displayingPreviousPane; }
- }
-
- private DockAlignment m_displayingAlignment = DockAlignment.Left;
- public DockAlignment DisplayingAlignment
- {
- get { return m_displayingAlignment; }
- }
-
- private double m_displayingProportion = 0.5;
- public double DisplayingProportion
- {
- get { return m_displayingProportion; }
- }
-
- private Rectangle m_logicalBounds = Rectangle.Empty;
- public Rectangle LogicalBounds
- {
- get { return m_logicalBounds; }
- }
-
- private Rectangle m_paneBounds = Rectangle.Empty;
- public Rectangle PaneBounds
- {
- get { return m_paneBounds; }
- }
-
- private Rectangle m_splitterBounds = Rectangle.Empty;
- public Rectangle SplitterBounds
- {
- get { return m_splitterBounds; }
- }
-
- internal void SetStatus(NestedPaneCollection nestedPanes, DockPane previousPane, DockAlignment alignment, double proportion)
- {
- m_nestedPanes = nestedPanes;
- m_previousPane = previousPane;
- m_alignment = alignment;
- m_proportion = proportion;
- }
-
- internal void SetDisplayingStatus(bool isDisplaying, DockPane displayingPreviousPane, DockAlignment displayingAlignment, double displayingProportion)
- {
- m_isDisplaying = isDisplaying;
- m_displayingPreviousPane = displayingPreviousPane;
- m_displayingAlignment = displayingAlignment;
- m_displayingProportion = displayingProportion;
- }
-
- internal void SetDisplayingBounds(Rectangle logicalBounds, Rectangle paneBounds, Rectangle splitterBounds)
- {
- m_logicalBounds = logicalBounds;
- m_paneBounds = paneBounds;
- m_splitterBounds = splitterBounds;
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/NestedPaneCollection.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/NestedPaneCollection.cs
deleted file mode 100644
index 0d0ae708cc..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/NestedPaneCollection.cs
+++ /dev/null
@@ -1,116 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Drawing;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public sealed class NestedPaneCollection : ReadOnlyCollection
- {
- private INestedPanesContainer m_container;
- private VisibleNestedPaneCollection m_visibleNestedPanes;
-
- internal NestedPaneCollection(INestedPanesContainer container)
- : base(new List())
- {
- m_container = container;
- m_visibleNestedPanes = new VisibleNestedPaneCollection(this);
- }
-
- public INestedPanesContainer Container
- {
- get { return m_container; }
- }
-
- public VisibleNestedPaneCollection VisibleNestedPanes
- {
- get { return m_visibleNestedPanes; }
- }
-
- public DockState DockState
- {
- get { return Container.DockState; }
- }
-
- public bool IsFloat
- {
- get { return DockState == DockState.Float; }
- }
-
- internal void Add(DockPane pane)
- {
- if (pane == null)
- return;
-
- NestedPaneCollection oldNestedPanes = (pane.NestedPanesContainer == null) ? null : pane.NestedPanesContainer.NestedPanes;
- if (oldNestedPanes != null)
- oldNestedPanes.InternalRemove(pane);
- Items.Add(pane);
- if (oldNestedPanes != null)
- oldNestedPanes.CheckFloatWindowDispose();
- }
-
- private void CheckFloatWindowDispose()
- {
- if (Count == 0 && Container.DockState == DockState.Float)
- {
- FloatWindow floatWindow = (FloatWindow)Container;
- if (!floatWindow.Disposing && !floatWindow.IsDisposed)
- NativeMethods.PostMessage(((FloatWindow)Container).Handle, FloatWindow.WM_CHECKDISPOSE, 0, 0);
- }
- }
-
- internal void Remove(DockPane pane)
- {
- InternalRemove(pane);
- CheckFloatWindowDispose();
- }
-
- private void InternalRemove(DockPane pane)
- {
- if (!Contains(pane))
- return;
-
- NestedDockingStatus statusPane = pane.NestedDockingStatus;
- DockPane lastNestedPane = null;
- for (int i=Count - 1; i> IndexOf(pane); i--)
- {
- if (this[i].NestedDockingStatus.PreviousPane == pane)
- {
- lastNestedPane = this[i];
- break;
- }
- }
-
- if (lastNestedPane != null)
- {
- int indexLastNestedPane = IndexOf(lastNestedPane);
- Items.Remove(lastNestedPane);
- Items[IndexOf(pane)] = lastNestedPane;
- NestedDockingStatus lastNestedDock = lastNestedPane.NestedDockingStatus;
- lastNestedDock.SetStatus(this, statusPane.PreviousPane, statusPane.Alignment, statusPane.Proportion);
- for (int i=indexLastNestedPane - 1; i>IndexOf(lastNestedPane); i--)
- {
- NestedDockingStatus status = this[i].NestedDockingStatus;
- if (status.PreviousPane == pane)
- status.SetStatus(this, lastNestedPane, status.Alignment, status.Proportion);
- }
- }
- else
- Items.Remove(pane);
-
- statusPane.SetStatus(null, null, DockAlignment.Left, 0.5);
- statusPane.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5);
- statusPane.SetDisplayingBounds(Rectangle.Empty, Rectangle.Empty, Rectangle.Empty);
- }
-
- public DockPane GetDefaultPreviousPane(DockPane pane)
- {
- for (int i=Count-1; i>=0; i--)
- if (this[i] != pane)
- return this[i];
-
- return null;
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources.Designer.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources.Designer.cs
deleted file mode 100644
index 076e5ddf6d..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources.Designer.cs
+++ /dev/null
@@ -1,224 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.42
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace WeifenLuo.WinFormsUI.Docking {
- 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("WeifenLuo.WinFormsUI.Docking.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;
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PaneDiamond {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Bottom {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Bottom", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Fill {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Fill", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_HotSpot {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_HotSpot", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_HotSpotIndex {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_HotSpotIndex", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Left {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Left", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Right {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Right", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PaneDiamond_Top {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PaneDiamond_Top", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PanelBottom {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PanelBottom", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PanelBottom_Active {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PanelBottom_Active", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PanelFill {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PanelFill", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PanelFill_Active {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PanelFill_Active", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PanelLeft {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PanelLeft", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PanelLeft_Active {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PanelLeft_Active", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PanelRight {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PanelRight", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PanelRight_Active {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PanelRight_Active", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PanelTop {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PanelTop", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockIndicator_PanelTop_Active {
- get {
- object obj = ResourceManager.GetObject("DockIndicator_PanelTop_Active", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPane_AutoHide {
- get {
- object obj = ResourceManager.GetObject("DockPane_AutoHide", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPane_Close {
- get {
- object obj = ResourceManager.GetObject("DockPane_Close", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPane_Dock {
- get {
- object obj = ResourceManager.GetObject("DockPane_Dock", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPane_Option {
- get {
- object obj = ResourceManager.GetObject("DockPane_Option", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
-
- internal static System.Drawing.Bitmap DockPane_OptionOverflow {
- get {
- object obj = ResourceManager.GetObject("DockPane_OptionOverflow", resourceCulture);
- return ((System.Drawing.Bitmap)(obj));
- }
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources.resx b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources.resx
deleted file mode 100644
index 0f8b146299..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources.resx
+++ /dev/null
@@ -1,190 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
-
- Resources\DockIndicator_PaneDiamond.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- 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_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_Left.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockIndicator_PaneDiamond_Right.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockIndicator_PaneDiamond_Top.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockIndicator_PanelBottom.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockIndicator_PanelBottom_Active.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockIndicator_PanelFill.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockIndicator_PanelFill_Active.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockIndicator_PanelLeft.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockIndicator_PanelLeft_Active.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockIndicator_PanelRight.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockIndicator_PanelRight_Active.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockIndicator_PanelTop.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockIndicator_PanelTop_Active.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockPane_AutoHide.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockPane_Close.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockPane_Dock.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- Resources\DockPane_Option.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
- 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/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond.bmp
deleted file mode 100644
index 70e70e288d..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Bottom.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Bottom.bmp
deleted file mode 100644
index d95ec69720..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Bottom.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Hotspot.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Hotspot.bmp
deleted file mode 100644
index e801d382d7..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Hotspot.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_HotspotIndex.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_HotspotIndex.bmp
deleted file mode 100644
index e5ef472c56..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_HotspotIndex.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Left.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Left.bmp
deleted file mode 100644
index 1fbda61c08..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Left.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Right.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Right.bmp
deleted file mode 100644
index 1de97a0986..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Right.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Top.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Top.bmp
deleted file mode 100644
index 95122a0f31..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PaneDiamond_Top.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelBottom.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelBottom.bmp
deleted file mode 100644
index ad851ea183..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelBottom.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelBottom_Active.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelBottom_Active.bmp
deleted file mode 100644
index 212fb0d366..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelBottom_Active.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelFill.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelFill.bmp
deleted file mode 100644
index 21a1b274d7..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelFill.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelFill_Active.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelFill_Active.bmp
deleted file mode 100644
index d58b00f9df..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelFill_Active.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelLeft.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelLeft.bmp
deleted file mode 100644
index 551fd88624..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelLeft.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelLeft_Active.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelLeft_Active.bmp
deleted file mode 100644
index 5182318ed3..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelLeft_Active.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelRight.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelRight.bmp
deleted file mode 100644
index 003cbb02a6..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelRight.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelRight_Active.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelRight_Active.bmp
deleted file mode 100644
index dad423551d..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelRight_Active.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelTop.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelTop.bmp
deleted file mode 100644
index f6293fd2bc..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelTop.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelTop_Active.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelTop_Active.bmp
deleted file mode 100644
index 563549eba1..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockIndicator_PanelTop_Active.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_AutoHide.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_AutoHide.bmp
deleted file mode 100644
index 2f395fc010..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_AutoHide.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_Close.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_Close.bmp
deleted file mode 100644
index a7748a672e..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_Close.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_Dock.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_Dock.bmp
deleted file mode 100644
index 6a9d145e09..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_Dock.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_Option.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_Option.bmp
deleted file mode 100644
index 0d9927a7ce..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_Option.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_OptionOverflow.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_OptionOverflow.bmp
deleted file mode 100644
index 02e4bf2905..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/DockPane_OptionOverflow.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/Dockindicator_PaneDiamond_Fill.bmp b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/Dockindicator_PaneDiamond_Fill.bmp
deleted file mode 100644
index cbe0a156ab..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/Dockindicator_PaneDiamond_Fill.bmp and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/Thumbs.db b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/Thumbs.db
deleted file mode 100644
index 3bf72fa2ef..0000000000
Binary files a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Resources/Thumbs.db and /dev/null differ
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/SplitterBase.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/SplitterBase.cs
deleted file mode 100644
index 0364d8d03d..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/SplitterBase.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using System;
-using System.Collections;
-using System.ComponentModel;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal class SplitterBase : Control
- {
- public SplitterBase()
- {
- SetStyle(ControlStyles.Selectable, false);
- }
-
- public override DockStyle Dock
- {
- get { return base.Dock; }
- set
- {
- SuspendLayout();
- base.Dock = value;
-
- if (Dock == DockStyle.Left || Dock == DockStyle.Right)
- Width = SplitterSize;
- else if (Dock == DockStyle.Top || Dock == DockStyle.Bottom)
- Height = SplitterSize;
- else
- Bounds = Rectangle.Empty;
-
- if (Dock == DockStyle.Left || Dock == DockStyle.Right)
- Cursor = Cursors.VSplit;
- else if (Dock == DockStyle.Top || Dock == DockStyle.Bottom)
- Cursor = Cursors.HSplit;
- else
- Cursor = Cursors.Default;
-
- ResumeLayout();
- }
- }
-
- protected virtual int SplitterSize
- {
- get { return 0; }
- }
-
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
-
- if (e.Button != MouseButtons.Left)
- return;
-
- StartDrag();
- }
-
- protected virtual void StartDrag()
- {
- }
-
- protected override void WndProc(ref Message m)
- {
- // eat the WM_MOUSEACTIVATE message
- if (m.Msg == (int)Win32.Msgs.WM_MOUSEACTIVATE)
- return;
-
- base.WndProc(ref m);
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Strings.Designer.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Strings.Designer.cs
deleted file mode 100644
index 8ca97d176d..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Strings.Designer.cs
+++ /dev/null
@@ -1,747 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.42
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-namespace WeifenLuo.WinFormsUI.Docking {
- 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 Strings {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Strings() {
- }
-
- ///
- /// 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("WeifenLuo.WinFormsUI.Docking.Strings", typeof(Strings).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;
- }
- }
-
- ///
- /// Looks up a localized string similar to Docking.
- ///
- internal static string Category_Docking {
- get {
- return ResourceManager.GetString("Category_Docking", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Docking Notification.
- ///
- internal static string Category_DockingNotification {
- get {
- return ResourceManager.GetString("Category_DockingNotification", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Property Changed.
- ///
- internal static string Category_PropertyChanged {
- get {
- return ResourceManager.GetString("Category_PropertyChanged", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to (Float).
- ///
- internal static string DockAreaEditor_FloatCheckBoxText {
- get {
- return ResourceManager.GetString("DockAreaEditor_FloatCheckBoxText", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Determines if end user drag and drop docking is allowed..
- ///
- internal static string DockContent_AllowEndUserDocking_Description {
- get {
- return ResourceManager.GetString("DockContent_AllowEndUserDocking_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The size to display the content in auto hide mode. Value < 1 to specify the size in portion; value >= 1 to specify the size in pixel..
- ///
- internal static string DockContent_AutoHidePortion_Description {
- get {
- return ResourceManager.GetString("DockContent_AutoHidePortion_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Enable/Disable the close button of the content..
- ///
- internal static string DockContent_CloseButton_Description {
- get {
- return ResourceManager.GetString("DockContent_CloseButton_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The form must be of type IDockContent..
- ///
- internal static string DockContent_Constructor_InvalidForm {
- get {
- return ResourceManager.GetString("DockContent_Constructor_InvalidForm", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Gets or sets a value indicating in which area of the DockPanel the content allowed to show..
- ///
- internal static string DockContent_DockAreas_Description {
- get {
- return ResourceManager.GetString("DockContent_DockAreas_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Occurs when the value of DockState property changed..
- ///
- internal static string DockContent_DockStateChanged_Description {
- get {
- return ResourceManager.GetString("DockContent_DockStateChanged_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Indicates the content will be hidden instead of being closed..
- ///
- internal static string DockContent_HideOnClose_Description {
- get {
- return ResourceManager.GetString("DockContent_HideOnClose_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The desired docking state when first showing..
- ///
- internal static string DockContent_ShowHint_Description {
- get {
- return ResourceManager.GetString("DockContent_ShowHint_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Context menu displayed for the dock pane tab strip..
- ///
- internal static string DockContent_TabPageContextMenu_Description {
- get {
- return ResourceManager.GetString("DockContent_TabPageContextMenu_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The tab text displayed in the dock pane. If not set, the Text property will be used..
- ///
- internal static string DockContent_TabText_Description {
- get {
- return ResourceManager.GetString("DockContent_TabText_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The text displayed when mouse hovers over the tab..
- ///
- internal static string DockContent_ToolTipText_Description {
- get {
- return ResourceManager.GetString("DockContent_ToolTipText_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The provided value is out of range..
- ///
- internal static string DockContentHandler_AutoHidePortion_OutOfRange {
- get {
- return ResourceManager.GetString("DockContentHandler_AutoHidePortion_OutOfRange", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid Value: The value of DockAreas conflicts with current DockState..
- ///
- internal static string DockContentHandler_DockAreas_InvalidValue {
- get {
- return ResourceManager.GetString("DockContentHandler_DockAreas_InvalidValue", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The pane is invalid. Check the IsFloat and DockPanel properties of this dock pane..
- ///
- internal static string DockContentHandler_DockPane_InvalidValue {
- get {
- return ResourceManager.GetString("DockContentHandler_DockPane_InvalidValue", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The pane is invalid. Check the IsFloat and DockPanel properties of this dock pane..
- ///
- internal static string DockContentHandler_FloatPane_InvalidValue {
- get {
- return ResourceManager.GetString("DockContentHandler_FloatPane_InvalidValue", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid value, conflicts with DockableAreas property..
- ///
- internal static string DockContentHandler_IsFloat_InvalidValue {
- get {
- return ResourceManager.GetString("DockContentHandler_IsFloat_InvalidValue", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The dock state is invalid..
- ///
- internal static string DockContentHandler_SetDockState_InvalidState {
- get {
- return ResourceManager.GetString("DockContentHandler_SetDockState_InvalidState", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The dock panel is null..
- ///
- internal static string DockContentHandler_SetDockState_NullPanel {
- get {
- return ResourceManager.GetString("DockContentHandler_SetDockState_NullPanel", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid beforeContent, it must be contained by the pane..
- ///
- internal static string DockContentHandler_Show_InvalidBeforeContent {
- get {
- return ResourceManager.GetString("DockContentHandler_Show_InvalidBeforeContent", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid DockState: Content can not be showed as "Unknown" or "Hidden"..
- ///
- internal static string DockContentHandler_Show_InvalidDockState {
- get {
- return ResourceManager.GetString("DockContentHandler_Show_InvalidDockState", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The previous pane is invalid. It can not be null, and its docking state must not be auto-hide..
- ///
- internal static string DockContentHandler_Show_InvalidPrevPane {
- get {
- return ResourceManager.GetString("DockContentHandler_Show_InvalidPrevPane", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to DockPanel can not be null..
- ///
- internal static string DockContentHandler_Show_NullDockPanel {
- get {
- return ResourceManager.GetString("DockContentHandler_Show_NullDockPanel", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The Pane can not be null..
- ///
- internal static string DockContentHandler_Show_NullPane {
- get {
- return ResourceManager.GetString("DockContentHandler_Show_NullPane", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid value, check DockableAreas property..
- ///
- internal static string DockContentHandler_ShowHint_InvalidValue {
- get {
- return ResourceManager.GetString("DockContentHandler_ShowHint_InvalidValue", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Context menu displayed for the dock pane tab strip..
- ///
- internal static string DockHandler_TabPageContextMenuStrip_Description {
- get {
- return ResourceManager.GetString("DockHandler_TabPageContextMenuStrip_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Press SHIFT for docking to full side..
- ///
- internal static string DockIndicator_ToolTipText {
- get {
- return ResourceManager.GetString("DockIndicator_ToolTipText", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid Content: ActiveContent must be one of the visible contents, or null if there is no visible content..
- ///
- internal static string DockPane_ActiveContent_InvalidValue {
- get {
- return ResourceManager.GetString("DockPane_ActiveContent_InvalidValue", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid argument: Content can not be "null"..
- ///
- internal static string DockPane_Constructor_NullContent {
- get {
- return ResourceManager.GetString("DockPane_Constructor_NullContent", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid argument: The content's DockPanel can not be "null"..
- ///
- internal static string DockPane_Constructor_NullDockPanel {
- get {
- return ResourceManager.GetString("DockPane_Constructor_NullDockPanel", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The specified container conflicts with the IsFloat property..
- ///
- internal static string DockPane_DockTo_InvalidContainer {
- get {
- return ResourceManager.GetString("DockPane_DockTo_InvalidContainer", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The previous pane does not exist in the nested docking pane collection..
- ///
- internal static string DockPane_DockTo_NoPrevPane {
- get {
- return ResourceManager.GetString("DockPane_DockTo_NoPrevPane", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The container can not be null..
- ///
- internal static string DockPane_DockTo_NullContainer {
- get {
- return ResourceManager.GetString("DockPane_DockTo_NullContainer", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The previous pane can not be null when the nested docking pane collection is not empty..
- ///
- internal static string DockPane_DockTo_NullPrevPane {
- get {
- return ResourceManager.GetString("DockPane_DockTo_NullPrevPane", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The previous pane can not be itself..
- ///
- internal static string DockPane_DockTo_SelfPrevPane {
- get {
- return ResourceManager.GetString("DockPane_DockTo_SelfPrevPane", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to FloatWindow property can not be set to "null" when DockState is DockState.Float..
- ///
- internal static string DockPane_FloatWindow_InvalidValue {
- get {
- return ResourceManager.GetString("DockPane_FloatWindow_InvalidValue", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid Content: Content not within the collection..
- ///
- internal static string DockPane_SetContentIndex_InvalidContent {
- get {
- return ResourceManager.GetString("DockPane_SetContentIndex_InvalidContent", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid Index: The index is out of range..
- ///
- internal static string DockPane_SetContentIndex_InvalidIndex {
- get {
- return ResourceManager.GetString("DockPane_SetContentIndex_InvalidIndex", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The state for the dock pane is invalid..
- ///
- internal static string DockPane_SetDockState_InvalidState {
- get {
- return ResourceManager.GetString("DockPane_SetDockState_InvalidState", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Auto Hide.
- ///
- internal static string DockPaneCaption_ToolTipAutoHide {
- get {
- return ResourceManager.GetString("DockPaneCaption_ToolTipAutoHide", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Close.
- ///
- internal static string DockPaneCaption_ToolTipClose {
- get {
- return ResourceManager.GetString("DockPaneCaption_ToolTipClose", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Options.
- ///
- internal static string DockPaneCaption_ToolTipOptions {
- get {
- return ResourceManager.GetString("DockPaneCaption_ToolTipOptions", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid Content: The content must be auto-hide state and associates with this DockPanel..
- ///
- internal static string DockPanel_ActiveAutoHideContent_InvalidValue {
- get {
- return ResourceManager.GetString("DockPanel_ActiveAutoHideContent_InvalidValue", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Occurs when the value of ActiveContentProperty changed..
- ///
- internal static string DockPanel_ActiveContentChanged_Description {
- get {
- return ResourceManager.GetString("DockPanel_ActiveContentChanged_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Occurs when the value of ActiveDocument property changed..
- ///
- internal static string DockPanel_ActiveDocumentChanged_Description {
- get {
- return ResourceManager.GetString("DockPanel_ActiveDocumentChanged_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Occurs when the value of ActivePane property changed..
- ///
- internal static string DockPanel_ActivePaneChanged_Description {
- get {
- return ResourceManager.GetString("DockPanel_ActivePaneChanged_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Determines if the drag and drop docking is allowed..
- ///
- internal static string DockPanel_AllowEndUserDocking_Description {
- get {
- return ResourceManager.GetString("DockPanel_AllowEndUserDocking_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Determines if the drag and drop nested docking is allowed..
- ///
- internal static string DockPanel_AllowEndUserNestedDocking_Description {
- get {
- return ResourceManager.GetString("DockPanel_AllowEndUserNestedDocking_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Occurs when a content added to the DockPanel..
- ///
- internal static string DockPanel_ContentAdded_Description {
- get {
- return ResourceManager.GetString("DockPanel_ContentAdded_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Occurs when a content removed from the DockPanel..
- ///
- internal static string DockPanel_ContentRemoved_Description {
- get {
- return ResourceManager.GetString("DockPanel_ContentRemoved_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The default size of float window..
- ///
- internal static string DockPanel_DefaultFloatWindowSize_Description {
- get {
- return ResourceManager.GetString("DockPanel_DefaultFloatWindowSize_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Provides Visual Studio .Net style docking..
- ///
- internal static string DockPanel_Description {
- get {
- return ResourceManager.GetString("DockPanel_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Size of the bottom docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels..
- ///
- internal static string DockPanel_DockBottomPortion_Description {
- get {
- return ResourceManager.GetString("DockPanel_DockBottomPortion_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Size of the left docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels..
- ///
- internal static string DockPanel_DockLeftPortion_Description {
- get {
- return ResourceManager.GetString("DockPanel_DockLeftPortion_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Size of the right docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels..
- ///
- internal static string DockPanel_DockRightPortion_Description {
- get {
- return ResourceManager.GetString("DockPanel_DockRightPortion_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Size of the top docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels..
- ///
- internal static string DockPanel_DockTopPortion_Description {
- get {
- return ResourceManager.GetString("DockPanel_DockTopPortion_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The style of the document window..
- ///
- internal static string DockPanel_DocumentStyle_Description {
- get {
- return ResourceManager.GetString("DockPanel_DocumentStyle_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The DockPanel has already been initialized..
- ///
- internal static string DockPanel_LoadFromXml_AlreadyInitialized {
- get {
- return ResourceManager.GetString("DockPanel_LoadFromXml_AlreadyInitialized", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The configuration file's version is invalid..
- ///
- internal static string DockPanel_LoadFromXml_InvalidFormatVersion {
- get {
- return ResourceManager.GetString("DockPanel_LoadFromXml_InvalidFormatVersion", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to The XML file format is invalid..
- ///
- internal static string DockPanel_LoadFromXml_InvalidXmlFormat {
- get {
- return ResourceManager.GetString("DockPanel_LoadFromXml_InvalidXmlFormat", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid parent form. When using DockingMdi or SystemMdi document style, the DockPanel control must be the child control of the main MDI container form..
- ///
- internal static string DockPanel_ParentForm_Invalid {
- get {
- return ResourceManager.GetString("DockPanel_ParentForm_Invalid", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to DockPanel configuration file. Author: Weifen Luo, all rights reserved..
- ///
- internal static string DockPanel_Persistor_XmlFileComment1 {
- get {
- return ResourceManager.GetString("DockPanel_Persistor_XmlFileComment1", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!!.
- ///
- internal static string DockPanel_Persistor_XmlFileComment2 {
- get {
- return ResourceManager.GetString("DockPanel_Persistor_XmlFileComment2", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Indicates whether the control layout is right-to-left when the RightToLeft property is set to Yes..
- ///
- internal static string DockPanel_RightToLeftLayout_Description {
- get {
- return ResourceManager.GetString("DockPanel_RightToLeftLayout_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid Index: The index is out of range..
- ///
- internal static string DockPanel_SetPaneIndex_InvalidIndex {
- get {
- return ResourceManager.GetString("DockPanel_SetPaneIndex_InvalidIndex", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid Pane: DockPane not within the collection..
- ///
- internal static string DockPanel_SetPaneIndex_InvalidPane {
- get {
- return ResourceManager.GetString("DockPanel_SetPaneIndex_InvalidPane", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Determines if the document icon will be displayed in the tab strip..
- ///
- internal static string DockPanel_ShowDocumentIcon_Description {
- get {
- return ResourceManager.GetString("DockPanel_ShowDocumentIcon_Description", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Close.
- ///
- internal static string DockPaneStrip_ToolTipClose {
- get {
- return ResourceManager.GetString("DockPaneStrip_ToolTipClose", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Window List.
- ///
- internal static string DockPaneStrip_ToolTipWindowList {
- get {
- return ResourceManager.GetString("DockPaneStrip_ToolTipWindowList", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid argument: DockPanel can not be "null"..
- ///
- internal static string FloatWindow_Constructor_NullDockPanel {
- get {
- return ResourceManager.GetString("FloatWindow_Constructor_NullDockPanel", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid Index: The index is out of range..
- ///
- internal static string FloatWindow_SetPaneIndex_InvalidIndex {
- get {
- return ResourceManager.GetString("FloatWindow_SetPaneIndex_InvalidIndex", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid Pane: DockPane not within the collection..
- ///
- internal static string FloatWindow_SetPaneIndex_InvalidPane {
- get {
- return ResourceManager.GetString("FloatWindow_SetPaneIndex_InvalidPane", resourceCulture);
- }
- }
-
- ///
- /// Looks up a localized string similar to Invalid DockPanel..
- ///
- internal static string IDockDragSource_DockTo_InvalidPanel {
- get {
- return ResourceManager.GetString("IDockDragSource_DockTo_InvalidPanel", resourceCulture);
- }
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Strings.resx b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Strings.resx
deleted file mode 100644
index 96621ff8a0..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/Strings.resx
+++ /dev/null
@@ -1,348 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- Docking
-
-
- Docking Notification
-
-
- Property Changed
-
-
- (Float)
-
-
- Determines if end user drag and drop docking is allowed.
-
-
- The size to display the content in auto hide mode. Value < 1 to specify the size in portion; value >= 1 to specify the size in pixel.
-
-
- Enable/Disable the close button of the content.
-
-
- The form must be of type IDockContent.
-
-
- Gets or sets a value indicating in which area of the DockPanel the content allowed to show.
-
-
- Occurs when the value of DockState property changed.
-
-
- Indicates the content will be hidden instead of being closed.
-
-
- The desired docking state when first showing.
-
-
- Context menu displayed for the dock pane tab strip.
-
-
- The tab text displayed in the dock pane. If not set, the Text property will be used.
-
-
- The text displayed when mouse hovers over the tab.
-
-
- The provided value is out of range.
-
-
- Invalid Value: The value of DockAreas conflicts with current DockState.
-
-
- The pane is invalid. Check the IsFloat and DockPanel properties of this dock pane.
-
-
- The pane is invalid. Check the IsFloat and DockPanel properties of this dock pane.
-
-
- Invalid value, conflicts with DockableAreas property.
-
-
- The dock state is invalid.
-
-
- The dock panel is null.
-
-
- Invalid beforeContent, it must be contained by the pane.
-
-
- Invalid DockState: Content can not be showed as "Unknown" or "Hidden".
-
-
- The previous pane is invalid. It can not be null, and its docking state must not be auto-hide.
-
-
- DockPanel can not be null.
-
-
- The Pane can not be null.
-
-
- Invalid value, check DockableAreas property.
-
-
- Context menu displayed for the dock pane tab strip.
-
-
- Press SHIFT for docking to full side.
-
-
- Invalid Content: ActiveContent must be one of the visible contents, or null if there is no visible content.
-
-
- Invalid argument: Content can not be "null".
-
-
- Invalid argument: The content's DockPanel can not be "null".
-
-
- The specified container conflicts with the IsFloat property.
-
-
- The previous pane does not exist in the nested docking pane collection.
-
-
- The container can not be null.
-
-
- The previous pane can not be null when the nested docking pane collection is not empty.
-
-
- The previous pane can not be itself.
-
-
- FloatWindow property can not be set to "null" when DockState is DockState.Float.
-
-
- Invalid Content: Content not within the collection.
-
-
- Invalid Index: The index is out of range.
-
-
- The state for the dock pane is invalid.
-
-
- Auto Hide
-
-
- Close
-
-
- Options
-
-
- Invalid Content: The content must be auto-hide state and associates with this DockPanel.
-
-
- Occurs when the value of ActiveContentProperty changed.
-
-
- Occurs when the value of ActiveDocument property changed.
-
-
- Occurs when the value of ActivePane property changed.
-
-
- Determines if the drag and drop docking is allowed.
-
-
- Determines if the drag and drop nested docking is allowed.
-
-
- Occurs when a content added to the DockPanel.
-
-
- Occurs when a content removed from the DockPanel.
-
-
- The default size of float window.
-
-
- Provides Visual Studio .Net style docking.
-
-
- Size of the bottom docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels.
-
-
- Size of the left docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels.
-
-
- Size of the right docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels.
-
-
- Size of the top docking window. Value < 1 to specify the size in portion; value > 1 to specify the size in pixels.
-
-
- The style of the document window.
-
-
- The DockPanel has already been initialized.
-
-
- The configuration file's version is invalid.
-
-
- The XML file format is invalid.
-
-
- Invalid parent form. When using DockingMdi or SystemMdi document style, the DockPanel control must be the child control of the main MDI container form.
-
-
- DockPanel configuration file. Author: Weifen Luo, all rights reserved.
-
-
- !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!!
-
-
- Indicates whether the control layout is right-to-left when the RightToLeft property is set to Yes.
-
-
- Invalid Index: The index is out of range.
-
-
- Invalid Pane: DockPane not within the collection.
-
-
- Determines if the document icon will be displayed in the tab strip.
-
-
- Close
-
-
- Window List
-
-
- Invalid argument: DockPanel can not be "null".
-
-
- Invalid Index: The index is out of range.
-
-
- Invalid Pane: DockPane not within the collection.
-
-
- Invalid DockPanel.
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005AutoHideStrip.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005AutoHideStrip.cs
deleted file mode 100644
index 90c0209257..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005AutoHideStrip.cs
+++ /dev/null
@@ -1,497 +0,0 @@
-using System;
-using System.Drawing;
-using System.Windows.Forms;
-using System.Drawing.Drawing2D;
-using System.ComponentModel;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal class VS2005AutoHideStrip : AutoHideStripBase
- {
- private class TabVS2005 : Tab
- {
- internal TabVS2005(IDockContent content)
- : base(content)
- {
- }
-
- private int m_tabX = 0;
- public int TabX
- {
- get { return m_tabX; }
- set { m_tabX = value; }
- }
-
- private int m_tabWidth = 0;
- public int TabWidth
- {
- get { return m_tabWidth; }
- set { m_tabWidth = value; }
- }
-
- }
-
- private const int _ImageHeight = 16;
- private const int _ImageWidth = 16;
- private const int _ImageGapTop = 2;
- private const int _ImageGapLeft = 4;
- private const int _ImageGapRight = 2;
- private const int _ImageGapBottom = 2;
- private const int _TextGapLeft = 0;
- private const int _TextGapRight = 0;
- private const int _TabGapTop = 3;
- private const int _TabGapLeft = 4;
- private const int _TabGapBetween = 10;
-
- #region Customizable Properties
- private static Font TextFont
- {
- get { return SystemInformation.MenuFont; }
- }
-
- private static StringFormat _stringFormatTabHorizontal;
- private StringFormat StringFormatTabHorizontal
- {
- get
- {
- if (_stringFormatTabHorizontal == null)
- {
- _stringFormatTabHorizontal = new StringFormat();
- _stringFormatTabHorizontal.Alignment = StringAlignment.Near;
- _stringFormatTabHorizontal.LineAlignment = StringAlignment.Center;
- _stringFormatTabHorizontal.FormatFlags = StringFormatFlags.NoWrap;
- }
-
- if (RightToLeft == RightToLeft.Yes)
- _stringFormatTabHorizontal.FormatFlags |= StringFormatFlags.DirectionRightToLeft;
- else
- _stringFormatTabHorizontal.FormatFlags &= ~StringFormatFlags.DirectionRightToLeft;
-
- return _stringFormatTabHorizontal;
- }
- }
-
- private static StringFormat _stringFormatTabVertical;
- private StringFormat StringFormatTabVertical
- {
- get
- {
- if (_stringFormatTabVertical == null)
- {
- _stringFormatTabVertical = new StringFormat();
- _stringFormatTabVertical.Alignment = StringAlignment.Near;
- _stringFormatTabVertical.LineAlignment = StringAlignment.Center;
- _stringFormatTabVertical.FormatFlags = StringFormatFlags.NoWrap | StringFormatFlags.DirectionVertical;
- }
- if (RightToLeft == RightToLeft.Yes)
- _stringFormatTabVertical.FormatFlags |= StringFormatFlags.DirectionRightToLeft;
- else
- _stringFormatTabVertical.FormatFlags &= ~StringFormatFlags.DirectionRightToLeft;
-
- return _stringFormatTabVertical;
- }
- }
-
- private static int ImageHeight
- {
- get { return _ImageHeight; }
- }
-
- private static int ImageWidth
- {
- get { return _ImageWidth; }
- }
-
- private static int ImageGapTop
- {
- get { return _ImageGapTop; }
- }
-
- private static int ImageGapLeft
- {
- get { return _ImageGapLeft; }
- }
-
- private static int ImageGapRight
- {
- get { return _ImageGapRight; }
- }
-
- private static int ImageGapBottom
- {
- get { return _ImageGapBottom; }
- }
-
- private static int TextGapLeft
- {
- get { return _TextGapLeft; }
- }
-
- private static int TextGapRight
- {
- get { return _TextGapRight; }
- }
-
- private static int TabGapTop
- {
- get { return _TabGapTop; }
- }
-
- private static int TabGapLeft
- {
- get { return _TabGapLeft; }
- }
-
- private static int TabGapBetween
- {
- get { return _TabGapBetween; }
- }
-
- private static Brush BrushTabBackground
- {
- get { return SystemBrushes.Control; }
- }
-
- private static Pen PenTabBorder
- {
- get { return SystemPens.GrayText; }
- }
-
- private static Brush BrushTabText
- {
- get { return SystemBrushes.FromSystemColor(SystemColors.ControlDarkDark); }
- }
- #endregion
-
- private static Matrix _matrixIdentity = new Matrix();
- private static Matrix MatrixIdentity
- {
- get { return _matrixIdentity; }
- }
-
- private static DockState[] _dockStates;
- private static DockState[] DockStates
- {
- get
- {
- if (_dockStates == null)
- {
- _dockStates = new DockState[4];
- _dockStates[0] = DockState.DockLeftAutoHide;
- _dockStates[1] = DockState.DockRightAutoHide;
- _dockStates[2] = DockState.DockTopAutoHide;
- _dockStates[3] = DockState.DockBottomAutoHide;
- }
- return _dockStates;
- }
- }
-
- private static GraphicsPath _graphicsPath;
- internal static GraphicsPath GraphicsPath
- {
- get
- {
- if (_graphicsPath == null)
- _graphicsPath = new GraphicsPath();
-
- return _graphicsPath;
- }
- }
-
- public VS2005AutoHideStrip(DockPanel panel) : base(panel)
- {
- SetStyle(ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint |
- ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer, true);
- BackColor = SystemColors.ControlLight;
- }
-
- protected override void OnPaint(PaintEventArgs e)
- {
- Graphics g = e.Graphics;
- DrawTabStrip(g);
- }
-
- protected override void OnLayout(LayoutEventArgs levent)
- {
- CalculateTabs();
- base.OnLayout (levent);
- }
-
- private void DrawTabStrip(Graphics g)
- {
- DrawTabStrip(g, DockState.DockTopAutoHide);
- DrawTabStrip(g, DockState.DockBottomAutoHide);
- DrawTabStrip(g, DockState.DockLeftAutoHide);
- DrawTabStrip(g, DockState.DockRightAutoHide);
- }
-
- private void DrawTabStrip(Graphics g, DockState dockState)
- {
- Rectangle rectTabStrip = GetLogicalTabStripRectangle(dockState);
-
- if (rectTabStrip.IsEmpty)
- return;
-
- Matrix matrixIdentity = g.Transform;
- if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide)
- {
- Matrix matrixRotated = new Matrix();
- matrixRotated.RotateAt(90, new PointF((float)rectTabStrip.X + (float)rectTabStrip.Height / 2,
- (float)rectTabStrip.Y + (float)rectTabStrip.Height / 2));
- g.Transform = matrixRotated;
- }
-
- foreach (Pane pane in GetPanes(dockState))
- {
- foreach (TabVS2005 tab in pane.AutoHideTabs)
- DrawTab(g, tab);
- }
- g.Transform = matrixIdentity;
- }
-
- private void CalculateTabs()
- {
- CalculateTabs(DockState.DockTopAutoHide);
- CalculateTabs(DockState.DockBottomAutoHide);
- CalculateTabs(DockState.DockLeftAutoHide);
- CalculateTabs(DockState.DockRightAutoHide);
- }
-
- private void CalculateTabs(DockState dockState)
- {
- Rectangle rectTabStrip = GetLogicalTabStripRectangle(dockState);
-
- int imageHeight = rectTabStrip.Height - ImageGapTop - ImageGapBottom;
- int imageWidth = ImageWidth;
- if (imageHeight > ImageHeight)
- imageWidth = ImageWidth * (imageHeight / ImageHeight);
-
- int x = TabGapLeft + rectTabStrip.X;
- foreach (Pane pane in GetPanes(dockState))
- {
- foreach (TabVS2005 tab in pane.AutoHideTabs)
- {
- int width = imageWidth + ImageGapLeft + ImageGapRight +
- TextRenderer.MeasureText(tab.Content.DockHandler.TabText, TextFont).Width +
- TextGapLeft + TextGapRight;
- tab.TabX = x;
- tab.TabWidth = width;
- x += width;
- }
-
- x += TabGapBetween;
- }
- }
-
- private Rectangle RtlTransform(Rectangle rect, DockState dockState)
- {
- Rectangle rectTransformed;
- if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide)
- rectTransformed = rect;
- else
- rectTransformed = DrawHelper.RtlTransform(this, rect);
-
- return rectTransformed;
- }
-
- private GraphicsPath GetTabOutline(TabVS2005 tab, bool transformed, bool rtlTransform)
- {
- DockState dockState = tab.Content.DockHandler.DockState;
- Rectangle rectTab = GetTabRectangle(tab, transformed);
- if (rtlTransform)
- rectTab = RtlTransform(rectTab, dockState);
- bool upTab = (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockBottomAutoHide);
- DrawHelper.GetRoundedCornerTab(GraphicsPath, rectTab, upTab);
-
- return GraphicsPath;
- }
-
- private void DrawTab(Graphics g, TabVS2005 tab)
- {
- Rectangle rectTabOrigin = GetTabRectangle(tab);
- if (rectTabOrigin.IsEmpty)
- return;
-
- DockState dockState = tab.Content.DockHandler.DockState;
- IDockContent content = tab.Content;
-
- GraphicsPath path = GetTabOutline(tab, false, true);
- g.FillPath(BrushTabBackground, path);
- g.DrawPath(PenTabBorder, path);
-
- // Set no rotate for drawing icon and text
- Matrix matrixRotate = g.Transform;
- g.Transform = MatrixIdentity;
-
- // Draw the icon
- Rectangle rectImage = rectTabOrigin;
- rectImage.X += ImageGapLeft;
- rectImage.Y += ImageGapTop;
- int imageHeight = rectTabOrigin.Height - ImageGapTop - ImageGapBottom;
- int imageWidth = ImageWidth;
- if (imageHeight > ImageHeight)
- imageWidth = ImageWidth * (imageHeight/ImageHeight);
- rectImage.Height = imageHeight;
- rectImage.Width = imageWidth;
- rectImage = GetTransformedRectangle(dockState, rectImage);
- g.DrawIcon(((Form)content).Icon, RtlTransform(rectImage, dockState));
-
- // Draw the text
- Rectangle rectText = rectTabOrigin;
- rectText.X += ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
- rectText.Width -= ImageGapLeft + imageWidth + ImageGapRight + TextGapLeft;
- rectText = RtlTransform(GetTransformedRectangle(dockState, rectText), dockState);
- if (dockState == DockState.DockLeftAutoHide || dockState == DockState.DockRightAutoHide)
- g.DrawString(content.DockHandler.TabText, TextFont, BrushTabText, rectText, StringFormatTabVertical);
- else
- g.DrawString(content.DockHandler.TabText, TextFont, BrushTabText, rectText, StringFormatTabHorizontal);
-
- // Set rotate back
- g.Transform = matrixRotate;
- }
-
- private Rectangle GetLogicalTabStripRectangle(DockState dockState)
- {
- return GetLogicalTabStripRectangle(dockState, false);
- }
-
- private Rectangle GetLogicalTabStripRectangle(DockState dockState, bool transformed)
- {
- if (!DockHelper.IsDockStateAutoHide(dockState))
- return Rectangle.Empty;
-
- int leftPanes = GetPanes(DockState.DockLeftAutoHide).Count;
- int rightPanes = GetPanes(DockState.DockRightAutoHide).Count;
- int topPanes = GetPanes(DockState.DockTopAutoHide).Count;
- int bottomPanes = GetPanes(DockState.DockBottomAutoHide).Count;
-
- int x, y, width, height;
-
- height = MeasureHeight();
- if (dockState == DockState.DockLeftAutoHide && leftPanes > 0)
- {
- x = 0;
- y = (topPanes == 0) ? 0 : height;
- width = Height - (topPanes == 0 ? 0 : height) - (bottomPanes == 0 ? 0 :height);
- }
- else if (dockState == DockState.DockRightAutoHide && rightPanes > 0)
- {
- x = Width - height;
- if (leftPanes != 0 && x < height)
- x = height;
- y = (topPanes == 0) ? 0 : height;
- width = Height - (topPanes == 0 ? 0 : height) - (bottomPanes == 0 ? 0 :height);
- }
- else if (dockState == DockState.DockTopAutoHide && topPanes > 0)
- {
- x = leftPanes == 0 ? 0 : height;
- y = 0;
- width = Width - (leftPanes == 0 ? 0 : height) - (rightPanes == 0 ? 0 : height);
- }
- else if (dockState == DockState.DockBottomAutoHide && bottomPanes > 0)
- {
- x = leftPanes == 0 ? 0 : height;
- y = Height - height;
- if (topPanes != 0 && y < height)
- y = height;
- width = Width - (leftPanes == 0 ? 0 : height) - (rightPanes == 0 ? 0 : height);
- }
- else
- return Rectangle.Empty;
-
- if (!transformed)
- return new Rectangle(x, y, width, height);
- else
- return GetTransformedRectangle(dockState, new Rectangle(x, y, width, height));
- }
-
- private Rectangle GetTabRectangle(TabVS2005 tab)
- {
- return GetTabRectangle(tab, false);
- }
-
- private Rectangle GetTabRectangle(TabVS2005 tab, bool transformed)
- {
- DockState dockState = tab.Content.DockHandler.DockState;
- Rectangle rectTabStrip = GetLogicalTabStripRectangle(dockState);
-
- if (rectTabStrip.IsEmpty)
- return Rectangle.Empty;
-
- int x = tab.TabX;
- int y = rectTabStrip.Y +
- (dockState == DockState.DockTopAutoHide || dockState == DockState.DockRightAutoHide ?
- 0 : TabGapTop);
- int width = tab.TabWidth;
- int height = rectTabStrip.Height - TabGapTop;
-
- if (!transformed)
- return new Rectangle(x, y, width, height);
- else
- return GetTransformedRectangle(dockState, new Rectangle(x, y, width, height));
- }
-
- private Rectangle GetTransformedRectangle(DockState dockState, Rectangle rect)
- {
- if (dockState != DockState.DockLeftAutoHide && dockState != DockState.DockRightAutoHide)
- return rect;
-
- PointF[] pts = new PointF[1];
- // the center of the rectangle
- pts[0].X = (float)rect.X + (float)rect.Width / 2;
- pts[0].Y = (float)rect.Y + (float)rect.Height / 2;
- Rectangle rectTabStrip = GetLogicalTabStripRectangle(dockState);
- Matrix matrix = new Matrix();
- matrix.RotateAt(90, new PointF((float)rectTabStrip.X + (float)rectTabStrip.Height / 2,
- (float)rectTabStrip.Y + (float)rectTabStrip.Height / 2));
- matrix.TransformPoints(pts);
-
- return new Rectangle((int)(pts[0].X - (float)rect.Height / 2 + .5F),
- (int)(pts[0].Y - (float)rect.Width / 2 + .5F),
- rect.Height, rect.Width);
- }
-
- protected override IDockContent HitTest(Point ptMouse)
- {
- foreach(DockState state in DockStates)
- {
- Rectangle rectTabStrip = GetLogicalTabStripRectangle(state, true);
- if (!rectTabStrip.Contains(ptMouse))
- continue;
-
- foreach(Pane pane in GetPanes(state))
- {
- DockState dockState = pane.DockPane.DockState;
- foreach(TabVS2005 tab in pane.AutoHideTabs)
- {
- GraphicsPath path = GetTabOutline(tab, true, true);
- if (path.IsVisible(ptMouse))
- return tab.Content;
- }
- }
- }
-
- return null;
- }
-
- protected internal override int MeasureHeight()
- {
- return Math.Max(ImageGapBottom +
- ImageGapTop + ImageHeight,
- TextFont.Height) + TabGapTop;
- }
-
- protected override void OnRefreshChanges()
- {
- CalculateTabs();
- Invalidate();
- }
-
- protected override AutoHideStripBase.Tab CreateTab(IDockContent content)
- {
- return new TabVS2005(content);
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005DockPaneCaption.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005DockPaneCaption.cs
deleted file mode 100644
index 20a0eec787..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005DockPaneCaption.cs
+++ /dev/null
@@ -1,468 +0,0 @@
-using System;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Windows.Forms;
-using System.ComponentModel;
-using System.Windows.Forms.VisualStyles;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal class VS2005DockPaneCaption : DockPaneCaptionBase
- {
- private sealed class InertButton : InertButtonBase
- {
- private Bitmap m_image, m_imageAutoHide;
-
- public InertButton(VS2005DockPaneCaption dockPaneCaption, Bitmap image, Bitmap imageAutoHide)
- : base()
- {
- m_dockPaneCaption = dockPaneCaption;
- m_image = image;
- m_imageAutoHide = imageAutoHide;
- RefreshChanges();
- }
-
- private VS2005DockPaneCaption m_dockPaneCaption;
- private VS2005DockPaneCaption DockPaneCaption
- {
- get { return m_dockPaneCaption; }
- }
-
- public bool IsAutoHide
- {
- get { return DockPaneCaption.DockPane.IsAutoHide; }
- }
-
- public override Bitmap Image
- {
- get { return IsAutoHide ? m_imageAutoHide : m_image; }
- }
-
- protected override void OnRefreshChanges()
- {
- if (DockPaneCaption.TextColor != ForeColor)
- {
- ForeColor = DockPaneCaption.TextColor;
- Invalidate();
- }
- }
- }
-
- #region consts
- private const int _TextGapTop = 2;
- private const int _TextGapBottom = 0;
- private const int _TextGapLeft = 3;
- private const int _TextGapRight = 3;
- private const int _ButtonGapTop = 2;
- private const int _ButtonGapBottom = 1;
- private const int _ButtonGapBetween = 1;
- private const int _ButtonGapLeft = 1;
- private const int _ButtonGapRight = 2;
- #endregion
-
- private static Bitmap _imageButtonClose;
- private static Bitmap ImageButtonClose
- {
- get
- {
- if (_imageButtonClose == null)
- _imageButtonClose = Resources.DockPane_Close;
-
- return _imageButtonClose;
- }
- }
-
- private InertButton m_buttonClose;
- private InertButton ButtonClose
- {
- get
- {
- if (m_buttonClose == null)
- {
- m_buttonClose = new InertButton(this, ImageButtonClose, ImageButtonClose);
- m_toolTip.SetToolTip(m_buttonClose, ToolTipClose);
- m_buttonClose.Click += new EventHandler(Close_Click);
- Controls.Add(m_buttonClose);
- }
-
- return m_buttonClose;
- }
- }
-
- private static Bitmap _imageButtonAutoHide;
- private static Bitmap ImageButtonAutoHide
- {
- get
- {
- if (_imageButtonAutoHide == null)
- _imageButtonAutoHide = Resources.DockPane_AutoHide;
-
- return _imageButtonAutoHide;
- }
- }
-
- private static Bitmap _imageButtonDock;
- private static Bitmap ImageButtonDock
- {
- get
- {
- if (_imageButtonDock == null)
- _imageButtonDock = Resources.DockPane_Dock;
-
- return _imageButtonDock;
- }
- }
-
- private InertButton m_buttonAutoHide;
- private InertButton ButtonAutoHide
- {
- get
- {
- if (m_buttonAutoHide == null)
- {
- m_buttonAutoHide = new InertButton(this, ImageButtonDock, ImageButtonAutoHide);
- m_toolTip.SetToolTip(m_buttonAutoHide, ToolTipAutoHide);
- m_buttonAutoHide.Click += new EventHandler(AutoHide_Click);
- Controls.Add(m_buttonAutoHide);
- }
-
- return m_buttonAutoHide;
- }
- }
-
- private static Bitmap _imageButtonOptions;
- private static Bitmap ImageButtonOptions
- {
- get
- {
- if (_imageButtonOptions == null)
- _imageButtonOptions = Resources.DockPane_Option;
-
- return _imageButtonOptions;
- }
- }
-
- private InertButton m_buttonOptions;
- private InertButton ButtonOptions
- {
- get
- {
- if (m_buttonOptions == null)
- {
- m_buttonOptions = new InertButton(this, ImageButtonOptions, ImageButtonOptions);
- m_toolTip.SetToolTip(m_buttonOptions, ToolTipOptions);
- m_buttonOptions.Click += new EventHandler(Options_Click);
- Controls.Add(m_buttonOptions);
- }
- return m_buttonOptions;
- }
- }
-
- private IContainer m_components;
- private IContainer Components
- {
- get { return m_components; }
- }
-
- private ToolTip m_toolTip;
-
- public VS2005DockPaneCaption(DockPane pane) : base(pane)
- {
- SuspendLayout();
-
- m_components = new Container();
- m_toolTip = new ToolTip(Components);
-
- ResumeLayout();
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- Components.Dispose();
- base.Dispose(disposing);
- }
-
- private static int TextGapTop
- {
- get { return _TextGapTop; }
- }
-
- private static Font TextFont
- {
- get { return SystemInformation.MenuFont; }
- }
-
- private static int TextGapBottom
- {
- get { return _TextGapBottom; }
- }
-
- private static int TextGapLeft
- {
- get { return _TextGapLeft; }
- }
-
- private static int TextGapRight
- {
- get { return _TextGapRight; }
- }
-
- private static int ButtonGapTop
- {
- get { return _ButtonGapTop; }
- }
-
- private static int ButtonGapBottom
- {
- get { return _ButtonGapBottom; }
- }
-
- private static int ButtonGapLeft
- {
- get { return _ButtonGapLeft; }
- }
-
- private static int ButtonGapRight
- {
- get { return _ButtonGapRight; }
- }
-
- private static int ButtonGapBetween
- {
- get { return _ButtonGapBetween; }
- }
-
- private static string _toolTipClose;
- private static string ToolTipClose
- {
- get
- {
- if (_toolTipClose == null)
- _toolTipClose = Strings.DockPaneCaption_ToolTipClose;
- return _toolTipClose;
- }
- }
-
- private static string _toolTipOptions;
- private static string ToolTipOptions
- {
- get
- {
- if (_toolTipOptions == null)
- _toolTipOptions = Strings.DockPaneCaption_ToolTipOptions;
-
- return _toolTipOptions;
- }
- }
-
- private static string _toolTipAutoHide;
- private static string ToolTipAutoHide
- {
- get
- {
- if (_toolTipAutoHide == null)
- _toolTipAutoHide = Strings.DockPaneCaption_ToolTipAutoHide;
- return _toolTipAutoHide;
- }
- }
-
- private static Blend _activeBackColorGradientBlend;
- private static Blend ActiveBackColorGradientBlend
- {
- get
- {
- if (_activeBackColorGradientBlend == null)
- {
- Blend blend = new Blend(2);
-
- blend.Factors = new float[]{0.5F, 1.0F};
- blend.Positions = new float[]{0.0F, 1.0F};
- _activeBackColorGradientBlend = blend;
- }
-
- return _activeBackColorGradientBlend;
- }
- }
-
- private static Color ActiveBackColorGradientBegin
- {
- get { return SystemColors.GradientActiveCaption; }
- }
-
- private static Color ActiveBackColorGradientEnd
- {
- get { return SystemColors.ActiveCaption; }
- }
-
- private static Color InactiveBackColor
- {
- get
- {
- return SystemColors.Control;
- }
- }
-
- private static Color ActiveTextColor
- {
- get { return SystemColors.ActiveCaptionText; }
- }
-
- private static Color InactiveTextColor
- {
- get { return SystemColors.ControlText; }
- }
-
- private Color TextColor
- {
- get { return DockPane.IsActivated ? ActiveTextColor : InactiveTextColor; }
- }
-
- private static TextFormatFlags _textFormat =
- TextFormatFlags.SingleLine |
- TextFormatFlags.EndEllipsis |
- TextFormatFlags.VerticalCenter;
- private TextFormatFlags TextFormat
- {
- get
- {
- if (RightToLeft == RightToLeft.No)
- return _textFormat;
- else
- return _textFormat | TextFormatFlags.RightToLeft | TextFormatFlags.Right;
- }
- }
-
- protected internal override int MeasureHeight()
- {
- int height = TextFont.Height + TextGapTop + TextGapBottom;
-
- if (height < ButtonClose.Image.Height + ButtonGapTop + ButtonGapBottom)
- height = ButtonClose.Image.Height + ButtonGapTop + ButtonGapBottom;
-
- return height;
- }
-
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint (e);
- DrawCaption(e.Graphics);
- }
-
- private void DrawCaption(Graphics g)
- {
- if (ClientRectangle.Width == 0 || ClientRectangle.Height == 0)
- return;
-
- if (DockPane.IsActivated)
- {
- using (LinearGradientBrush brush = new LinearGradientBrush(ClientRectangle, ActiveBackColorGradientBegin, ActiveBackColorGradientEnd, LinearGradientMode.Vertical))
- {
- brush.Blend = ActiveBackColorGradientBlend;
- g.FillRectangle(brush, ClientRectangle);
- }
- }
- else
- {
- using (SolidBrush brush = new SolidBrush(InactiveBackColor))
- {
- g.FillRectangle(brush, ClientRectangle);
- }
- g.DrawRectangle(SystemPens.ControlDark, new Rectangle(0, 0, ClientSize.Width - 1, ClientSize.Height - 1));
- }
-
- Rectangle rectCaption = ClientRectangle;
-
- Rectangle rectCaptionText = rectCaption;
- rectCaptionText.X += TextGapLeft;
- rectCaptionText.Width -= TextGapLeft + TextGapRight;
- rectCaptionText.Width -= ButtonGapLeft + ButtonClose.Width + ButtonGapRight;
- if (ShouldShowAutoHideButton)
- rectCaptionText.Width -= ButtonAutoHide.Width + ButtonGapBetween;
- if (HasTabPageContextMenu)
- rectCaptionText.Width -= ButtonOptions.Width + ButtonGapBetween;
- rectCaptionText.Y += TextGapTop;
- rectCaptionText.Height -= TextGapTop + TextGapBottom;
- TextRenderer.DrawText(g, DockPane.CaptionText, TextFont, DrawHelper.RtlTransform(this, rectCaptionText), TextColor, TextFormat);
- }
-
- protected override void OnLayout(LayoutEventArgs levent)
- {
- SetButtonsPosition();
- base.OnLayout (levent);
- }
-
- protected override void OnRefreshChanges()
- {
- SetButtons();
- Invalidate();
- }
-
- private bool CloseButtonEnabled
- {
- get { return (DockPane.ActiveContent != null)? DockPane.ActiveContent.DockHandler.CloseButton : false; }
- }
-
- private bool ShouldShowAutoHideButton
- {
- get { return !DockPane.IsFloat; }
- }
-
- private void SetButtons()
- {
- ButtonClose.Enabled = CloseButtonEnabled;
- ButtonAutoHide.Visible = ShouldShowAutoHideButton;
- ButtonOptions.Visible = HasTabPageContextMenu;
- ButtonClose.RefreshChanges();
- ButtonAutoHide.RefreshChanges();
- ButtonOptions.RefreshChanges();
-
- SetButtonsPosition();
- }
-
- private void SetButtonsPosition()
- {
- // set the size and location for close and auto-hide buttons
- Rectangle rectCaption = ClientRectangle;
- int buttonWidth = ButtonClose.Image.Width;
- int buttonHeight = ButtonClose.Image.Height;
- int height = rectCaption.Height - ButtonGapTop - ButtonGapBottom;
- if (buttonHeight < height)
- {
- buttonWidth = buttonWidth * (height / buttonHeight);
- buttonHeight = height;
- }
- Size buttonSize = new Size(buttonWidth, buttonHeight);
- int x = rectCaption.X + rectCaption.Width - 1 - ButtonGapRight - m_buttonClose.Width;
- int y = rectCaption.Y + ButtonGapTop;
- Point point = new Point(x, y);
- ButtonClose.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize));
- point.Offset(-(buttonWidth + ButtonGapBetween), 0);
- ButtonAutoHide.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize));
- if (ShouldShowAutoHideButton)
- point.Offset(-(buttonWidth + ButtonGapBetween), 0);
- ButtonOptions.Bounds = DrawHelper.RtlTransform(this, new Rectangle(point, buttonSize));
- }
-
- private void Close_Click(object sender, EventArgs e)
- {
- DockPane.CloseActiveContent();
- }
-
- private void AutoHide_Click(object sender, EventArgs e)
- {
- DockPane.DockState = DockHelper.ToggleAutoHideState(DockPane.DockState);
- }
-
- private void Options_Click(object sender, EventArgs e)
- {
- ShowTabPageContextMenu(PointToClient(Control.MousePosition));
- }
-
- protected override void OnRightToLeftChanged(EventArgs e)
- {
- base.OnRightToLeftChanged(e);
- PerformLayout();
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005DockPaneStrip.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005DockPaneStrip.cs
deleted file mode 100644
index c372a1065c..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/VS2005DockPaneStrip.cs
+++ /dev/null
@@ -1,1301 +0,0 @@
-using System;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Windows.Forms;
-using System.ComponentModel;
-using System.Collections;
-using System.Collections.Generic;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- internal class VS2005DockPaneStrip : DockPaneStripBase
- {
- private class TabVS2005 : Tab
- {
- public TabVS2005(IDockContent content)
- : base(content)
- {
- }
-
- private int m_tabX;
- public int TabX
- {
- get { return m_tabX; }
- set { m_tabX = value; }
- }
-
- private int m_tabWidth;
- public int TabWidth
- {
- get { return m_tabWidth; }
- set { m_tabWidth = value; }
- }
-
- private int m_maxWidth;
- public int MaxWidth
- {
- get { return m_maxWidth; }
- set { m_maxWidth = value; }
- }
-
- private bool m_flag;
- protected internal bool Flag
- {
- get { return m_flag; }
- set { m_flag = value; }
- }
- }
-
- protected internal override DockPaneStripBase.Tab CreateTab(IDockContent content)
- {
- return new TabVS2005(content);
- }
-
- private sealed class InertButton : InertButtonBase
- {
- private Bitmap m_image0, m_image1;
-
- public InertButton(Bitmap image0, Bitmap image1)
- : base()
- {
- m_image0 = image0;
- m_image1 = image1;
- }
-
- private int m_imageCategory = 0;
- public int ImageCategory
- {
- get { return m_imageCategory; }
- set
- {
- if (m_imageCategory == value)
- return;
-
- m_imageCategory = value;
- Invalidate();
- }
- }
-
- public override Bitmap Image
- {
- get { return ImageCategory == 0 ? m_image0 : m_image1; }
- }
-
- protected override void OnRefreshChanges()
- {
- if (VS2005DockPaneStrip.ColorDocumentActiveText != ForeColor)
- {
- ForeColor = VS2005DockPaneStrip.ColorDocumentActiveText;
- Invalidate();
- }
- }
- }
-
- #region consts
- private const int _ToolWindowStripGapTop = 0;
- private const int _ToolWindowStripGapBottom = 1;
- private const int _ToolWindowStripGapLeft = 0;
- private const int _ToolWindowStripGapRight = 0;
- private const int _ToolWindowImageHeight = 16;
- private const int _ToolWindowImageWidth = 16;
- private const int _ToolWindowImageGapTop = 3;
- private const int _ToolWindowImageGapBottom = 1;
- private const int _ToolWindowImageGapLeft = 2;
- private const int _ToolWindowImageGapRight = 0;
- private const int _ToolWindowTextGapRight = 3;
- private const int _ToolWindowTabSeperatorGapTop = 3;
- private const int _ToolWindowTabSeperatorGapBottom = 3;
-
- private const int _DocumentStripGapTop = 0;
- private const int _DocumentStripGapBottom = 1;
- private const int _DocumentTabMaxWidth = 200;
- private const int _DocumentButtonGapTop = 4;
- private const int _DocumentButtonGapBottom = 4;
- private const int _DocumentButtonGapBetween = 0;
- private const int _DocumentButtonGapRight = 3;
- private const int _DocumentTabGapTop = 3;
- private const int _DocumentTabGapLeft = 3;
- private const int _DocumentTabGapRight = 3;
- private const int _DocumentIconGapBottom = 2;
- private const int _DocumentIconGapLeft = 8;
- private const int _DocumentIconGapRight = 0;
- private const int _DocumentIconHeight = 16;
- private const int _DocumentIconWidth = 16;
- private const int _DocumentTextGapRight = 3;
- #endregion
-
- private static Bitmap _imageButtonClose;
- private static Bitmap ImageButtonClose
- {
- get
- {
- if (_imageButtonClose == null)
- _imageButtonClose = Resources.DockPane_Close;
-
- return _imageButtonClose;
- }
- }
-
- private InertButton m_buttonClose;
- private InertButton ButtonClose
- {
- get
- {
- if (m_buttonClose == null)
- {
- m_buttonClose = new InertButton(ImageButtonClose, ImageButtonClose);
- m_toolTip.SetToolTip(m_buttonClose, ToolTipClose);
- m_buttonClose.Click += new EventHandler(Close_Click);
- Controls.Add(m_buttonClose);
- }
-
- return m_buttonClose;
- }
- }
-
- private static Bitmap _imageButtonWindowList;
- private static Bitmap ImageButtonWindowList
- {
- get
- {
- if (_imageButtonWindowList == null)
- _imageButtonWindowList = Resources.DockPane_Option;
-
- return _imageButtonWindowList;
- }
- }
-
- private static Bitmap _imageButtonWindowListOverflow;
- private static Bitmap ImageButtonWindowListOverflow
- {
- get
- {
- if (_imageButtonWindowListOverflow == null)
- _imageButtonWindowListOverflow = Resources.DockPane_OptionOverflow;
-
- return _imageButtonWindowListOverflow;
- }
- }
-
- private InertButton m_buttonWindowList;
- private InertButton ButtonWindowList
- {
- get
- {
- if (m_buttonWindowList == null)
- {
- m_buttonWindowList = new InertButton(ImageButtonWindowList, ImageButtonWindowListOverflow);
- m_toolTip.SetToolTip(m_buttonWindowList, ToolTipSelect);
- m_buttonWindowList.Click += new EventHandler(WindowList_Click);
- Controls.Add(m_buttonWindowList);
- }
-
- return m_buttonWindowList;
- }
- }
-
- private static GraphicsPath GraphicsPath
- {
- get { return VS2005AutoHideStrip.GraphicsPath; }
- }
-
- private IContainer m_components;
- private ToolTip m_toolTip;
- private IContainer Components
- {
- get { return m_components; }
- }
-
- #region Customizable Properties
- private static int ToolWindowStripGapTop
- {
- get { return _ToolWindowStripGapTop; }
- }
-
- private static int ToolWindowStripGapBottom
- {
- get { return _ToolWindowStripGapBottom; }
- }
-
- private static int ToolWindowStripGapLeft
- {
- get { return _ToolWindowStripGapLeft; }
- }
-
- private static int ToolWindowStripGapRight
- {
- get { return _ToolWindowStripGapRight; }
- }
-
- private static int ToolWindowImageHeight
- {
- get { return _ToolWindowImageHeight; }
- }
-
- private static int ToolWindowImageWidth
- {
- get { return _ToolWindowImageWidth; }
- }
-
- private static int ToolWindowImageGapTop
- {
- get { return _ToolWindowImageGapTop; }
- }
-
- private static int ToolWindowImageGapBottom
- {
- get { return _ToolWindowImageGapBottom; }
- }
-
- private static int ToolWindowImageGapLeft
- {
- get { return _ToolWindowImageGapLeft; }
- }
-
- private static int ToolWindowImageGapRight
- {
- get { return _ToolWindowImageGapRight; }
- }
-
- private static int ToolWindowTextGapRight
- {
- get { return _ToolWindowTextGapRight; }
- }
-
- private static int ToolWindowTabSeperatorGapTop
- {
- get { return _ToolWindowTabSeperatorGapTop; }
- }
-
- private static int ToolWindowTabSeperatorGapBottom
- {
- get { return _ToolWindowTabSeperatorGapBottom; }
- }
-
- private static string _toolTipClose;
- private static string ToolTipClose
- {
- get
- {
- if (_toolTipClose == null)
- _toolTipClose = Strings.DockPaneStrip_ToolTipClose;
- return _toolTipClose;
- }
- }
-
- private static string _toolTipSelect;
- private static string ToolTipSelect
- {
- get
- {
- if (_toolTipSelect == null)
- _toolTipSelect = Strings.DockPaneStrip_ToolTipWindowList;
- return _toolTipSelect;
- }
- }
-
- private TextFormatFlags ToolWindowTextFormat
- {
- get
- {
- TextFormatFlags textFormat = TextFormatFlags.EndEllipsis |
- TextFormatFlags.HorizontalCenter |
- TextFormatFlags.SingleLine |
- TextFormatFlags.VerticalCenter;
- if (RightToLeft == RightToLeft.Yes)
- return textFormat | TextFormatFlags.RightToLeft | TextFormatFlags.Right;
- else
- return textFormat;
- }
- }
-
- private static int DocumentStripGapTop
- {
- get { return _DocumentStripGapTop; }
- }
-
- private static int DocumentStripGapBottom
- {
- get { return _DocumentStripGapBottom; }
- }
-
- private TextFormatFlags DocumentTextFormat
- {
- get
- {
- TextFormatFlags textFormat = TextFormatFlags.PathEllipsis |
- TextFormatFlags.SingleLine |
- TextFormatFlags.VerticalCenter |
- TextFormatFlags.PreserveGraphicsClipping |
- TextFormatFlags.HorizontalCenter;
- if (RightToLeft == RightToLeft.Yes)
- return textFormat | TextFormatFlags.RightToLeft;
- else
- return textFormat;
- }
- }
-
- private static int DocumentTabMaxWidth
- {
- get { return _DocumentTabMaxWidth; }
- }
-
- private static int DocumentButtonGapTop
- {
- get { return _DocumentButtonGapTop; }
- }
-
- private static int DocumentButtonGapBottom
- {
- get { return _DocumentButtonGapBottom; }
- }
-
- private static int DocumentButtonGapBetween
- {
- get { return _DocumentButtonGapBetween; }
- }
-
- private static int DocumentButtonGapRight
- {
- get { return _DocumentButtonGapRight; }
- }
-
- private static int DocumentTabGapTop
- {
- get { return _DocumentTabGapTop; }
- }
-
- private static int DocumentTabGapLeft
- {
- get { return _DocumentTabGapLeft; }
- }
-
- private static int DocumentTabGapRight
- {
- get { return _DocumentTabGapRight; }
- }
-
- private static int DocumentIconGapBottom
- {
- get { return _DocumentIconGapBottom; }
- }
-
- private static int DocumentIconGapLeft
- {
- get { return _DocumentIconGapLeft; }
- }
-
- private static int DocumentIconGapRight
- {
- get { return _DocumentIconGapRight; }
- }
-
- private static int DocumentIconWidth
- {
- get { return _DocumentIconWidth; }
- }
-
- private static int DocumentIconHeight
- {
- get { return _DocumentIconHeight; }
- }
-
- private static int DocumentTextGapRight
- {
- get { return _DocumentTextGapRight; }
- }
-
- private static Pen PenToolWindowTabBorder
- {
- get { return SystemPens.GrayText; }
- }
-
- private static Pen PenDocumentTabActiveBorder
- {
- get { return SystemPens.ControlDarkDark; }
- }
-
- private static Pen PenDocumentTabInactiveBorder
- {
- get { return SystemPens.GrayText; }
- }
-
- private static Brush BrushToolWindowActiveBackground
- {
- get { return SystemBrushes.ControlLightLight; }
- }
-
- private static Brush BrushDocumentActiveBackground
- {
- get { return SystemBrushes.ControlLightLight; }
- }
-
- private static Brush BrushDocumentInactiveBackground
- {
- get { return SystemBrushes.ControlLight; }
- }
-
- private static Color ColorToolWindowActiveText
- {
- get { return SystemColors.ControlText; }
- }
-
- private static Color ColorDocumentActiveText
- {
- get { return SystemColors.ControlText; }
- }
-
- private static Color ColorToolWindowInactiveText
- {
- get { return SystemColors.ControlDarkDark; }
- }
-
- private static Color ColorDocumentInactiveText
- {
- get { return SystemColors.ControlText; }
- }
-
- #endregion
-
- public VS2005DockPaneStrip(DockPane pane) : base(pane)
- {
- SetStyle(ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint |
- ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer, true);
-
- SuspendLayout();
-
- m_components = new Container();
- m_toolTip = new ToolTip(Components);
- m_selectMenu = new ContextMenuStrip(Components);
-
- ResumeLayout();
- }
-
- protected override void Dispose(bool disposing)
- {
- if (disposing)
- {
- Components.Dispose();
- if (m_boldFont != null)
- {
- m_boldFont.Dispose();
- m_boldFont = null;
- }
- }
- base.Dispose (disposing);
- }
-
- private static Font TextFont
- {
- get { return SystemInformation.MenuFont; }
- }
-
- private Font m_font;
- private Font m_boldFont;
- private Font BoldFont
- {
- get
- {
- if (IsDisposed)
- return null;
-
- if (m_boldFont == null)
- {
- m_font = TextFont;
- m_boldFont = new Font(TextFont, FontStyle.Bold);
- }
- else if (m_font != TextFont)
- {
- m_boldFont.Dispose();
- m_font = TextFont;
- m_boldFont = new Font(TextFont, FontStyle.Bold);
- }
-
- return m_boldFont;
- }
- }
-
- private int m_startDisplayingTab = 0;
- private int StartDisplayingTab
- {
- get { return m_startDisplayingTab; }
- set
- {
- m_startDisplayingTab = value;
- Invalidate();
- }
- }
-
- private int m_endDisplayingTab = 0;
- private int EndDisplayingTab
- {
- get { return m_endDisplayingTab; }
- set { m_endDisplayingTab = value; }
- }
-
- private bool m_documentTabsOverflow = false;
- private bool DocumentTabsOverflow
- {
- set
- {
- if (m_documentTabsOverflow == value)
- return;
-
- m_documentTabsOverflow = value;
- if (value)
- ButtonWindowList.ImageCategory = 1;
- else
- ButtonWindowList.ImageCategory = 0;
- }
- }
-
- protected internal override int MeasureHeight()
- {
- if (Appearance == DockPane.AppearanceStyle.ToolWindow)
- return MeasureHeight_ToolWindow();
- else
- return MeasureHeight_Document();
- }
-
- private int MeasureHeight_ToolWindow()
- {
- if (DockPane.IsAutoHide || Tabs.Count <= 1)
- return 0;
-
- int height = Math.Max(TextFont.Height, ToolWindowImageHeight + ToolWindowImageGapTop + ToolWindowImageGapBottom)
- + ToolWindowStripGapTop + ToolWindowStripGapBottom;
-
- return height;
- }
-
- private int MeasureHeight_Document()
- {
- int height = Math.Max(TextFont.Height + DocumentTabGapTop,
- ButtonClose.Height + DocumentButtonGapTop + DocumentButtonGapBottom)
- + DocumentStripGapBottom + DocumentStripGapTop;
-
- return height;
- }
-
- protected override void OnPaint(PaintEventArgs e)
- {
- if (Appearance == DockPane.AppearanceStyle.Document)
- {
- if (BackColor != SystemColors.Control)
- BackColor = SystemColors.Control;
- }
- else
- {
- if (BackColor != SystemColors.ControlLight)
- BackColor = SystemColors.ControlLight;
- }
- base.OnPaint (e);
- CalculateTabs();
- if (Appearance == DockPane.AppearanceStyle.Document && DockPane.ActiveContent != null)
- {
- if (EnsureDocumentTabVisible(DockPane.ActiveContent, false))
- CalculateTabs();
- }
-
- DrawTabStrip(e.Graphics);
- }
-
- protected override void OnRefreshChanges()
- {
- SetInertButtons();
- Invalidate();
- }
-
- protected internal override GraphicsPath GetOutline(int index)
- {
-
- if (Appearance == DockPane.AppearanceStyle.Document)
- return GetOutline_Document(index);
- else
- return GetOutline_ToolWindow(index);
-
- }
-
- private GraphicsPath GetOutline_Document(int index)
- {
- Rectangle rectTab = GetTabRectangle(index);
- rectTab.X -= rectTab.Height / 2;
- rectTab.Intersect(TabsRectangle);
- rectTab = RectangleToScreen(DrawHelper.RtlTransform(this, rectTab));
- int y = rectTab.Top;
- Rectangle rectPaneClient = DockPane.RectangleToScreen(DockPane.ClientRectangle);
-
- GraphicsPath path = new GraphicsPath();
- GraphicsPath pathTab = GetTabOutline_Document(Tabs[index], true, true, true);
- path.AddPath(pathTab, true);
- path.AddLine(rectTab.Right, rectTab.Bottom, rectPaneClient.Right, rectTab.Bottom);
- path.AddLine(rectPaneClient.Right, rectTab.Bottom, rectPaneClient.Right, rectPaneClient.Bottom);
- path.AddLine(rectPaneClient.Right, rectPaneClient.Bottom, rectPaneClient.Left, rectPaneClient.Bottom);
- path.AddLine(rectPaneClient.Left, rectPaneClient.Bottom, rectPaneClient.Left, rectTab.Bottom);
- path.AddLine(rectPaneClient.Left, rectTab.Bottom, rectTab.Right, rectTab.Bottom);
- return path;
- }
-
- private GraphicsPath GetOutline_ToolWindow(int index)
- {
- Rectangle rectTab = GetTabRectangle(index);
- rectTab.Intersect(TabsRectangle);
- rectTab = RectangleToScreen(DrawHelper.RtlTransform(this, rectTab));
- int y = rectTab.Top;
- Rectangle rectPaneClient = DockPane.RectangleToScreen(DockPane.ClientRectangle);
-
- GraphicsPath path = new GraphicsPath();
- GraphicsPath pathTab = GetTabOutline(Tabs[index], true, true);
- path.AddPath(pathTab, true);
- path.AddLine(rectTab.Left, rectTab.Top, rectPaneClient.Left, rectTab.Top);
- path.AddLine(rectPaneClient.Left, rectTab.Top, rectPaneClient.Left, rectPaneClient.Top);
- path.AddLine(rectPaneClient.Left, rectPaneClient.Top, rectPaneClient.Right, rectPaneClient.Top);
- path.AddLine(rectPaneClient.Right, rectPaneClient.Top, rectPaneClient.Right, rectTab.Top);
- path.AddLine(rectPaneClient.Right, rectTab.Top, rectTab.Right, rectTab.Top);
- return path;
- }
-
- private void CalculateTabs()
- {
- if (Appearance == DockPane.AppearanceStyle.ToolWindow)
- CalculateTabs_ToolWindow();
- else
- CalculateTabs_Document();
- }
-
- private void CalculateTabs_ToolWindow()
- {
- if (Tabs.Count <= 1 || DockPane.IsAutoHide)
- return;
-
- Rectangle rectTabStrip = TabStripRectangle;
-
- // Calculate tab widths
- int countTabs = Tabs.Count;
- foreach (TabVS2005 tab in Tabs)
- {
- tab.MaxWidth = GetMaxTabWidth(Tabs.IndexOf(tab));
- tab.Flag = false;
- }
-
- // Set tab whose max width less than average width
- bool anyWidthWithinAverage = true;
- int totalWidth = rectTabStrip.Width - ToolWindowStripGapLeft - ToolWindowStripGapRight;
- int totalAllocatedWidth = 0;
- int averageWidth = totalWidth / countTabs;
- int remainedTabs = countTabs;
- for (anyWidthWithinAverage=true; anyWidthWithinAverage && remainedTabs>0;)
- {
- anyWidthWithinAverage = false;
- foreach (TabVS2005 tab in Tabs)
- {
- if (tab.Flag)
- continue;
-
- if (tab.MaxWidth <= averageWidth)
- {
- tab.Flag = true;
- tab.TabWidth = tab.MaxWidth;
- totalAllocatedWidth += tab.TabWidth;
- anyWidthWithinAverage = true;
- remainedTabs--;
- }
- }
- if (remainedTabs != 0)
- averageWidth = (totalWidth - totalAllocatedWidth) / remainedTabs;
- }
-
- // If any tab width not set yet, set it to the average width
- if (remainedTabs > 0)
- {
- int roundUpWidth = (totalWidth - totalAllocatedWidth) - (averageWidth * remainedTabs);
- foreach (TabVS2005 tab in Tabs)
- {
- if (tab.Flag)
- continue;
-
- tab.Flag = true;
- if (roundUpWidth > 0)
- {
- tab.TabWidth = averageWidth + 1;
- roundUpWidth --;
- }
- else
- tab.TabWidth = averageWidth;
- }
- }
-
- // Set the X position of the tabs
- int x = rectTabStrip.X + ToolWindowStripGapLeft;
- foreach (TabVS2005 tab in Tabs)
- {
- tab.TabX = x;
- x += tab.TabWidth;
- }
- }
-
- private bool CalculateDocumentTab(Rectangle rectTabStrip, ref int x, int index)
- {
- bool overflow = false;
-
- TabVS2005 tab = Tabs[index] as TabVS2005;
- tab.MaxWidth = GetMaxTabWidth(index);
- int width = Math.Min(tab.MaxWidth, DocumentTabMaxWidth);
- if (x + width < rectTabStrip.Right || index == StartDisplayingTab)
- {
- tab.TabX = x;
- tab.TabWidth = width;
- EndDisplayingTab = index;
- }
- else
- {
- tab.TabX = 0;
- tab.TabWidth = 0;
- overflow = true;
- }
- x += width;
-
- return overflow;
- }
-
- private void CalculateTabs_Document()
- {
- if (m_startDisplayingTab >= Tabs.Count)
- m_startDisplayingTab = 0;
-
- Rectangle rectTabStrip = TabsRectangle;
-
- int x = rectTabStrip.X + rectTabStrip.Height / 2;
-
- bool overflow = false;
- for (int i = StartDisplayingTab; i < Tabs.Count; i++)
- overflow = CalculateDocumentTab(rectTabStrip, ref x, i);
-
- for (int i = 0; i < StartDisplayingTab; i++)
- overflow = CalculateDocumentTab(rectTabStrip, ref x, i);
-
- if (!overflow)
- {
- m_startDisplayingTab = 0;
- x = rectTabStrip.X + rectTabStrip.Height / 2;
- foreach (TabVS2005 tab in Tabs)
- {
- tab.TabX = x;
- x += tab.TabWidth;
- }
- }
- DocumentTabsOverflow = overflow;
- }
-
- protected internal override void EnsureTabVisible(IDockContent content)
- {
- if (Appearance != DockPane.AppearanceStyle.Document || !Tabs.Contains(content))
- return;
-
- CalculateTabs();
- EnsureDocumentTabVisible(content, true);
- }
-
- private bool EnsureDocumentTabVisible(IDockContent content, bool repaint)
- {
- int index = Tabs.IndexOf(content);
- TabVS2005 tab = Tabs[index] as TabVS2005;
- if (tab.TabWidth != 0)
- return false;
-
- StartDisplayingTab = index;
- if (repaint)
- Invalidate();
-
- return true;
- }
-
- private int GetMaxTabWidth(int index)
- {
- if (Appearance == DockPane.AppearanceStyle.ToolWindow)
- return GetMaxTabWidth_ToolWindow(index);
- else
- return GetMaxTabWidth_Document(index);
- }
-
- private int GetMaxTabWidth_ToolWindow(int index)
- {
- IDockContent content = Tabs[index].Content;
- Size sizeString = TextRenderer.MeasureText(content.DockHandler.TabText, TextFont);
- return ToolWindowImageWidth + sizeString.Width + ToolWindowImageGapLeft
- + ToolWindowImageGapRight + ToolWindowTextGapRight;
- }
-
- private int GetMaxTabWidth_Document(int index)
- {
- IDockContent content = Tabs[index].Content;
-
- int height = GetTabRectangle_Document(index).Height;
-
- Size sizeText = TextRenderer.MeasureText(content.DockHandler.TabText, BoldFont, new Size(DocumentTabMaxWidth, height), DocumentTextFormat);
-
- if (DockPane.DockPanel.ShowDocumentIcon)
- return sizeText.Width + DocumentIconWidth + DocumentIconGapLeft + DocumentIconGapRight + DocumentTextGapRight;
- else
- return sizeText.Width + DocumentIconGapLeft + DocumentTextGapRight;
- }
-
- private void DrawTabStrip(Graphics g)
- {
- if (Appearance == DockPane.AppearanceStyle.Document)
- DrawTabStrip_Document(g);
- else
- DrawTabStrip_ToolWindow(g);
- }
-
- private void DrawTabStrip_Document(Graphics g)
- {
- int count = Tabs.Count;
- if (count == 0)
- return;
-
- Rectangle rectTabStrip = TabStripRectangle;
-
- // Draw the tabs
- Rectangle rectTabOnly = TabsRectangle;
- Rectangle rectTab = Rectangle.Empty;
- TabVS2005 tabActive = null;
- g.SetClip(DrawHelper.RtlTransform(this, rectTabOnly));
- for (int i=0; i tab.TabWidth)
- toolTip = tab.Content.DockHandler.TabText;
- }
-
- if (m_toolTip.GetToolTip(this) != toolTip)
- {
- m_toolTip.Active = false;
- m_toolTip.SetToolTip(this, toolTip);
- m_toolTip.Active = true;
- }
-
- // requires further tracking of mouse hover behavior,
- ResetMouseEventArgs();
- }
-
- protected override void OnRightToLeftChanged(EventArgs e)
- {
- base.OnRightToLeftChanged(e);
- PerformLayout();
- }
- }
-}
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/VisibleNestedPaneCollection.cs b/src/Libraries/DockPanel_Src/WinFormsUI/Docking/VisibleNestedPaneCollection.cs
deleted file mode 100644
index 46ff1b1fa9..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/Docking/VisibleNestedPaneCollection.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace WeifenLuo.WinFormsUI.Docking
-{
- public sealed class VisibleNestedPaneCollection : ReadOnlyCollection
- {
- private NestedPaneCollection m_nestedPanes;
-
- internal VisibleNestedPaneCollection(NestedPaneCollection nestedPanes)
- : base(new List())
- {
- m_nestedPanes = nestedPanes;
- }
-
- public NestedPaneCollection NestedPanes
- {
- get { return m_nestedPanes; }
- }
-
- public INestedPanesContainer Container
- {
- get { return NestedPanes.Container; }
- }
-
- public DockState DockState
- {
- get { return NestedPanes.DockState; }
- }
-
- public bool IsFloat
- {
- get { return NestedPanes.IsFloat; }
- }
-
- internal void Refresh()
- {
- Items.Clear();
- for (int i=0; i IndexOf(pane); i--)
- {
- if (this[i].NestedDockingStatus.PreviousPane == pane)
- {
- lastNestedPane = this[i];
- break;
- }
- }
-
- if (lastNestedPane != null)
- {
- int indexLastNestedPane = IndexOf(lastNestedPane);
- Items.Remove(lastNestedPane);
- Items[IndexOf(pane)] = lastNestedPane;
- NestedDockingStatus lastNestedDock = lastNestedPane.NestedDockingStatus;
- lastNestedDock.SetDisplayingStatus(true, statusPane.DisplayingPreviousPane, statusPane.DisplayingAlignment, statusPane.DisplayingProportion);
- for (int i=indexLastNestedPane - 1; i>IndexOf(lastNestedPane); i--)
- {
- NestedDockingStatus status = this[i].NestedDockingStatus;
- if (status.PreviousPane == pane)
- status.SetDisplayingStatus(true, lastNestedPane, status.DisplayingAlignment, status.DisplayingProportion);
- }
- }
- else
- Items.Remove(pane);
-
- statusPane.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5);
- }
-
- private void CalculateBounds()
- {
- if (Count == 0)
- return;
-
- this[0].NestedDockingStatus.SetDisplayingBounds(Container.DisplayingRectangle, Container.DisplayingRectangle, Rectangle.Empty);
-
- for (int i=1; i
-
- Debug
- AnyCPU
- 8.0.50727
- 2.0
- {C75532C4-765B-418E-B09B-46D36B2ABDB1}
- Library
- Properties
- WeifenLuo.WinFormsUI
- WeifenLuo.WinFormsUI.Docking
- true
- ..\..\..\Main\ICSharpCode.SharpDevelop.snk
- False
- File
- ..\..\..\..\bin\
- False
- False
- false
-
-
- true
- full
- false
- TRACE;DEBUG
- prompt
- 4
-
-
- pdbonly
- true
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
- Component
-
-
- Component
-
-
- Form
-
-
- Component
-
-
- Component
-
-
- Component
-
-
- Component
-
-
- Component
-
-
-
-
- Form
-
-
-
-
- Component
-
-
-
-
-
- UserControl
-
-
- Component
-
-
- Component
-
-
-
- Component
-
-
-
- Component
-
-
- UserControl
-
-
- Component
-
-
- Component
-
-
- Component
-
-
-
- Component
-
-
- Component
-
-
-
-
- Form
-
-
-
- Component
-
-
-
-
-
- Component
-
-
-
-
-
-
-
- True
- True
- Resources.resx
-
-
- True
- True
- Strings.resx
-
-
-
-
- patchnotes.txt
-
-
-
-
- Designer
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
- Designer
- ResXFileCodeGenerator
- Strings.Designer.cs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Never
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Libraries/DockPanel_Src/WinFormsUI/license.txt b/src/Libraries/DockPanel_Src/WinFormsUI/license.txt
deleted file mode 100644
index 96f3fa5ce9..0000000000
--- a/src/Libraries/DockPanel_Src/WinFormsUI/license.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-The MIT License
-
-Copyright (c) 2007 Weifen Luo (email: weifenluo@yahoo.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/Libraries/DockPanel_Src/license.txt b/src/Libraries/DockPanel_Src/license.txt
deleted file mode 100644
index 96f3fa5ce9..0000000000
--- a/src/Libraries/DockPanel_Src/license.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-The MIT License
-
-Copyright (c) 2007 Weifen Luo (email: weifenluo@yahoo.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/Libraries/DockPanel_Src/patchnotes.txt b/src/Libraries/DockPanel_Src/patchnotes.txt
deleted file mode 100644
index c78739c786..0000000000
--- a/src/Libraries/DockPanel_Src/patchnotes.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-List of our custom patches to apply to the DockPanel Suite:
-
-Patch #0:
- Add bool IsDisposed { get; } to IDockContent interface.
-
-Patch #1:
- Close documents with middle click - in DockPaneStripBase.cs
- Remove redundant finalizers - in AutoHideStripBase.cs, DockPaneStripBase.cs
- Changed background color of inactive pads. - in VS2005DockPaneCaption.cs, VS2005DockPaneStip.cs
- Committed in revision 2706.
-
-Patch #2:
- Prevent crash in DockPanel.FocusManager.Activate when active pane was removed (e.g. the pad
- that was active when SharpDevelop was closed does not exist anymore after an AddIn was removed
- manually or SharpDevelop was updated)
- Committed in revision 2732.
-
-Patch #3:
- Disable MDI focus workaround in DockContentHandler.cs
- This fixes the System.InvalidOperationException: Invalid Content: ActiveContent must be one ofthe visible contents, or null if there is no visible content.
- that occurs on layout changes iff no document is open and a pad has the focus.
- Committed in revision 2751.
-
-Patch #4:
- Prevent stack overflow in DockContentHandler.cs when showing a pad in certain layout configurations.
- Committed in revision 2970.
-
-Patch #5:
- In DockContentHandler.SetVisible:
- Ensure pad visibility is set correctly, even when Windows.Forms is "lying" about Form.Visible.
- Committed in revision 3061.
diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/AbstractCompletionWindow.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/AbstractCompletionWindow.cs
index 8c17c5bb9f..286ca19458 100644
--- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/AbstractCompletionWindow.cs
+++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/AbstractCompletionWindow.cs
@@ -19,13 +19,15 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
protected TextEditorControl control;
protected Size drawingSize;
Rectangle workingScreen;
+ IWin32Window parentWindow;
Form parentForm;
- protected AbstractCompletionWindow(Form parentForm, TextEditorControl control)
+ protected AbstractCompletionWindow(IWin32Window parentWindow, TextEditorControl control)
{
- workingScreen = Screen.GetWorkingArea(parentForm);
+ workingScreen = Screen.GetWorkingArea(control);
// SetStyle(ControlStyles.Selectable, false);
- this.parentForm = parentForm;
+ this.parentWindow = parentWindow;
+ this.parentForm = parentWindow as Form;
this.control = control;
SetLocation();
@@ -44,7 +46,7 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
int xpos = textArea.TextView.GetDrawingXPos(caretPos.Y, caretPos.X);
int rulerHeight = textArea.TextEditorProperties.ShowHorizontalRuler ? textArea.TextView.FontHeight : 0;
Point pos = new Point(textArea.TextView.DrawingPosition.X + xpos,
- textArea.TextView.DrawingPosition.Y + (textArea.Document.GetVisibleLine(caretPos.Y)) * textArea.TextView.FontHeight
+ textArea.TextView.DrawingPosition.Y + (textArea.Document.GetVisibleLine(caretPos.Y)) * textArea.TextView.FontHeight
- textArea.TextView.TextArea.VirtualTop.Y + textArea.TextView.FontHeight + rulerHeight);
Point location = control.ActiveTextAreaControl.PointToScreen(pos);
@@ -110,9 +112,8 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
protected void ShowCompletionWindow()
{
- Owner = parentForm;
Enabled = true;
- this.Show();
+ this.Show(parentWindow);
control.Focus();
@@ -171,7 +172,9 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
base.OnClosed(e);
// take out the inserted methods
- parentForm.LocationChanged -= new EventHandler(ParentFormLocationChanged);
+ if (parentForm != null) {
+ parentForm.LocationChanged -= new EventHandler(ParentFormLocationChanged);
+ }
foreach (Control c in Controls) {
c.MouseMove -= ControlMouseMove;
diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/CodeCompletionWindow.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/CodeCompletionWindow.cs
index f0730379a2..4edc91510b 100644
--- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/CodeCompletionWindow.cs
+++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/CodeCompletionWindow.cs
@@ -30,12 +30,12 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
DeclarationViewWindow declarationViewWindow = null;
Rectangle workingScreen;
- public static CodeCompletionWindow ShowCompletionWindow(Form parent, TextEditorControl control, string fileName, ICompletionDataProvider completionDataProvider, char firstChar)
+ public static CodeCompletionWindow ShowCompletionWindow(IWin32Window parent, TextEditorControl control, string fileName, ICompletionDataProvider completionDataProvider, char firstChar)
{
return ShowCompletionWindow(parent, control, fileName, completionDataProvider, firstChar, true, true);
}
- public static CodeCompletionWindow ShowCompletionWindow(Form parent, TextEditorControl control, string fileName, ICompletionDataProvider completionDataProvider, char firstChar, bool showDeclarationWindow, bool fixedListViewWidth)
+ public static CodeCompletionWindow ShowCompletionWindow(IWin32Window parent, TextEditorControl control, string fileName, ICompletionDataProvider completionDataProvider, char firstChar, bool showDeclarationWindow, bool fixedListViewWidth)
{
ICompletionData[] completionData = completionDataProvider.GenerateCompletionData(fileName, control.ActiveTextAreaControl.TextArea, firstChar);
if (completionData == null || completionData.Length == 0) {
@@ -47,7 +47,7 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
return codeCompletionWindow;
}
- CodeCompletionWindow(ICompletionDataProvider completionDataProvider, ICompletionData[] completionData, Form parentForm, TextEditorControl control, bool showDeclarationWindow, bool fixedListViewWidth) : base(parentForm, control)
+ CodeCompletionWindow(ICompletionDataProvider completionDataProvider, ICompletionData[] completionData, IWin32Window parentWindow, TextEditorControl control, bool showDeclarationWindow, bool fixedListViewWidth) : base(parentWindow, control)
{
this.dataProvider = completionDataProvider;
this.completionData = completionData;
@@ -85,7 +85,7 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
SetLocation();
if (declarationViewWindow == null) {
- declarationViewWindow = new DeclarationViewWindow(parentForm);
+ declarationViewWindow = new DeclarationViewWindow(parentWindow);
}
SetDeclarationViewLocation();
declarationViewWindow.ShowDeclarationViewWindow();
diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/DeclarationViewWindow.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/DeclarationViewWindow.cs
index ac3c198551..82fdb25d02 100644
--- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/DeclarationViewWindow.cs
+++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/DeclarationViewWindow.cs
@@ -43,13 +43,14 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
}
public bool HideOnClick;
+ IWin32Window parentWindow;
- public DeclarationViewWindow(Form parent)
+ public DeclarationViewWindow(IWin32Window parent)
{
SetStyle(ControlStyles.Selectable, false);
StartPosition = FormStartPosition.Manual;
FormBorderStyle = FormBorderStyle.None;
- Owner = parent;
+ this.parentWindow = parent;
ShowInTaskbar = false;
Size = new Size(0, 0);
base.CreateHandle();
@@ -77,7 +78,7 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow
public void ShowDeclarationViewWindow()
{
- Show();
+ Show(parentWindow);
}
public void CloseDeclarationViewWindow()
diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/InsightWindow/InsightWindow.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/InsightWindow/InsightWindow.cs
index b6f19aef08..0a6a42078c 100644
--- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/InsightWindow/InsightWindow.cs
+++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/InsightWindow/InsightWindow.cs
@@ -17,7 +17,7 @@ namespace ICSharpCode.TextEditor.Gui.InsightWindow
{
public class InsightWindow : AbstractCompletionWindow
{
- public InsightWindow(Form parentForm, TextEditorControl control) : base(parentForm, control)
+ public InsightWindow(IWin32Window parentWindow, TextEditorControl control) : base(parentWindow, control)
{
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
diff --git a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
index df1f92ca4a..c225bb5b67 100644
--- a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
+++ b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
@@ -40,6 +40,15 @@
False
+
+ ..\..\..\Libraries\AvalonDock\AvalonDock.dll
+
+
+ 3.0
+
+
+ 3.0
+
@@ -52,11 +61,19 @@
False
+
+ 3.0
+
+
+
+ App.xaml
+ Code
+
@@ -109,8 +126,12 @@
-
+
+
+
+
+
@@ -282,13 +303,13 @@
Component
-
+
Form
-
-
-
+
+
+
Form
-
+
@@ -460,7 +481,6 @@
-
@@ -714,6 +734,7 @@
+
ExtractInterfaceDialog.cs
@@ -733,10 +754,6 @@
-
- {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}
- WinFormsUI
-
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}
ICSharpCode.TextEditor
@@ -758,6 +775,11 @@
+
+ {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}
+ ICSharpCode.Core.Presentation
+ True
+
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}
ICSharpCode.Core.WinForms
@@ -774,8 +796,11 @@
{8035765F-D51F-4A0C-A746-2FD100E19419}
ICSharpCode.SharpDevelop.Widgets
- False
+ True
+
+
+
\ No newline at end of file
diff --git a/src/Main/Base/Project/Resources/GotoDialog.xfrm b/src/Main/Base/Project/Resources/GotoDialog.xfrm
deleted file mode 100644
index b4fa3b3220..0000000000
--- a/src/Main/Base/Project/Resources/GotoDialog.xfrm
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Main/Base/Project/Src/Commands/AutostartCommands.cs b/src/Main/Base/Project/Src/Commands/AutostartCommands.cs
index 913737d0dd..142e4af11f 100644
--- a/src/Main/Base/Project/Src/Commands/AutostartCommands.cs
+++ b/src/Main/Base/Project/Src/Commands/AutostartCommands.cs
@@ -21,6 +21,7 @@ namespace ICSharpCode.SharpDevelop.Commands
{
const string workbenchMemento = "WorkbenchMemento";
+ /*
class FormKeyHandler : IMessageFilter
{
const int keyPressedMessage = 0x100;
@@ -76,11 +77,10 @@ namespace ICSharpCode.SharpDevelop.Commands
return false;
}
}
+ */
public void Run(IList fileList)
{
- //WorkbenchSingleton.MainForm.Show();
-
bool didLoadSolutionOrFile = false;
NavigationService.SuspendLogging();
@@ -123,8 +123,11 @@ namespace ICSharpCode.SharpDevelop.Commands
ParserService.StartParserThread();
// finally run the workbench window ...
- Application.AddMessageFilter(new FormKeyHandler());
- Application.Run(WorkbenchSingleton.MainForm);
+ //Application.AddMessageFilter(new FormKeyHandler());
+ //Application.Run(WorkbenchSingleton.MainForm);
+ App application = new App();
+ System.Windows.Forms.Integration.WindowsFormsHost.EnableWindowsFormsInterop();
+ application.Run(WorkbenchSingleton.MainWindow);
// save the workbench memento in the ide properties
try {
diff --git a/src/Main/Base/Project/Src/Commands/BuildCommands.cs b/src/Main/Base/Project/Src/Commands/BuildCommands.cs
index 5135fa9b02..4bc1dc5e6d 100644
--- a/src/Main/Base/Project/Src/Commands/BuildCommands.cs
+++ b/src/Main/Base/Project/Src/Commands/BuildCommands.cs
@@ -7,12 +7,14 @@
using System;
using System.Collections.Generic;
-using System.Windows.Forms;
+using System.Windows;
+using System.Windows.Controls;
using ICSharpCode.Core;
-using ICSharpCode.Core.WinForms;
+using ICSharpCode.Core.Presentation;
using ICSharpCode.SharpDevelop.Debugging;
using ICSharpCode.SharpDevelop.Gui;
+using System.Windows.Input;
namespace ICSharpCode.SharpDevelop.Project.Commands
{
@@ -224,108 +226,70 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
}
}
- public class AbortBuild : ISubmenuBuilder
+ public class AbortBuild : AbstractMenuCommand
{
- public ToolStripItem[] BuildSubmenu(Codon codon, object owner)
+ public override void Run()
{
- return new[] { new MenuItem() };
+ BuildEngine.CancelGuiBuild();
}
- sealed class MenuItem : ToolStripMenuItem
- {
- public MenuItem()
- {
- WorkbenchSingleton.Workbench.ProcessCommandKey += OnProcessCommandKey;
- ResourceService.LanguageChanged += OnLanguageChanged;
- OnLanguageChanged(null, null);
- }
-
- protected override void Dispose(bool disposing)
- {
- base.Dispose(disposing);
- if (disposing) {
- WorkbenchSingleton.Workbench.ProcessCommandKey -= OnProcessCommandKey;
- ResourceService.LanguageChanged -= OnLanguageChanged;
- }
- }
-
- public override bool Enabled {
- get { return BuildEngine.IsGuiBuildRunning; }
- }
-
- void OnLanguageChanged(object sender, EventArgs e)
- {
- Text = StringParser.Parse("${res:XML.MainMenu.BuildMenu.AbortBuild}");
- ShortcutKeyDisplayString = StringParser.Parse("${res:XML.MainMenu.BuildMenu.BreakKey}");
- }
-
- void OnProcessCommandKey(object sender, KeyEventArgs e)
- {
- // ToolStripMenuItem does not support Pause/Break as shortcut key, so we handle it manually
- if (e.KeyData == Keys.Pause) {
- if (Enabled) {
- LoggingService.Debug("BREAK was pressed, aborting build.");
- PerformClick();
- e.Handled = true;
- }
- }
- }
-
- protected override void OnClick(EventArgs e)
- {
- base.OnClick(e);
- BuildEngine.CancelGuiBuild();
- }
+ public override bool IsEnabled {
+ get { return BuildEngine.IsGuiBuildRunning; }
+ set { }
}
}
- public class SetConfigurationMenuBuilder : ISubmenuBuilder
+ public class SetConfigurationMenuBuilder : IMenuItemBuilder
{
- public ToolStripItem[] BuildSubmenu(Codon codon, object owner)
+ public System.Collections.ICollection BuildItems(Codon codon, object owner)
{
if (ProjectService.OpenSolution == null)
- return new ToolStripItem[0];
+ return new MenuItem[0];
IList configurationNames = ProjectService.OpenSolution.GetConfigurationNames();
string activeConfiguration = ProjectService.OpenSolution.Preferences.ActiveConfiguration;
- ToolStripMenuItem[] items = new ToolStripMenuItem[configurationNames.Count];
+ MenuItem[] items = new MenuItem[configurationNames.Count];
for (int i = 0; i < items.Length; i++) {
- items[i] = new ToolStripMenuItem(configurationNames[i]);
+ items[i] = new MenuItem {
+ Header = configurationNames[i],
+ IsChecked = activeConfiguration == configurationNames[i]
+ };
items[i].Click += SetConfigurationItemClick;
- items[i].Checked = activeConfiguration == configurationNames[i];
}
return items;
}
void SetConfigurationItemClick(object sender, EventArgs e)
{
- ToolStripMenuItem item = (ToolStripMenuItem)sender;
- ProjectService.OpenSolution.Preferences.ActiveConfiguration = item.Text;
+ MenuItem item = (MenuItem)sender;
+ ProjectService.OpenSolution.Preferences.ActiveConfiguration = (string)item.Header;
ProjectService.OpenSolution.ApplySolutionConfigurationAndPlatformToProjects();
ProjectBrowserPad.Instance.ProjectBrowserControl.RefreshView();
}
}
- public class SetPlatformMenuBuilder : ISubmenuBuilder
+ public class SetPlatformMenuBuilder : IMenuItemBuilder
{
- public ToolStripItem[] BuildSubmenu(Codon codon, object owner)
+ public System.Collections.ICollection BuildItems(Codon codon, object owner)
{
if (ProjectService.OpenSolution == null)
- return new ToolStripItem[0];
+ return new MenuItem[0];
IList platformNames = ProjectService.OpenSolution.GetPlatformNames();
string activePlatform = ProjectService.OpenSolution.Preferences.ActivePlatform;
- ToolStripMenuItem[] items = new ToolStripMenuItem[platformNames.Count];
+ MenuItem[] items = new MenuItem[platformNames.Count];
for (int i = 0; i < items.Length; i++) {
- items[i] = new ToolStripMenuItem(platformNames[i]);
+ items[i] = new MenuItem {
+ Header = platformNames[i],
+ IsChecked = activePlatform == platformNames[i]
+ };
items[i].Click += SetPlatformItemClick;
- items[i].Checked = activePlatform == platformNames[i];
}
return items;
}
void SetPlatformItemClick(object sender, EventArgs e)
{
- ToolStripMenuItem item = (ToolStripMenuItem)sender;
- ProjectService.OpenSolution.Preferences.ActivePlatform = item.Text;
+ MenuItem item = (MenuItem)sender;
+ ProjectService.OpenSolution.Preferences.ActivePlatform = (string)item.Header;
ProjectService.OpenSolution.ApplySolutionConfigurationAndPlatformToProjects();
ProjectBrowserPad.Instance.ProjectBrowserControl.RefreshView();
}
@@ -336,7 +300,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
public override void Run()
{
using (SolutionConfigurationEditor sce = new SolutionConfigurationEditor()) {
- sce.ShowDialog();
+ sce.ShowDialog(WorkbenchSingleton.MainWin32Window);
ProjectService.SaveSolution();
ProjectService.OpenSolution.ApplySolutionConfigurationAndPlatformToProjects();
ProjectBrowserPad.Instance.ProjectBrowserControl.RefreshView();
diff --git a/src/Main/Base/Project/Src/Commands/ChooseLayoutCommand.cs b/src/Main/Base/Project/Src/Commands/ChooseLayoutCommand.cs
index 53bd42dc7e..61633d8b3b 100644
--- a/src/Main/Base/Project/Src/Commands/ChooseLayoutCommand.cs
+++ b/src/Main/Base/Project/Src/Commands/ChooseLayoutCommand.cs
@@ -8,11 +8,10 @@
using System;
using System.Collections.Generic;
using System.IO;
-using System.Windows.Forms;
using ICSharpCode.Core;
-using ICSharpCode.Core.WinForms;
using ICSharpCode.SharpDevelop.Gui;
+using System.Windows.Forms;
namespace ICSharpCode.SharpDevelop.Commands
{
@@ -42,7 +41,7 @@ namespace ICSharpCode.SharpDevelop.Commands
if (editingLayout) return;
LoggingService.Debug("ChooseLayoutCommand.Run()");
- ComboBox comboBox = ((ToolBarComboBox)Owner).ComboBox;
+ var comboBox = (System.Windows.Controls.ComboBox)Owner;
string dataPath = Path.Combine(PropertyService.DataDirectory, "resources" + Path.DirectorySeparatorChar + "layouts");
string configPath = Path.Combine(PropertyService.ConfigDirectory, "layouts");
if (!Directory.Exists(configPath)) {
@@ -117,7 +116,7 @@ namespace ICSharpCode.SharpDevelop.Commands
frm.ClientSize = new System.Drawing.Size(400, 300);
frm.StartPosition = FormStartPosition.CenterParent;
- if (frm.ShowDialog(WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (frm.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
IList oldNames = new List(CustomLayoutNames);
IList newNames = ed.GetList();
// add newly added layouts
@@ -157,8 +156,7 @@ namespace ICSharpCode.SharpDevelop.Commands
{
if (editingLayout) return;
LoggingService.Debug("ChooseLayoutCommand.LayoutChanged(object,EventArgs)");
- ToolBarComboBox toolbarItem = (ToolBarComboBox)Owner;
- ComboBox comboBox = toolbarItem.ComboBox;
+ var comboBox = (System.Windows.Controls.ComboBox)Owner;
for (int i = 0; i < comboBox.Items.Count; ++i) {
if (((LayoutConfiguration)comboBox.Items[i]).Name == LayoutConfiguration.CurrentLayoutName) {
comboBox.SelectedIndex = i;
@@ -169,23 +167,28 @@ namespace ICSharpCode.SharpDevelop.Commands
protected override void OnOwnerChanged(EventArgs e)
{
base.OnOwnerChanged(e);
- ToolBarComboBox toolbarItem = (ToolBarComboBox)Owner;
- ComboBox comboBox = toolbarItem.ComboBox;
- comboBox.Items.Clear();
- int index = 0;
- foreach (LayoutConfiguration config in LayoutConfiguration.Layouts) {
- if (LayoutConfiguration.CurrentLayoutName == config.Name) {
- index = comboBox.Items.Count;
+
+ editingLayout = true;
+ try {
+ var comboBox = (System.Windows.Controls.ComboBox)Owner;
+ comboBox.Items.Clear();
+ int index = 0;
+ foreach (LayoutConfiguration config in LayoutConfiguration.Layouts) {
+ if (LayoutConfiguration.CurrentLayoutName == config.Name) {
+ index = comboBox.Items.Count;
+ }
+ comboBox.Items.Add(config);
}
- comboBox.Items.Add(config);
+ editIndex = comboBox.Items.Count;
+
+ comboBox.Items.Add(StringParser.Parse("${res:ICSharpCode.SharpDevelop.Commands.ChooseLayoutCommand.EditItem}"));
+
+ resetIndex = comboBox.Items.Count;
+ comboBox.Items.Add(StringParser.Parse("${res:ICSharpCode.SharpDevelop.Commands.ChooseLayoutCommand.ResetToDefaultItem}"));
+ comboBox.SelectedIndex = index;
+ } finally {
+ editingLayout = false;
}
- editIndex = comboBox.Items.Count;
-
- comboBox.Items.Add(StringParser.Parse("${res:ICSharpCode.SharpDevelop.Commands.ChooseLayoutCommand.EditItem}"));
-
- resetIndex = comboBox.Items.Count;
- comboBox.Items.Add(StringParser.Parse("${res:ICSharpCode.SharpDevelop.Commands.ChooseLayoutCommand.ResetToDefaultItem}"));
- comboBox.SelectedIndex = index;
}
}
}
diff --git a/src/Main/Base/Project/Src/Commands/EditCommands.cs b/src/Main/Base/Project/Src/Commands/EditCommands.cs
index 8ff4b2906f..45b35ee7ee 100644
--- a/src/Main/Base/Project/Src/Commands/EditCommands.cs
+++ b/src/Main/Base/Project/Src/Commands/EditCommands.cs
@@ -215,8 +215,7 @@ namespace ICSharpCode.SharpDevelop.Commands
public override void Run()
{
using (WordCountDialog wcd = new WordCountDialog()) {
- wcd.Owner = WorkbenchSingleton.MainForm;
- wcd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
+ wcd.ShowDialog(WorkbenchSingleton.MainWin32Window);
}
}
}
diff --git a/src/Main/Base/Project/Src/Commands/FileCommands.cs b/src/Main/Base/Project/Src/Commands/FileCommands.cs
index cdd65133a6..5a19aa5ad6 100644
--- a/src/Main/Base/Project/Src/Commands/FileCommands.cs
+++ b/src/Main/Base/Project/Src/Commands/FileCommands.cs
@@ -44,8 +44,7 @@ namespace ICSharpCode.SharpDevelop.Commands
}
using (NewFileDialog nfd = new NewFileDialog(null)) {
- nfd.Owner = WorkbenchSingleton.MainForm;
- nfd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
+ nfd.ShowDialog(WorkbenchSingleton.MainWin32Window);
}
}
}
@@ -175,7 +174,7 @@ namespace ICSharpCode.SharpDevelop.Commands
}
}
- if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
string fileName = fdiag.FileName;
if (!FileService.CheckFileName(fileName)) {
return;
@@ -246,7 +245,7 @@ namespace ICSharpCode.SharpDevelop.Commands
fdiag.Multiselect = true;
fdiag.CheckFileExists = true;
- if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
foreach (string name in fdiag.FileNames) {
FileService.OpenFile(name);
}
@@ -258,7 +257,7 @@ namespace ICSharpCode.SharpDevelop.Commands
{
public override void Run()
{
- WorkbenchSingleton.MainForm.Close();
+ WorkbenchSingleton.MainWindow.Close();
}
}
@@ -273,7 +272,7 @@ namespace ICSharpCode.SharpDevelop.Commands
using (PrintDialog ppd = new PrintDialog()) {
ppd.Document = pdoc;
ppd.AllowSomePages = true;
- if (ppd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) { // fixed by Roger Rubin
+ if (ppd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) { // fixed by Roger Rubin
pdoc.Print();
}
}
@@ -297,10 +296,9 @@ namespace ICSharpCode.SharpDevelop.Commands
using (PrintDocument pdoc = printable.PrintDocument) {
if (pdoc != null) {
PrintPreviewDialog ppd = new PrintPreviewDialog();
- ppd.Owner = WorkbenchSingleton.MainForm;
ppd.TopMost = true;
ppd.Document = pdoc;
- ppd.Show();
+ ppd.Show(WorkbenchSingleton.MainWin32Window);
} else {
MessageService.ShowError("${res:ICSharpCode.SharpDevelop.Commands.Print.CreatePrintDocumentError}");
}
diff --git a/src/Main/Base/Project/Src/Commands/FileMenuCommands.cs b/src/Main/Base/Project/Src/Commands/FileMenuCommands.cs
index be1826f3d9..02830d25ac 100644
--- a/src/Main/Base/Project/Src/Commands/FileMenuCommands.cs
+++ b/src/Main/Base/Project/Src/Commands/FileMenuCommands.cs
@@ -17,11 +17,8 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
{
public override void Run()
{
-
-
using (NewProjectDialog npdlg = new NewProjectDialog(true)) {
- npdlg.Owner = WorkbenchSingleton.MainForm;
- npdlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
+ npdlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window);
}
}
}
@@ -35,7 +32,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
fdiag.Filter = ProjectService.GetAllProjectsFilter(this);
fdiag.Multiselect = false;
fdiag.CheckFileExists = true;
- if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
ProjectService.LoadSolutionOrProject(fdiag.FileName);
}
}
diff --git a/src/Main/Base/Project/Src/Commands/HelpCommands.cs b/src/Main/Base/Project/Src/Commands/HelpCommands.cs
index eda93b089f..771da4c68a 100644
--- a/src/Main/Base/Project/Src/Commands/HelpCommands.cs
+++ b/src/Main/Base/Project/Src/Commands/HelpCommands.cs
@@ -19,15 +19,9 @@ namespace ICSharpCode.SharpDevelop.Commands
{
public override void Run()
{
- IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;
- IContextHelpProvider helpProvider = window != null ? window.ActiveViewContent as IContextHelpProvider : null;
- foreach (PadDescriptor descriptor in WorkbenchSingleton.Workbench.PadContentCollection) {
- if (descriptor.HasFocus && descriptor.PadContent is IContextHelpProvider) {
- ((IContextHelpProvider)descriptor.PadContent).ShowHelp();
- return;
- }
- }
-
+ IContextHelpProvider helpProvider = WorkbenchSingleton.Workbench.ActiveContent as IContextHelpProvider;
+ if (helpProvider == null)
+ helpProvider = WorkbenchSingleton.Workbench.ActiveViewContent as IContextHelpProvider;
if (helpProvider != null) {
helpProvider.ShowHelp();
}
@@ -63,8 +57,7 @@ namespace ICSharpCode.SharpDevelop.Commands
public override void Run()
{
using (CommonAboutDialog ad = new CommonAboutDialog()) {
- ad.Owner = WorkbenchSingleton.MainForm;
- ad.ShowDialog(WorkbenchSingleton.MainForm);
+ ad.ShowDialog(WorkbenchSingleton.MainWin32Window);
}
}
}
diff --git a/src/Main/Base/Project/Src/Commands/MenuItemBuilders.cs b/src/Main/Base/Project/Src/Commands/MenuItemBuilders.cs
index cd10c57e33..e8e1abbbfd 100644
--- a/src/Main/Base/Project/Src/Commands/MenuItemBuilders.cs
+++ b/src/Main/Base/Project/Src/Commands/MenuItemBuilders.cs
@@ -7,10 +7,13 @@
using ICSharpCode.SharpDevelop.Util;
using System;
+using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
+using System.Threading;
using System.Windows.Forms;
using ICSharpCode.Core;
+using ICSharpCode.Core.Presentation;
using ICSharpCode.Core.WinForms;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Internal.ExternalTool;
@@ -140,147 +143,129 @@ namespace ICSharpCode.SharpDevelop.Commands
}
}
- public class RecentFilesMenuBuilder : ISubmenuBuilder
+ public class RecentFilesMenuBuilder : IMenuItemBuilder
{
- public ToolStripItem[] BuildSubmenu(Codon codon, object owner)
+ public ICollection BuildItems(Codon codon, object owner)
{
RecentOpen recentOpen = FileService.RecentOpen;
if (recentOpen.RecentFile.Count > 0) {
- MenuCommand[] items = new MenuCommand[recentOpen.RecentFile.Count];
+ var items = new System.Windows.Controls.MenuItem[recentOpen.RecentFile.Count];
for (int i = 0; i < recentOpen.RecentFile.Count; ++i) {
- string accelaratorKeyPrefix = i < 10 ? "&" + ((i + 1) % 10) + " " : "";
- items[i] = new MenuCommand(accelaratorKeyPrefix + recentOpen.RecentFile[i], new EventHandler(LoadRecentFile));
- items[i].Tag = recentOpen.RecentFile[i].ToString();
- items[i].Description = StringParser.Parse(ResourceService.GetString("Dialog.Componnents.RichMenuItem.LoadFileDescription"),
- new string[,] { {"FILE", recentOpen.RecentFile[i].ToString()} });
+ // variable inside loop, so that anonymous method refers to correct recent file
+ string recentFile = recentOpen.RecentFile[i];
+ string accelaratorKeyPrefix = i < 10 ? "_" + ((i + 1) % 10) + " " : "";
+ items[i] = new System.Windows.Controls.MenuItem() {
+ Header = accelaratorKeyPrefix + recentFile
+ };
+ items[i].Click += delegate {
+ FileService.OpenFile(recentFile);
+ };
}
return items;
+ } else {
+ return new [] { new System.Windows.Controls.MenuItem {
+ Header = StringParser.Parse("${res:Dialog.Componnents.RichMenuItem.NoRecentFilesString}"),
+ IsEnabled = false
+ } };
}
-
- MenuCommand defaultMenu = new MenuCommand("${res:Dialog.Componnents.RichMenuItem.NoRecentFilesString}");
- defaultMenu.Enabled = false;
-
- return new MenuCommand[] { defaultMenu };
- }
-
- void LoadRecentFile(object sender, EventArgs e)
- {
- MenuCommand item = (MenuCommand)sender;
-
- FileService.OpenFile(item.Tag.ToString());
}
}
- public class RecentProjectsMenuBuilder : ISubmenuBuilder
+ public class RecentProjectsMenuBuilder : IMenuItemBuilder
{
- public ToolStripItem[] BuildSubmenu(Codon codon, object owner)
+ public ICollection BuildItems(Codon codon, object owner)
{
RecentOpen recentOpen = FileService.RecentOpen;
- if (recentOpen.RecentProject.Count > 0) {
- MenuCommand[] items = new MenuCommand[recentOpen.RecentProject.Count];
+ if (recentOpen.RecentFile.Count > 0) {
+ var items = new System.Windows.Controls.MenuItem[recentOpen.RecentFile.Count];
+
for (int i = 0; i < recentOpen.RecentProject.Count; ++i) {
- string accelaratorKeyPrefix = i < 10 ? "&" + ((i + 1) % 10) + " " : "";
- items[i] = new MenuCommand(accelaratorKeyPrefix + recentOpen.RecentProject[i], new EventHandler(LoadRecentProject));
- items[i].Tag = recentOpen.RecentProject[i].ToString();
- items[i].Description = StringParser.Parse(ResourceService.GetString("Dialog.Componnents.RichMenuItem.LoadProjectDescription"),
- new string[,] { {"PROJECT", recentOpen.RecentProject[i].ToString()} });
+ // variable inside loop, so that anonymous method refers to correct recent file
+ string recentProject = recentOpen.RecentProject[i];
+ string accelaratorKeyPrefix = i < 10 ? "_" + ((i + 1) % 10) + " " : "";
+ items[i] = new System.Windows.Controls.MenuItem() {
+ Header = accelaratorKeyPrefix + recentProject
+ };
+ items[i].Click += delegate {
+ ProjectService.LoadSolution(recentProject);
+ };
}
return items;
+ } else {
+ return new [] { new System.Windows.Controls.MenuItem {
+ Header = StringParser.Parse("${res:Dialog.Componnents.RichMenuItem.NoRecentProjectsString}"),
+ IsEnabled = false
+ } };
}
-
- MenuCommand defaultMenu = new MenuCommand("${res:Dialog.Componnents.RichMenuItem.NoRecentProjectsString}");
- defaultMenu.Enabled = false;
-
- return new MenuCommand[] { defaultMenu };
- }
- void LoadRecentProject(object sender, EventArgs e)
- {
- MenuCommand item = (MenuCommand)sender;
-
- string fileName = item.Tag.ToString();
-
- FileUtility.ObservedLoad(new NamedFileOperationDelegate(ProjectService.LoadSolution), fileName);
}
}
- public class ToolMenuBuilder : ISubmenuBuilder
+ public class ToolMenuBuilder : IMenuItemBuilder
{
- public ToolStripItem[] BuildSubmenu(Codon codon, object owner)
+ public ICollection BuildItems(Codon codon, object owner)
{
- MenuCommand[] items = new MenuCommand[ToolLoader.Tool.Count];
+ var items = new System.Windows.Controls.MenuItem[ToolLoader.Tool.Count];
for (int i = 0; i < ToolLoader.Tool.Count; ++i) {
- MenuCommand item = new MenuCommand(ToolLoader.Tool[i].ToString(), new EventHandler(ToolEvt));
- item.Description = "Start tool " + String.Join(String.Empty, ToolLoader.Tool[i].ToString().Split('&'));
- items[i] = item;
+ ExternalTool tool = ToolLoader.Tool[i];
+ items[i] = new System.Windows.Controls.MenuItem {
+ Header = tool.ToString()
+ };
+ items[i].Click += delegate { RunTool(tool); };
}
return items;
}
- ///
- /// This handler gets called when a tool in the Tool menu is clicked on.
- ///
- /// The MenuCommand that sent the event.
- /// Event arguments.
- void ToolEvt(object sender, EventArgs e)
+ void RunTool(ExternalTool tool)
{
- MenuCommand item = (MenuCommand)sender;
-
- // TODO: ToolLoader.Tool should get a string indexor. Overloading List or making it a Dictionary would work.
- for (int i = 0; i < ToolLoader.Tool.Count; ++i) {
- if (item.Text != ToolLoader.Tool[i].ToString()) { continue; }
- ExternalTool tool = (ExternalTool)ToolLoader.Tool[i];
-
- // Set these to somewhat useful values in case StingParser.Parse() passes when being called on one of them.
- string command = tool.Command;
- string args = tool.Arguments;
+ // Set these to somewhat useful values in case StingParser.Parse() passes when being called on one of them.
+ string command = tool.Command;
+ string args = tool.Arguments;
- // This needs it's own try/catch because if parsing these messages fail, the catch block after
- // the second try would also throw because MessageService.ShowError() calls StringParser.Parse()
- try {
- command = StringParser.Parse(tool.Command);
- args = StringParser.Parse(tool.Arguments);
- } catch (Exception ex) {
- MessageService.ShowError("${res:XML.MainMenu.ToolMenu.ExternalTools.ExecutionFailed} '" + ex.Message);
+ // This needs it's own try/catch because if parsing these messages fail, the catch block after
+ // the second try would also throw because MessageService.ShowError() calls StringParser.Parse()
+ try {
+ command = StringParser.Parse(tool.Command);
+ args = StringParser.Parse(tool.Arguments);
+ } catch (Exception ex) {
+ MessageService.ShowError("${res:XML.MainMenu.ToolMenu.ExternalTools.ExecutionFailed} '" + ex.Message);
+ return;
+ }
+
+ if (tool.PromptForArguments) {
+ args = MessageService.ShowInputBox(tool.MenuCommand, "${res:XML.MainMenu.ToolMenu.ExternalTools.EnterArguments}", args);
+ if (args == null)
return;
- }
-
- if (tool.PromptForArguments) {
- args = MessageService.ShowInputBox(tool.MenuCommand, "${res:XML.MainMenu.ToolMenu.ExternalTools.EnterArguments}", args);
- if (args == null)
- return;
- }
-
- try {
- if (tool.UseOutputPad) {
- ProcessRunner processRunner = new ProcessRunner();
- processRunner.ProcessExited += ProcessExitEvent;
- processRunner.OutputLineReceived += process_OutputLineReceived;
- processRunner.ErrorLineReceived += process_OutputLineReceived;
- processRunner.WorkingDirectory = StringParser.Parse(tool.InitialDirectory);
- if (args == null || args.Length == 0 || args.Trim('"', ' ').Length == 0) {
- processRunner.Start(command);
- } else {
- processRunner.Start(command, args);
- }
+ }
+
+ try {
+ if (tool.UseOutputPad) {
+ ProcessRunner processRunner = new ProcessRunner();
+ processRunner.ProcessExited += ProcessExitEvent;
+ processRunner.OutputLineReceived += process_OutputLineReceived;
+ processRunner.ErrorLineReceived += process_OutputLineReceived;
+ processRunner.WorkingDirectory = StringParser.Parse(tool.InitialDirectory);
+ if (args == null || args.Length == 0 || args.Trim('"', ' ').Length == 0) {
+ processRunner.Start(command);
} else {
- ProcessStartInfo startinfo;
- if (args == null || args.Length == 0 || args.Trim('"', ' ').Length == 0) {
- startinfo = new ProcessStartInfo(command);
- } else {
- startinfo = new ProcessStartInfo(command, args);
- }
- startinfo.WorkingDirectory = StringParser.Parse(tool.InitialDirectory);
- Process process = new Process();
- process.StartInfo = startinfo;
- process.Start();
+ processRunner.Start(command, args);
}
- } catch (Exception ex) {
- MessageService.ShowError("${res:XML.MainMenu.ToolMenu.ExternalTools.ExecutionFailed} '" + command + " " + args + "'\n" + ex.Message);
+ } else {
+ ProcessStartInfo startinfo;
+ if (args == null || args.Length == 0 || args.Trim('"', ' ').Length == 0) {
+ startinfo = new ProcessStartInfo(command);
+ } else {
+ startinfo = new ProcessStartInfo(command, args);
+ }
+ startinfo.WorkingDirectory = StringParser.Parse(tool.InitialDirectory);
+ Process process = new Process();
+ process.StartInfo = startinfo;
+ process.Start();
}
- return;
+ } catch (Exception ex) {
+ MessageService.ShowError("${res:XML.MainMenu.ToolMenu.ExternalTools.ExecutionFailed} '" + command + " " + args + "'\n" + ex.Message);
}
}
@@ -300,40 +285,26 @@ namespace ICSharpCode.SharpDevelop.Commands
}
}
- public class OpenContentsMenuBuilder : ISubmenuBuilder
+ public class OpenContentsMenuBuilder : IMenuItemBuilder
{
-
- class MyMenuItem : MenuCheckBox
- {
- IWorkbenchWindow window;
-
- public MyMenuItem(IWorkbenchWindow window) : base(StringParser.Parse(window.Title))
- {
- this.window = window;
- }
-
- protected override void OnClick(EventArgs e)
- {
- base.OnClick(e);
- Checked = true;
- window.SelectWindow();
- }
- }
-
- public ToolStripItem[] BuildSubmenu(Codon codon, object owner)
+ public ICollection BuildItems(Codon codon, object owner)
{
int windowCount = WorkbenchSingleton.Workbench.WorkbenchWindowCollection.Count;
if (windowCount == 0) {
- return new ToolStripItem[] {};
+ return new object[] {};
}
- ToolStripItem[] items = new ToolStripItem[windowCount + 1];
- items[0] = new MenuSeparator(null, null);
+ var items = new object[windowCount + 1];
+ items[0] = new System.Windows.Controls.Separator();
for (int i = 0; i < windowCount; ++i) {
IWorkbenchWindow window = WorkbenchSingleton.Workbench.WorkbenchWindowCollection[i];
- MenuCheckBox item = new MyMenuItem(window);
- item.Tag = window;
- item.Checked = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow == window;
- item.Description = "Activate this window";
+ var item = new System.Windows.Controls.MenuItem() {
+ IsChecked = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow == window,
+ IsCheckable = true,
+ Header = StringParser.Parse(window.Title)
+ };
+ item.Click += delegate {
+ window.SelectWindow();
+ };
items[i + 1] = item;
}
return items;
@@ -462,7 +433,7 @@ namespace ICSharpCode.SharpDevelop.Commands
}
}
- public abstract class ViewMenuBuilder : ISubmenuBuilder
+ public abstract class ViewMenuBuilder : ISubmenuBuilder, IMenuItemBuilder
{
class MyMenuItem : MenuCommand
{
@@ -487,8 +458,29 @@ namespace ICSharpCode.SharpDevelop.Commands
base.OnClick(e);
padDescriptor.BringPadToFront();
}
+ }
+ class BringPadToFrontCommand : System.Windows.Input.ICommand
+ {
+ PadDescriptor padDescriptor;
+
+ public BringPadToFrontCommand(PadDescriptor padDescriptor)
+ {
+ this.padDescriptor = padDescriptor;
+ }
+
+ public event EventHandler CanExecuteChanged { add {} remove {} }
+
+ public void Execute(object parameter)
+ {
+ padDescriptor.BringPadToFront();
+ }
+ public bool CanExecute(object parameter)
+ {
+ return true;
+ }
}
+
protected abstract string Category {
get;
}
@@ -503,5 +495,30 @@ namespace ICSharpCode.SharpDevelop.Commands
}
return items.ToArray();
}
+
+ public ICollection BuildItems(Codon codon, object owner)
+ {
+ ArrayList list = new ArrayList();
+ foreach (PadDescriptor padContent in WorkbenchSingleton.Workbench.PadContentCollection) {
+ if (padContent.Category == Category) {
+ var item = new System.Windows.Controls.MenuItem();
+ item.Header = ICSharpCode.Core.Presentation.MenuService.ConvertLabel(StringParser.Parse(padContent.Title));
+ if (!string.IsNullOrEmpty(padContent.Icon)) {
+ item.Icon = PresentationResourceService.GetPixelSnappedImage(padContent.Icon);
+ }
+ item.Command = new BringPadToFrontCommand(padContent);
+ if (!string.IsNullOrEmpty(padContent.Shortcut)) {
+ var kg = Core.Presentation.MenuService.ParseShortcut(padContent.Shortcut);
+ WorkbenchSingleton.MainWindow.InputBindings.Add(
+ new System.Windows.Input.InputBinding(item.Command, kg)
+ );
+ item.InputGestureText = kg.GetDisplayStringForCulture(Thread.CurrentThread.CurrentUICulture);
+ }
+
+ list.Add(item);
+ }
+ }
+ return list;
+ }
}
}
diff --git a/src/Main/Base/Project/Src/Commands/ToolsCommands.cs b/src/Main/Base/Project/Src/Commands/ToolsCommands.cs
index 9319d578c8..1bd45035f3 100644
--- a/src/Main/Base/Project/Src/Commands/ToolsCommands.cs
+++ b/src/Main/Base/Project/Src/Commands/ToolsCommands.cs
@@ -16,12 +16,12 @@ namespace ICSharpCode.SharpDevelop.Commands
{
public static void ShowTabbedOptions(string dialogTitle, AddInTreeNode node)
{
- TabbedOptions o = new TabbedOptions(dialogTitle, node);
- o.Width = 450;
- o.Height = 425;
- o.FormBorderStyle = FormBorderStyle.FixedDialog;
- o.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
- o.Dispose();
+ using (TabbedOptions o = new TabbedOptions(dialogTitle, node)) {
+ o.Width = 450;
+ o.Height = 425;
+ o.FormBorderStyle = FormBorderStyle.FixedDialog;
+ o.ShowDialog(WorkbenchSingleton.MainWin32Window);
+ }
}
public override void Run()
@@ -29,8 +29,7 @@ namespace ICSharpCode.SharpDevelop.Commands
using (TreeViewOptions optionsDialog = new TreeViewOptions(AddInTree.GetTreeNode("/SharpDevelop/Dialogs/OptionsDialog"))) {
optionsDialog.FormBorderStyle = FormBorderStyle.FixedDialog;
- optionsDialog.Owner = WorkbenchSingleton.MainForm;
- optionsDialog.ShowDialog(WorkbenchSingleton.MainForm);
+ optionsDialog.ShowDialog(WorkbenchSingleton.MainWin32Window);
}
}
}
@@ -39,9 +38,8 @@ namespace ICSharpCode.SharpDevelop.Commands
{
public override void Run()
{
- ((DefaultWorkbench)WorkbenchSingleton.Workbench).FullScreen = !((DefaultWorkbench)WorkbenchSingleton.Workbench).FullScreen;
+ throw new NotImplementedException();
+// ((DefaultWorkbench)WorkbenchSingleton.Workbench).FullScreen = !((DefaultWorkbench)WorkbenchSingleton.Workbench).FullScreen;
}
}
-
-
}
diff --git a/src/Main/Base/Project/Src/Gui/AbstractPadContent.cs b/src/Main/Base/Project/Src/Gui/AbstractPadContent.cs
index 9bc0fb133b..7c2e03781c 100644
--- a/src/Main/Base/Project/Src/Gui/AbstractPadContent.cs
+++ b/src/Main/Base/Project/Src/Gui/AbstractPadContent.cs
@@ -12,22 +12,22 @@ namespace ICSharpCode.SharpDevelop.Gui
{
public abstract class AbstractPadContent : IPadContent
{
- public abstract Control Control {
+ public abstract object Content {
get;
}
- public virtual void RedrawContent()
- {
- }
-
public virtual void Dispose()
{
}
- public bool IsVisible {
+ protected bool IsVisible {
get {
- Control ctl = this.Control;
- return ctl.Visible && ctl.Width > 0 && ctl.Height > 0;
+ if (WorkbenchSingleton.Workbench == null || WorkbenchSingleton.Workbench.WorkbenchLayout == null)
+ return false;
+ PadDescriptor d = WorkbenchSingleton.Workbench.GetPad(GetType());
+ if (d == null)
+ return false;
+ return WorkbenchSingleton.Workbench.WorkbenchLayout.IsVisible(d);
}
}
}
diff --git a/src/Main/Base/Project/Src/Gui/AbstractViewContent.cs b/src/Main/Base/Project/Src/Gui/AbstractViewContent.cs
index 8293c053ec..fa97277216 100644
--- a/src/Main/Base/Project/Src/Gui/AbstractViewContent.cs
+++ b/src/Main/Base/Project/Src/Gui/AbstractViewContent.cs
@@ -45,7 +45,7 @@ namespace ICSharpCode.SharpDevelop.Gui
this.Files.Add(file);
}
- public abstract Control Control {
+ public abstract object Content {
get;
}
@@ -469,10 +469,6 @@ namespace ICSharpCode.SharpDevelop.Gui
}
#endregion
- public virtual void RedrawContent()
- {
- }
-
public virtual void Save(OpenedFile file, Stream stream)
{
}
diff --git a/src/Main/Base/Project/Src/Gui/AbstractViewContentHandlingLoadErrors.cs b/src/Main/Base/Project/Src/Gui/AbstractViewContentHandlingLoadErrors.cs
index 1656d00729..90bda7680a 100644
--- a/src/Main/Base/Project/Src/Gui/AbstractViewContentHandlingLoadErrors.cs
+++ b/src/Main/Base/Project/Src/Gui/AbstractViewContentHandlingLoadErrors.cs
@@ -7,10 +7,11 @@
using System;
using System.Collections.Generic;
-using System.Drawing;
-using System.Linq;
using System.IO;
-using System.Windows.Forms;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
namespace ICSharpCode.SharpDevelop.Gui
{
@@ -28,8 +29,8 @@ namespace ICSharpCode.SharpDevelop.Gui
///
public abstract class AbstractViewContentHandlingLoadErrors : AbstractViewContent
{
- Panel panel = new Panel();
- Control userControl;
+ ContentControl contentControl = new ContentControl();
+ object userContent;
protected AbstractViewContentHandlingLoadErrors()
{
@@ -39,21 +40,17 @@ namespace ICSharpCode.SharpDevelop.Gui
{
}
- public sealed override Control Control {
- get { return panel; }
+ public sealed override object Content {
+ get { return contentControl; }
}
- protected Control UserControl {
- get { return userControl; }
+ protected object UserContent {
+ get { return userContent; }
set {
- if (userControl != value) {
- if (errorList.Count == 0 && userControl != null) {
- panel.Controls.Remove(userControl);
- }
- userControl = value;
- userControl.Dock = DockStyle.Fill;
- if (errorList.Count == 0 && userControl != null) {
- panel.Controls.Add(userControl);
+ if (userContent != value) {
+ userContent = value;
+ if (errorList.Count == 0) {
+ contentControl.SetContent(userContent);
}
}
}
@@ -90,15 +87,11 @@ namespace ICSharpCode.SharpDevelop.Gui
{
if (errorTextBox == null) {
errorTextBox = new TextBox();
- errorTextBox.Multiline = true;
- errorTextBox.ScrollBars = ScrollBars.Both;
- errorTextBox.ReadOnly = true;
- errorTextBox.BackColor = SystemColors.Window;
- errorTextBox.Dock = DockStyle.Fill;
+ errorTextBox.IsReadOnly = true;
+ errorTextBox.Background = SystemColors.WindowBrush;
}
errorTextBox.Text = ex.ToString();
- panel.Controls.Clear();
- panel.Controls.Add(errorTextBox);
+ contentControl.SetContent(errorTextBox);
}
Dictionary errorList = new Dictionary();
@@ -110,10 +103,7 @@ namespace ICSharpCode.SharpDevelop.Gui
if (errorList.Count > 0) {
errorList.Remove(file);
if (errorList.Count == 0) {
- panel.Controls.Clear();
- if (userControl != null) {
- panel.Controls.Add(userControl);
- }
+ contentControl.SetContent(userContent);
} else {
ShowError(errorList.Values.First().exception);
}
diff --git a/src/Main/Base/Project/Src/Gui/App.xaml b/src/Main/Base/Project/Src/Gui/App.xaml
new file mode 100644
index 0000000000..233e52b438
--- /dev/null
+++ b/src/Main/Base/Project/Src/Gui/App.xaml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Main/Base/Project/Src/Gui/App.xaml.cs b/src/Main/Base/Project/Src/Gui/App.xaml.cs
new file mode 100644
index 0000000000..df05e26be4
--- /dev/null
+++ b/src/Main/Base/Project/Src/Gui/App.xaml.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Windows;
+
+namespace ICSharpCode.SharpDevelop.Gui
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ partial class App : Application
+ {
+ public App()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Main/Base/Project/Src/Gui/BrowserDisplayBinding/HtmlViewPane.cs b/src/Main/Base/Project/Src/Gui/BrowserDisplayBinding/HtmlViewPane.cs
index bbecf489ce..453ff51c3a 100644
--- a/src/Main/Base/Project/Src/Gui/BrowserDisplayBinding/HtmlViewPane.cs
+++ b/src/Main/Base/Project/Src/Gui/BrowserDisplayBinding/HtmlViewPane.cs
@@ -26,7 +26,7 @@ namespace ICSharpCode.SharpDevelop.BrowserDisplayBinding
}
}
- public override Control Control {
+ public override object Content {
get {
return htmlViewPane;
}
diff --git a/src/Main/Base/Project/Src/Gui/Components/StatusBar/SdStatusBar.cs b/src/Main/Base/Project/Src/Gui/Components/StatusBar/SdStatusBar.cs
index 74fae02c87..a5d2b27bfc 100644
--- a/src/Main/Base/Project/Src/Gui/Components/StatusBar/SdStatusBar.cs
+++ b/src/Main/Base/Project/Src/Gui/Components/StatusBar/SdStatusBar.cs
@@ -6,30 +6,33 @@
//
using System;
-using System.Drawing;
-using System.Windows.Forms;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Gui
{
- public class SdStatusBar : StatusStrip
+ public class SdStatusBar : StatusBar
{
- ToolStripProgressBar statusProgressBar = new ToolStripProgressBar();
- ToolStripStatusLabel jobNamePanel = new ToolStripStatusLabel();
+ StatusBarItem statusProgressBarItem = new StatusBarItem();
+ ProgressBar statusProgressBar = new ProgressBar();
+ StatusBarItem jobNamePanel = new StatusBarItem();
- ToolStripStatusLabel txtStatusBarPanel = new ToolStripStatusLabel();
- ToolStripStatusLabel cursorStatusBarPanel = new ToolStripStatusLabel();
- ToolStripStatusLabel modeStatusBarPanel = new ToolStripStatusLabel();
- ToolStripStatusLabel springLabel = new ToolStripStatusLabel();
+ StatusBarItem txtStatusBarPanel = new StatusBarItem();
+ StatusBarItem cursorStatusBarPanel = new StatusBarItem();
+ StatusBarItem modeStatusBarPanel = new StatusBarItem();
- public ToolStripStatusLabel CursorStatusBarPanel {
+ public StatusBarItem CursorStatusBarPanel {
get {
return cursorStatusBarPanel;
}
}
- public ToolStripStatusLabel ModeStatusBarPanel {
+ public StatusBarItem ModeStatusBarPanel {
get {
return modeStatusBarPanel;
}
@@ -37,38 +40,21 @@ namespace ICSharpCode.SharpDevelop.Gui
public SdStatusBar()
{
-
- // txtStatusBarPanel.Width = 500;
- // txtStatusBarPanel.AutoSize = StatusBarPanelAutoSize.Spring;
- // Panels.Add(txtStatusBarPanel);
- // // manager.Add(new StatusBarContributionItem("TextPanel", txtStatusBarPanel));
- //
- // statusProgressBar.Width = 200;
- // statusProgressBar.Height = 14;
- // statusProgressBar.Location = new Point(160, 6);
- // statusProgressBar.Minimum = 0;
- // statusProgressBar.Visible = false;
- // Controls.Add(statusProgressBar);
- //
- // cursorStatusBarPanel.Width = 200;
- // cursorStatusBarPanel.AutoSize = StatusBarPanelAutoSize.None;
- // cursorStatusBarPanel.Alignment = HorizontalAlignment.Left;
- // Panels.Add(cursorStatusBarPanel);
- //
- // modeStatusBarPanel.Width = 44;
- // modeStatusBarPanel.AutoSize = StatusBarPanelAutoSize.None;
- // modeStatusBarPanel.Alignment = HorizontalAlignment.Right;
- // Panels.Add(modeStatusBarPanel);
-
- springLabel.Spring = true;
- cursorStatusBarPanel.AutoSize = false;
cursorStatusBarPanel.Width = 150;
- modeStatusBarPanel.AutoSize = false;
modeStatusBarPanel.Width = 25;
- statusProgressBar.Visible = false;
- statusProgressBar.Width = 100;
+ statusProgressBarItem.Visibility = Visibility.Hidden;
+ statusProgressBarItem.Width = 100;
+
+ DockPanel.SetDock(modeStatusBarPanel, Dock.Right);
+ DockPanel.SetDock(cursorStatusBarPanel, Dock.Right);
+ DockPanel.SetDock(statusProgressBarItem, Dock.Right);
+ DockPanel.SetDock(jobNamePanel, Dock.Right);
- Items.AddRange(new ToolStripItem[] { txtStatusBarPanel, springLabel, jobNamePanel, statusProgressBar, cursorStatusBarPanel, modeStatusBarPanel });
+ Items.Add(jobNamePanel);
+ Items.Add(statusProgressBarItem);
+ Items.Add(cursorStatusBarPanel);
+ Items.Add(modeStatusBarPanel);
+ Items.Add(txtStatusBarPanel);
}
public void ShowErrorMessage(string message)
@@ -76,7 +62,7 @@ namespace ICSharpCode.SharpDevelop.Gui
SetMessage("Error : " + message);
}
- public void ShowErrorMessage(Image image, string message)
+ public void ShowErrorMessage(BitmapSource image, string message)
{
SetMessage(image, "Error : " + message);
}
@@ -90,13 +76,13 @@ namespace ICSharpCode.SharpDevelop.Gui
{
Action setMessageAction = delegate {
if (highlighted) {
- txtStatusBarPanel.BackColor = SystemColors.Highlight;
- txtStatusBarPanel.ForeColor = Color.White;
- } else if (txtStatusBarPanel.BackColor == SystemColors.Highlight) {
- txtStatusBarPanel.BackColor = SystemColors.Control;
- txtStatusBarPanel.ForeColor = SystemColors.ControlText;
+ txtStatusBarPanel.Background = SystemColors.HighlightBrush;
+ txtStatusBarPanel.Foreground = SystemColors.HighlightTextBrush;
+ } else {
+ txtStatusBarPanel.Background = SystemColors.ControlBrush;
+ txtStatusBarPanel.Foreground = SystemColors.ControlTextBrush;
}
- txtStatusBarPanel.Text = message;
+ txtStatusBarPanel.Content = message;
};
if (WorkbenchSingleton.InvokeRequired)
WorkbenchSingleton.SafeThreadAsyncCall(setMessageAction);
@@ -104,7 +90,7 @@ namespace ICSharpCode.SharpDevelop.Gui
setMessageAction();
}
- public void SetMessage(Image image, string message)
+ public void SetMessage(BitmapSource image, string message)
{
SetMessage(message);
}
@@ -128,14 +114,14 @@ namespace ICSharpCode.SharpDevelop.Gui
WorkbenchSingleton.SafeThreadAsyncCall(
delegate {
if (!statusProgressBarIsVisible) {
- statusProgressBar.Visible = true;
+ statusProgressBarItem.Visibility = Visibility.Visible;
statusProgressBarIsVisible = true;
}
if (totalWork == 0) {
- statusProgressBar.Style = ProgressBarStyle.Marquee;
+ statusProgressBar.IsIndeterminate = true;
} else {
- statusProgressBar.Style = ProgressBarStyle.Continuous;
+ statusProgressBar.IsIndeterminate = false;
if (statusProgressBar.Maximum != totalWork) {
if (statusProgressBar.Value > totalWork)
statusProgressBar.Value = 0;
@@ -146,7 +132,7 @@ namespace ICSharpCode.SharpDevelop.Gui
if (currentTaskName != taskName) {
currentTaskName = taskName;
- jobNamePanel.Text = StringParser.Parse(taskName);
+ jobNamePanel.Content = StringParser.Parse(taskName);
}
});
}
@@ -156,8 +142,8 @@ namespace ICSharpCode.SharpDevelop.Gui
WorkbenchSingleton.SafeThreadAsyncCall(
delegate {
statusProgressBarIsVisible = false;
- statusProgressBar.Visible = false;
- jobNamePanel.Text = currentTaskName = "";
+ statusProgressBarItem.Visibility = Visibility.Collapsed;
+ jobNamePanel.Content = currentTaskName = "";
});
}
}
diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/ExtractInterfaceDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/ExtractInterfaceDialog.cs
index bfee3263b0..9bfc8913f9 100644
--- a/src/Main/Base/Project/Src/Gui/Dialogs/ExtractInterfaceDialog.cs
+++ b/src/Main/Base/Project/Src/Gui/Dialogs/ExtractInterfaceDialog.cs
@@ -33,7 +33,6 @@ namespace ICSharpCode.SharpDevelop.Gui
//
InitializeComponent();
- this.Owner = WorkbenchSingleton.MainForm;
this.TopMost = true;
this.possibleInterfaceMembers = new List();
this.hasSetFilenameExplicitly = false;
@@ -70,7 +69,7 @@ namespace ICSharpCode.SharpDevelop.Gui
public ExtractInterfaceOptions ShowDialog(ExtractInterfaceOptions options)
{
InitializeFields(options);
- options.IsCancelled = (base.ShowDialog() == DialogResult.Cancel);
+ options.IsCancelled = (base.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.Cancel);
return options;
}
diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs
index 3a033bebea..ee2295ddd1 100644
--- a/src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs
+++ b/src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs
@@ -508,7 +508,7 @@ namespace ICSharpCode.SharpDevelop.Gui
customizer.Set("Template", item.Template);
customizer.Set("Creator", this);
WizardDialog wizard = new WizardDialog("File Wizard", customizer, item.Template.WizardPath);
- if (wizard.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (wizard.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
DialogResult = DialogResult.OK;
}
} else {
@@ -643,7 +643,6 @@ namespace ICSharpCode.SharpDevelop.Gui
tooltip.SetToolTip(ControlDictionary["largeIconsRadioButton"], StringParser.Parse("${res:Global.LargeIconToolTip}"));
tooltip.SetToolTip(ControlDictionary["smallIconsRadioButton"], StringParser.Parse("${res:Global.SmallIconToolTip}"));
tooltip.Active = true;
- Owner = WorkbenchSingleton.MainForm;
StartPosition = FormStartPosition.CenterParent;
Icon = null;
diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/EditTemplateDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/EditTemplateDialog.cs
index 9efc62846c..7c7917aae6 100644
--- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/EditTemplateDialog.cs
+++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/EditTemplateDialog.cs
@@ -45,7 +45,6 @@ namespace ICSharpCode.SharpDevelop.Gui
ControlDictionary["okButton"].Click += new EventHandler(AcceptEvent);
- Owner = WorkbenchSingleton.MainForm;
Icon = null;
}
}
diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs
index c703d1cb1a..c44087c9b5 100644
--- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs
+++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ExternalToolPanel.cs
@@ -105,7 +105,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
fdiag.CheckFileExists = true;
fdiag.Filter = StringParser.Parse(ExecutableFilesFilter);
- if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
ControlDictionary["commandTextBox"].Text = fdiag.FileName;
}
}
diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs
index 5fef875377..dfa1574691 100644
--- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs
+++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/AbstractBuildOptions.cs
@@ -265,7 +265,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
void OnConvertProjectToMSBuild35ButtonClick(object sender, EventArgs e)
{
using (ConvertToMSBuild35Dialog dlg = new ConvertToMSBuild35Dialog(project.Language + " newversion")) {
- if (dlg.ShowDialog() == DialogResult.OK) {
+ if (dlg.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
if (dlg.ConvertAllProjects) {
foreach (IProject p in ProjectService.OpenSolution.Projects) {
MSBuildBasedProject msbp = p as MSBuildBasedProject;
diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.cs b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.cs
index 2cccaddfd5..9cb7fed80d 100644
--- a/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.cs
+++ b/src/Main/Base/Project/Src/Gui/Dialogs/OptionPanels/ProjectOptions/Signing.cs
@@ -104,7 +104,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
if (File.Exists(CreateKeyForm.StrongNameTool)) {
using (CreateKeyForm createKey = new CreateKeyForm(baseDirectory)) {
createKey.KeyFile = project.Name;
- if (createKey.ShowDialog(WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (createKey.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
keyFile.Text = createKey.KeyFile;
return;
}
diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/ProjectOptionsView.cs b/src/Main/Base/Project/Src/Gui/Dialogs/ProjectOptionsView.cs
index 6f1f1a5fe8..5a348e9e13 100644
--- a/src/Main/Base/Project/Src/Gui/Dialogs/ProjectOptionsView.cs
+++ b/src/Main/Base/Project/Src/Gui/Dialogs/ProjectOptionsView.cs
@@ -30,7 +30,7 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
}
}
- public override Control Control {
+ public override object Content {
get {
return tabControl;
}
diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AddWebReferenceDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AddWebReferenceDialog.cs
index 54dba29c28..b44d99b646 100644
--- a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AddWebReferenceDialog.cs
+++ b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AddWebReferenceDialog.cs
@@ -732,7 +732,7 @@ namespace ICSharpCode.SharpDevelop.Gui
StartDiscovery(uri, credential);
} else {
using (UserCredentialsDialog credentialsForm = new UserCredentialsDialog(uri.ToString(), authenticationType)) {
- if (DialogResult.OK == credentialsForm.ShowDialog()) {
+ if (DialogResult.OK == credentialsForm.ShowDialog(WorkbenchSingleton.MainWin32Window)) {
StartDiscovery(uri, credentialsForm.Credential);
}
}
diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs
index c65f28bf2f..929ca7f9fc 100644
--- a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs
+++ b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs
@@ -40,7 +40,7 @@ namespace ICSharpCode.SharpDevelop.Gui
fdiag.Multiselect = true;
fdiag.CheckFileExists = true;
- if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
foreach (string file in fdiag.FileNames) {
ReferenceProjectItem assemblyReference = new ReferenceProjectItem(selectDialog.ConfigureProject);
assemblyReference.Include = Path.GetFileNameWithoutExtension(file);
diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/TabbedOptions.cs b/src/Main/Base/Project/Src/Gui/Dialogs/TabbedOptions.cs
index 5cfdde0635..c82b4eb9f3 100644
--- a/src/Main/Base/Project/Src/Gui/Dialogs/TabbedOptions.cs
+++ b/src/Main/Base/Project/Src/Gui/Dialogs/TabbedOptions.cs
@@ -60,7 +60,6 @@ namespace ICSharpCode.SharpDevelop.Gui
this.Text = dialogName;
ControlDictionary["okButton"].Click += new EventHandler(AcceptEvent);
Icon = null;
- Owner = WorkbenchSingleton.MainForm;
AddOptionPanels(node.BuildChildItems(this));
}
diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/TreeViewOptions.cs b/src/Main/Base/Project/Src/Gui/Dialogs/TreeViewOptions.cs
index 6bd604e3d4..efc8261c71 100644
--- a/src/Main/Base/Project/Src/Gui/Dialogs/TreeViewOptions.cs
+++ b/src/Main/Base/Project/Src/Gui/Dialogs/TreeViewOptions.cs
@@ -215,8 +215,6 @@ namespace ICSharpCode.SharpDevelop.Gui
protected void InitializeComponent()
{
- Owner = WorkbenchSingleton.MainForm;
-
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.TreeViewOptionsDialog.xfrm"));
this.optionsPanelLabel = new GradientHeaderPanel();
diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs
index 5d4f63bc80..3cd509486e 100644
--- a/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs
+++ b/src/Main/Base/Project/Src/Gui/Dialogs/WordCountDialog.cs
@@ -231,7 +231,6 @@ namespace ICSharpCode.SharpDevelop.Gui
((ListView)ControlDictionary["resultListView"]).ColumnClick += new ColumnClickEventHandler(SortEvt);
Icon = IconService.GetIcon("Icons.16x16.FindIcon");
- Owner = WorkbenchSingleton.MainForm;
((ComboBox)ControlDictionary["locationComboBox"]).Items.Add(StringParser.Parse("${res:Global.Location.currentfile}"));
((ComboBox)ControlDictionary["locationComboBox"]).Items.Add(StringParser.Parse("${res:Global.Location.allopenfiles}"));
diff --git a/src/Main/Base/Project/Src/Gui/FormLocationHelper.cs b/src/Main/Base/Project/Src/Gui/FormLocationHelper.cs
index 31270a351c..9e7cc41d76 100644
--- a/src/Main/Base/Project/Src/Gui/FormLocationHelper.cs
+++ b/src/Main/Base/Project/Src/Gui/FormLocationHelper.cs
@@ -37,7 +37,6 @@ namespace ICSharpCode.SharpDevelop.Gui
}
};
}
-
static Rectangle Validate(Rectangle bounds)
{
// Check if form is outside the screen and get it back if necessary.
@@ -66,7 +65,10 @@ namespace ICSharpCode.SharpDevelop.Gui
static Point GetDefaultLocation(Form form)
{
- Rectangle parent = WorkbenchSingleton.MainForm.Bounds;
+ var mainWindow = WorkbenchSingleton.MainWindow;
+ Rectangle parent = new Rectangle(
+ (int)mainWindow.Left, (int)mainWindow.Top, (int)mainWindow.Width, (int)mainWindow.Height
+ );
Size size = form.Size;
return new Point(parent.Left + (parent.Width - size.Width) / 2,
parent.Top + (parent.Height - size.Height) / 2);
diff --git a/src/Main/Base/Project/Src/Gui/IPadContent.cs b/src/Main/Base/Project/Src/Gui/IPadContent.cs
index 81acb12dd6..d30c560637 100644
--- a/src/Main/Base/Project/Src/Gui/IPadContent.cs
+++ b/src/Main/Base/Project/Src/Gui/IPadContent.cs
@@ -17,16 +17,11 @@ namespace ICSharpCode.SharpDevelop.Gui
public interface IPadContent : IDisposable
{
///
- /// Returns the Windows.Control for this pad.
+ /// This is the UI element for the view.
+ /// You can use both Windows.Forms and WPF controls.
///
- Control Control {
+ object Content {
get;
}
-
- ///
- /// Re-initializes all components of the pad. Don't call unless
- /// you know what you do.
- ///
- void RedrawContent();
}
}
diff --git a/src/Main/Base/Project/Src/Gui/IViewContent.cs b/src/Main/Base/Project/Src/Gui/IViewContent.cs
index 62c88fa803..975cdff241 100644
--- a/src/Main/Base/Project/Src/Gui/IViewContent.cs
+++ b/src/Main/Base/Project/Src/Gui/IViewContent.cs
@@ -38,9 +38,10 @@ namespace ICSharpCode.SharpDevelop.Gui
public interface IViewContent : IDisposable, ICanBeDirty
{
///
- /// This is the Windows.Forms control for the view.
+ /// This is the UI element for the view.
+ /// You can use both Windows.Forms and WPF controls.
///
- Control Control {
+ object Content {
get;
}
@@ -65,13 +66,6 @@ namespace ICSharpCode.SharpDevelop.Gui
get;
}
- ///
- /// Reinitializes the content. (Re-initializes all add-in tree stuff)
- /// and redraws the content.
- /// Called on certain actions like changing the UI language.
- ///
- void RedrawContent();
-
///
/// The title of the view content. This normally is the title of the primary file being edited.
///
diff --git a/src/Main/Base/Project/Src/Gui/IWorkbench.cs b/src/Main/Base/Project/Src/Gui/IWorkbench.cs
index 74591e08b0..6ed9da80fb 100644
--- a/src/Main/Base/Project/Src/Gui/IWorkbench.cs
+++ b/src/Main/Base/Project/Src/Gui/IWorkbench.cs
@@ -7,7 +7,10 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
+using System.Windows;
using System.Windows.Forms;
+
using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Gui
@@ -18,11 +21,19 @@ namespace ICSharpCode.SharpDevelop.Gui
public interface IWorkbench : IMementoCapable
{
///
- /// Gets the main form for the work bench.
+ /// The main window as IWin32Window.
///
- Form MainForm {
- get;
- }
+ IWin32Window MainWin32Window { get; }
+
+ ///
+ /// Object for executing methods on the main thread.
+ ///
+ ISynchronizeInvoke SynchronizingObject { get; }
+
+ ///
+ /// The main window.
+ ///
+ Window MainWindow { get; }
///
/// The title shown in the title bar.
@@ -129,11 +140,6 @@ namespace ICSharpCode.SharpDevelop.Gui
///
PadDescriptor GetPad(Type type);
- ///
- /// Closes the IViewContent content when content is open.
- ///
- void CloseContent(IViewContent content);
-
///
/// Closes all views inside the workbench.
///
@@ -165,10 +171,5 @@ namespace ICSharpCode.SharpDevelop.Gui
/// Is called, when a workbench view was closed
///
event ViewContentEventHandler ViewClosed;
-
- ///
- /// Is called when a key is pressed. Can be used to intercept command keys.
- ///
- event System.Windows.Forms.KeyEventHandler ProcessCommandKey;
}
}
diff --git a/src/Main/Base/Project/Src/Gui/IWorkbenchLayout.cs b/src/Main/Base/Project/Src/Gui/IWorkbenchLayout.cs
index 40e3b8334a..1f8106a676 100644
--- a/src/Main/Base/Project/Src/Gui/IWorkbenchLayout.cs
+++ b/src/Main/Base/Project/Src/Gui/IWorkbenchLayout.cs
@@ -6,6 +6,7 @@
//
using System;
+using System.Collections.Generic;
namespace ICSharpCode.SharpDevelop.Gui
{
@@ -24,6 +25,13 @@ namespace ICSharpCode.SharpDevelop.Gui
get;
}
+ ///
+ /// Gets the open workbench windows.
+ ///
+ IList WorkbenchWindows {
+ get;
+ }
+
///
/// The active content. This can be either a IViewContent or a IPadContent, depending on
/// where the focus currently is.
@@ -32,6 +40,8 @@ namespace ICSharpCode.SharpDevelop.Gui
get;
}
+ event EventHandler ActiveContentChanged;
+
///
/// Attaches this layout manager to a workbench object.
///
@@ -52,7 +62,6 @@ namespace ICSharpCode.SharpDevelop.Gui
/// bring it to foreground)
///
void ActivatePad(PadDescriptor content);
- void ActivatePad(string fullyQualifiedTypeName);
///
/// Hides a .
@@ -69,11 +78,6 @@ namespace ICSharpCode.SharpDevelop.Gui
///
bool IsVisible(PadDescriptor padContent);
- ///
- /// Re-initializes all components of the layout manager.
- ///
- void RedrawAllComponents();
-
///
/// Shows a new .
///
@@ -82,11 +86,5 @@ namespace ICSharpCode.SharpDevelop.Gui
void LoadConfiguration();
void StoreConfiguration();
-
- ///
- /// Is called, when the workbench window which the user has into
- /// the foreground (e.g. editable) changed to a new one.
- ///
- event EventHandler ActiveWorkbenchWindowChanged;
}
}
diff --git a/src/Main/Base/Project/Src/Gui/IWorkbenchWindow.cs b/src/Main/Base/Project/Src/Gui/IWorkbenchWindow.cs
index 50753c595b..2e1b7a4d62 100644
--- a/src/Main/Base/Project/Src/Gui/IWorkbenchWindow.cs
+++ b/src/Main/Base/Project/Src/Gui/IWorkbenchWindow.cs
@@ -41,7 +41,7 @@ namespace ICSharpCode.SharpDevelop.Gui
///
/// Gets/Sets the icon of the view content.
///
- System.Drawing.Icon Icon {
+ System.Windows.Media.Imaging.BitmapSource Icon {
get;
set;
}
@@ -78,36 +78,9 @@ namespace ICSharpCode.SharpDevelop.Gui
void RedrawContent();
- ///
- /// Used internally:
- /// This method is called by the workbench to notify the window that is was selected.
- ///
- void OnWindowSelected(EventArgs e);
-
- ///
- /// Used internally:
- /// This method is called by the workbench to notify the window that is was deselected.
- ///
- void OnWindowDeselected(EventArgs e);
-
- ///
- /// Is called when the window is selected.
- ///
- event EventHandler WindowSelected;
-
- ///
- /// Is called when the window is deselected.
- ///
- event EventHandler WindowDeselected;
-
///
/// Is called when the title of this window has changed.
///
event EventHandler TitleChanged;
-
- ///
- /// Is called after the window closes.
- ///
- event EventHandler CloseEvent;
}
}
diff --git a/src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/ClassBrowser.cs b/src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/ClassBrowser.cs
index 405e641af6..2e3c9bce82 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/ClassBrowser.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/ClassBrowser/ClassBrowser.cs
@@ -59,7 +59,7 @@ namespace ICSharpCode.SharpDevelop.Gui.ClassBrowser
}
}
- public override Control Control {
+ public override object Content {
get {
return contentPanel;
}
diff --git a/src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs b/src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs
index 6482048b76..2ba79dad79 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs
@@ -92,7 +92,7 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
- public override Control Control {
+ public override object Content {
get {
return myPanel;
}
@@ -160,14 +160,6 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
- public override void RedrawContent()
- {
-// messageCategory.Items.Clear();
-// foreach (MessageViewCategory category in messageCategories) {
-// messageCategory.Items.Add(StringParser.Parse(category.DisplayCategory));
-// }
- }
-
#region Category handling
///
/// Adds a category to the compiler message view. This method is thread-safe.
@@ -289,9 +281,9 @@ namespace ICSharpCode.SharpDevelop.Gui
break;
}
}
- if (!this.IsVisible) {
- ActivateThisPad();
- }
+ //if (!this.IsVisible) {
+ // ActivateThisPad();
+ //}
}
void SelectCategory(string categoryName, string text)
@@ -319,14 +311,6 @@ namespace ICSharpCode.SharpDevelop.Gui
}
#endregion
- ///
- /// Makes this pad visible (usually BEFORE build or debug events)
- ///
- void ActivateThisPad()
- {
- WorkbenchSingleton.Workbench.WorkbenchLayout.ActivatePad(this.GetType().FullName);
- }
-
///
/// Occurs when the mouse pointer is over the control and a
/// mouse button is pressed.
diff --git a/src/Main/Base/Project/Src/Gui/Pads/DefinitionViewPad.cs b/src/Main/Base/Project/Src/Gui/Pads/DefinitionViewPad.cs
index 1b4427b575..b46945d0f0 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/DefinitionViewPad.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/DefinitionViewPad.cs
@@ -25,7 +25,7 @@ namespace ICSharpCode.SharpDevelop.Gui
///
/// The representing the pad
///
- public override Control Control {
+ public override object Content {
get {
return ctl;
}
@@ -73,7 +73,6 @@ namespace ICSharpCode.SharpDevelop.Gui
void UpdateTick(ParserUpdateStepEventArgs e)
{
- if (!this.IsVisible) return;
LoggingService.Debug("DefinitionViewPad.Update");
ResolveResult res = ResolveAtCaret(e);
@@ -112,7 +111,7 @@ namespace ICSharpCode.SharpDevelop.Gui
return ParserService.Resolve(expr, caret.Line + 1, caret.Column + 1, fileName, content);
} catch (Exception ex) {
disableDefinitionView = true;
- this.Control.Visible = false;
+ ctl.Visible = false;
MessageService.ShowError(ex, "Error resolving at " + (caret.Line + 1) + "/" + (caret.Column + 1)
+ ". DefinitionViewPad is disabled until you restart SharpDevelop.");
return null;
@@ -154,13 +153,5 @@ namespace ICSharpCode.SharpDevelop.Gui
ctl.LoadFile(fileName, true, true); // TODO: get AutoDetectEncoding from settings
}
}
-
- ///
- /// Refreshes the pad
- ///
- public override void RedrawContent()
- {
- // Refresh the whole pad control here, renew all resource strings whatever.
- }
}
}
diff --git a/src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorListPad.cs b/src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorListPad.cs
index 4b16bee646..3a0bb93b57 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorListPad.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorListPad.cs
@@ -70,7 +70,7 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
- public override Control Control {
+ public override object Content {
get {
return contentPanel;
}
@@ -81,6 +81,7 @@ namespace ICSharpCode.SharpDevelop.Gui
instance = this;
RedrawContent();
+ ResourceService.LanguageChanged += delegate { RedrawContent(); };
TaskService.Cleared += new EventHandler(TaskServiceCleared);
TaskService.Added += new TaskEventHandler(TaskServiceAdded);
@@ -106,7 +107,7 @@ namespace ICSharpCode.SharpDevelop.Gui
InternalShowResults();
}
- public override void RedrawContent()
+ void RedrawContent()
{
taskView.RefreshColumnNames();
}
@@ -130,7 +131,7 @@ namespace ICSharpCode.SharpDevelop.Gui
void ProjectServiceEndBuild(object sender, EventArgs e)
{
if (TaskService.TaskCount > 0 && ShowAfterBuild) {
- WorkbenchSingleton.Workbench.WorkbenchLayout.ActivatePad(this.GetType().FullName);
+ WorkbenchSingleton.Workbench.GetPad(typeof(ErrorListPad)).BringPadToFront();
}
UpdateToolstripStatus();
}
diff --git a/src/Main/Base/Project/Src/Gui/Pads/FileScout.cs b/src/Main/Base/Project/Src/Gui/Pads/FileScout.cs
index deba230b32..cb8102259e 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/FileScout.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/FileScout.cs
@@ -325,7 +325,7 @@ namespace ICSharpCode.SharpDevelop.Gui
public class FileScout : UserControl, IPadContent
{
- public Control Control {
+ public object Content {
get {
return this;
}
diff --git a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/DefaultFileNodeCommands.cs b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/DefaultFileNodeCommands.cs
index 2fd629fc78..a8e13bb029 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/DefaultFileNodeCommands.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/DefaultFileNodeCommands.cs
@@ -76,7 +76,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
var codons = DisplayBindingService.GetCodonsPerFileName(fileName);
int defaultCodonIndex = codons.IndexOf(DisplayBindingService.GetDefaultCodonPerFileName(fileName));
using (OpenWithDialog dlg = new OpenWithDialog(codons, defaultCodonIndex, Path.GetExtension(fileName))) {
- if (dlg.ShowDialog(WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (dlg.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
FileUtility.ObservedLoad(new FileService.LoadFileWrapper(dlg.SelectedBinding.Binding).Invoke, fileName);
}
}
diff --git a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/FolderNodeCommands.cs b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/FolderNodeCommands.cs
index f0a6bd28cc..42cb2180d0 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/FolderNodeCommands.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/FolderNodeCommands.cs
@@ -190,7 +190,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
fdiag.CheckFileExists = true;
fdiag.Title = StringParser.Parse("${res:ProjectComponent.ContextMenu.AddExistingFiles}");
- if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
List> fileNames = new List>(fdiag.FileNames.Length);
foreach (string fileName in fdiag.FileNames) {
fileNames.Add(new KeyValuePair(fileName, ""));
@@ -298,7 +298,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
List addedItems = new List();
using (NewFileDialog nfd = new NewFileDialog(node.Directory)) {
- if (nfd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (nfd.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
bool additionalProperties = false;
foreach (KeyValuePair createdFile in nfd.CreatedFiles) {
FileProjectItem item = node.AddNewFile(createdFile.Key);
diff --git a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs
index e017887b9e..88a04fbf05 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/ReferenceFolderNodeCommands.cs
@@ -26,7 +26,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
}
LoggingService.Info("Show add reference dialog for " + project.FileName);
using (SelectReferenceDialog selDialog = new SelectReferenceDialog(project)) {
- if (selDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (selDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
foreach (ReferenceProjectItem reference in selDialog.ReferenceInformations) {
ProjectService.AddProjectItem(project, reference);
}
@@ -90,7 +90,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
} catch (WebException ex) {
if (protocol.IsAuthenticationRequired) {
using (UserCredentialsDialog dialog = new UserCredentialsDialog(url, protocol.GetAuthenticationHeader().AuthenticationType)) {
- if (dialog.ShowDialog() == DialogResult.OK) {
+ if (dialog.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
credential = dialog.Credential;
} else {
retry = false;
@@ -113,7 +113,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
if (node != null && node.Project != null) {
using (AddWebReferenceDialog refDialog = new AddWebReferenceDialog(node.Project)) {
refDialog.NamespacePrefix = node.Project.RootNamespace;
- if (refDialog.ShowDialog() == DialogResult.OK) {
+ if (refDialog.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
// Do not overwrite existing web references.
refDialog.WebReference.Name = WebReference.GetReferenceName(refDialog.WebReference.WebReferencesDirectory, refDialog.WebReference.Name);
refDialog.WebReference.Save();
diff --git a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/SolutionNodeCommands.cs b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/SolutionNodeCommands.cs
index dfb26c6380..9de5db0006 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/SolutionNodeCommands.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/Commands/SolutionNodeCommands.cs
@@ -25,7 +25,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
npdlg.InitialProjectLocationDirectory = GetInitialDirectorySuggestion(solutionFolderNode);
// show the dialog to request project type and name
- if (npdlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (npdlg.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
if (npdlg.NewProjectLocation.Length == 0) {
MessageService.ShowError("No project has been created, there is nothing to add.");
return;
@@ -92,7 +92,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
fdiag.Multiselect = true;
fdiag.CheckFileExists = true;
fdiag.InitialDirectory = AddNewProjectToSolution.GetInitialDirectorySuggestion(solutionFolderNode);
- if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
foreach (string fileName in fdiag.FileNames) {
AddProject(solutionFolderNode, fileName);
}
@@ -115,7 +115,7 @@ namespace ICSharpCode.SharpDevelop.Project.Commands
fdiag.Filter = StringParser.Parse("${res:SharpDevelop.FileFilter.AllFiles}|*.*");
fdiag.Multiselect = true;
fdiag.CheckFileExists = true;
- if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (fdiag.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
foreach (string fileName in fdiag.FileNames) {
solutionFolderNode.AddItem(fileName);
}
diff --git a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserPad.cs b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserPad.cs
index 75d32f5d70..91d4452c30 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserPad.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserPad.cs
@@ -63,7 +63,7 @@ namespace ICSharpCode.SharpDevelop.Project
}
}
- public override Control Control {
+ public override object Content {
get {
return projectBrowserPanel;
}
diff --git a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/AbstractProjectBrowserTreeNode.cs b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/AbstractProjectBrowserTreeNode.cs
index 1b5d32cd43..6101989d6b 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/AbstractProjectBrowserTreeNode.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/TreeNodes/AbstractProjectBrowserTreeNode.cs
@@ -92,7 +92,7 @@ namespace ICSharpCode.SharpDevelop.Project
public virtual void ShowProperties()
{
- WorkbenchSingleton.Workbench.WorkbenchLayout.ActivatePad(typeof(PropertyPad).FullName);
+ WorkbenchSingleton.Workbench.GetPad(typeof(PropertyPad)).BringPadToFront();
}
public static bool IsSomewhereBelow(string path, ProjectItem item)
diff --git a/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyContainer.cs b/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyContainer.cs
index 4002df235a..0c08b3f4df 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyContainer.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyContainer.cs
@@ -105,13 +105,13 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
- Control propertyGridReplacementControl;
+ object propertyGridReplacementContent;
- public Control PropertyGridReplacementControl {
- get { return propertyGridReplacementControl; }
+ public object PropertyGridReplacementContent {
+ get { return propertyGridReplacementContent; }
set {
- propertyGridReplacementControl = value;
- PropertyPad.UpdatePropertyGridReplacementControl(this);
+ propertyGridReplacementContent = value;
+ PropertyPad.UpdatePropertyGridReplacementContent(this);
}
}
@@ -125,7 +125,7 @@ namespace ICSharpCode.SharpDevelop.Gui
Host = null;
SelectableObjects = null;
SelectedObject = null;
- PropertyGridReplacementControl = null;
+ PropertyGridReplacementContent = null;
}
}
}
diff --git a/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs b/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs
index 72415e86ec..39622ad8c3 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/PropertyPad/PropertyPad.cs
@@ -43,7 +43,7 @@ namespace ICSharpCode.SharpDevelop.Gui
UpdateHostIfActive(pc);
UpdateSelectedObjectIfActive(pc);
UpdateSelectableIfActive(pc);
- UpdatePropertyGridReplacementControl(pc);
+ UpdatePropertyGridReplacementContent(pc);
}
internal static void UpdateSelectedObjectIfActive(PropertyContainer container)
@@ -81,30 +81,23 @@ namespace ICSharpCode.SharpDevelop.Gui
instance.SetSelectableObjects(container.SelectableObjects);
}
- internal static void UpdatePropertyGridReplacementControl(PropertyContainer container)
+ internal static void UpdatePropertyGridReplacementContent(PropertyContainer container)
{
if (instance == null) return;
if (instance.activeContainer != container)
return;
LoggingService.Debug("UpdatePropertyGridReplacementControl");
- if (container.PropertyGridReplacementControl != null) {
- if (!instance.panel.Controls.Contains(container.PropertyGridReplacementControl)) {
- instance.panel.Controls.Clear();
- container.PropertyGridReplacementControl.Dock = DockStyle.Fill;
- instance.panel.Controls.Add(container.PropertyGridReplacementControl);
- }
+ if (container.PropertyGridReplacementContent != null) {
+ instance.contentControl.SetContent(container.PropertyGridReplacementContent);
} else {
- if (!instance.panel.Controls.Contains(instance.grid)) {
- instance.panel.Controls.Clear();
- instance.panel.Controls.Add(instance.grid);
- instance.panel.Controls.Add(instance.comboBox);
- }
+ instance.contentControl.SetContent(instance.panel);
}
}
- Panel panel;
- ComboBox comboBox;
- PropertyGrid grid;
+ System.Windows.Controls.ContentControl contentControl;
+ Panel panel;
+ ComboBox comboBox;
+ PropertyGrid grid;
IDesignerHost host;
///
@@ -123,9 +116,9 @@ namespace ICSharpCode.SharpDevelop.Gui
public static event EventHandler SelectedObjectChanged;
public static event SelectedGridItemChangedEventHandler SelectedGridItemChanged;
- public override Control Control {
+ public override object Content {
get {
- return panel;
+ return contentControl;
}
}
@@ -157,6 +150,7 @@ namespace ICSharpCode.SharpDevelop.Gui
public PropertyPad()
{
instance = this;
+ contentControl = new System.Windows.Controls.ContentControl();
panel = new Panel();
grid = new PropertyGrid();
@@ -184,6 +178,7 @@ namespace ICSharpCode.SharpDevelop.Gui
panel.Controls.Add(grid);
panel.Controls.Add(comboBox);
+ contentControl.SetContent(panel);
ProjectService.SolutionClosed += SolutionClosedEvent;
@@ -293,11 +288,6 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
- public override void RedrawContent()
- {
- grid.Refresh();
- }
-
public override void Dispose()
{
base.Dispose();
diff --git a/src/Main/Base/Project/Src/Gui/Pads/SearchResultPad/SearchResultPanel.cs b/src/Main/Base/Project/Src/Gui/Pads/SearchResultPad/SearchResultPanel.cs
index 9b890dd1c4..a2d8404d41 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/SearchResultPad/SearchResultPanel.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/SearchResultPad/SearchResultPanel.cs
@@ -50,7 +50,7 @@ namespace SearchAndReplace
string curPattern = null;
IList curResults = null;
- public override Control Control {
+ public override object Content {
get {
return myPanel;
}
diff --git a/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs b/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs
index ae5ffaafa0..d030f3fca3 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs
@@ -46,7 +46,7 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
- public override Control Control {
+ public override object Content {
get {
return contentPanel;
}
@@ -62,6 +62,7 @@ namespace ICSharpCode.SharpDevelop.Gui
this.displayedTokens = new Dictionary();
RedrawContent();
+ ResourceService.LanguageChanged += delegate { RedrawContent(); };
InitializeToolStrip();
@@ -75,8 +76,8 @@ namespace ICSharpCode.SharpDevelop.Gui
if (WorkbenchSingleton.Workbench.ActiveViewContent != null) {
UpdateItems();
- if (WorkbenchSingleton.Workbench.ActiveViewContent.Control is SharpDevelopTextAreaControl) {
- SharpDevelopTextAreaControl ctrl = WorkbenchSingleton.Workbench.ActiveViewContent.Control as SharpDevelopTextAreaControl;
+ if (WorkbenchSingleton.Workbench.ActiveViewContent.Content is SharpDevelopTextAreaControl) {
+ SharpDevelopTextAreaControl ctrl = WorkbenchSingleton.Workbench.ActiveViewContent.Content as SharpDevelopTextAreaControl;
ctrl.ActiveTextAreaControl.Caret.PositionChanged += new EventHandler(CaretPositionChanged);
}
@@ -95,8 +96,8 @@ namespace ICSharpCode.SharpDevelop.Gui
if (isInitialized)
UpdateItems();
- if (WorkbenchSingleton.Workbench.ActiveViewContent.Control is SharpDevelopTextAreaControl) {
- SharpDevelopTextAreaControl ctrl = WorkbenchSingleton.Workbench.ActiveViewContent.Control as SharpDevelopTextAreaControl;
+ if (WorkbenchSingleton.Workbench.ActiveViewContent.Content is SharpDevelopTextAreaControl) {
+ SharpDevelopTextAreaControl ctrl = WorkbenchSingleton.Workbench.ActiveViewContent.Content as SharpDevelopTextAreaControl;
ctrl.ActiveTextAreaControl.Caret.PositionChanged += new EventHandler(CaretPositionChanged);
}
@@ -150,7 +151,7 @@ namespace ICSharpCode.SharpDevelop.Gui
contentPanel.Controls.Add(toolStrip);
}
- public override void RedrawContent()
+ void RedrawContent()
{
taskView.RefreshColumnNames();
}
@@ -210,8 +211,8 @@ namespace ICSharpCode.SharpDevelop.Gui
ParseInformation parseInfo = ParserService.GetParseInformation(WorkbenchSingleton.Workbench.ActiveViewContent.PrimaryFileName);
if (parseInfo != null) {
- if (WorkbenchSingleton.Workbench.ActiveViewContent.Control is ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.SharpDevelopTextAreaControl)
- {SharpDevelopTextAreaControl ctrl = WorkbenchSingleton.Workbench.ActiveViewContent.Control
+ if (WorkbenchSingleton.Workbench.ActiveViewContent.Content is ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.SharpDevelopTextAreaControl)
+ {SharpDevelopTextAreaControl ctrl = WorkbenchSingleton.Workbench.ActiveViewContent.Content
as SharpDevelopTextAreaControl;
IClass c = parseInfo.MostRecentCompilationUnit.GetInnermostClass(ctrl.ActiveTextAreaControl.Caret.Line, ctrl.ActiveTextAreaControl.Caret.Column);
if (c != null) return c;
diff --git a/src/Main/Base/Project/Src/Gui/Pads/ToolsPad.cs b/src/Main/Base/Project/Src/Gui/Pads/ToolsPad.cs
index b56c1ab812..0dd691ca6d 100644
--- a/src/Main/Base/Project/Src/Gui/Pads/ToolsPad.cs
+++ b/src/Main/Base/Project/Src/Gui/Pads/ToolsPad.cs
@@ -6,7 +6,7 @@
//
using System;
-using System.Windows.Forms;
+using System.Windows.Controls;
using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Gui
@@ -19,7 +19,7 @@ namespace ICSharpCode.SharpDevelop.Gui
///
/// Gets the control to display in the tool box.
///
- Control ToolsControl { get; }
+ object ToolsContent { get; }
}
///
@@ -27,44 +27,27 @@ namespace ICSharpCode.SharpDevelop.Gui
///
public class ToolsPad : AbstractPadContent
{
- Panel panel = new Panel();
- Label noToolsAvailable = new Label();
- Control child;
+ ContentControl contentControl = new ContentControl();
- public override Control Control {
+ public override object Content {
get {
- return panel;
+ return contentControl;
}
}
public ToolsPad()
{
- noToolsAvailable.Text = StringParser.Parse("${res:SharpDevelop.SideBar.NoToolsAvailableForCurrentDocument}");
- noToolsAvailable.Dock = DockStyle.Fill;
- panel.Controls.Add(noToolsAvailable);
- child = noToolsAvailable;
-
WorkbenchSingleton.Workbench.ActiveViewContentChanged += WorkbenchActiveContentChanged;
WorkbenchActiveContentChanged(null, null);
}
- void SetChild(Control newChild)
- {
- if (child != newChild) {
- panel.Controls.Clear();
- newChild.Dock = DockStyle.Fill;
- panel.Controls.Add(newChild);
- child = newChild;
- }
- }
-
void WorkbenchActiveContentChanged(object sender, EventArgs e)
{
IToolsHost th = WorkbenchSingleton.Workbench.ActiveViewContent as IToolsHost;
- if (th != null) {
- SetChild(th.ToolsControl ?? noToolsAvailable);
+ if (th != null && th.ToolsContent != null) {
+ contentControl.SetContent(th.ToolsContent);
} else {
- SetChild(noToolsAvailable);
+ contentControl.SetContent(StringParser.Parse("${res:SharpDevelop.SideBar.NoToolsAvailableForCurrentDocument}"));
}
}
}
diff --git a/src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs b/src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs
index c4b987cec0..8886c6262d 100644
--- a/src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs
+++ b/src/Main/Base/Project/Src/Gui/Workbench/DefaultWorkbench.cs
@@ -94,12 +94,12 @@ namespace ICSharpCode.SharpDevelop.Gui
}
set {
if (layout != null) {
- layout.ActiveWorkbenchWindowChanged -= OnActiveWindowChanged;
+ layout.ActiveContentChanged -= OnActiveWindowChanged;
layout.Detach();
}
value.Attach(this);
layout = value;
- layout.ActiveWorkbenchWindowChanged += OnActiveWindowChanged;
+ layout.ActiveContentChanged += OnActiveWindowChanged;
OnActiveWindowChanged(null, null);
}
}
diff --git a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonDockLayout.cs b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonDockLayout.cs
new file mode 100644
index 0000000000..3745012b5a
--- /dev/null
+++ b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonDockLayout.cs
@@ -0,0 +1,231 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using System.Windows.Media.Imaging;
+
+using AvalonDock;
+using ICSharpCode.Core;
+
+namespace ICSharpCode.SharpDevelop.Gui
+{
+ ///
+ /// Workbench layout using the AvalonDock library.
+ ///
+ sealed class AvalonDockLayout : IWorkbenchLayout
+ {
+ WpfWorkbench workbench;
+ DockingManager dockingManager = new DockingManager();
+ DocumentPane documentPane = new DocumentPane();
+ List workbenchWindows = new List();
+ internal bool Busy;
+
+ public WpfWorkbench Workbench {
+ get { return workbench; }
+ }
+
+ public DockingManager DockingManager {
+ get { return dockingManager; }
+ }
+
+ public AvalonDockLayout()
+ {
+ dockingManager.Content = documentPane;
+ dockingManager.PropertyChanged += dockingManager_PropertyChanged;
+ }
+
+ void dockingManager_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
+ {
+ if (e.PropertyName == "ActiveContent") {
+ if (ActiveContentChanged != null)
+ ActiveContentChanged(this, e);
+ CommandManager.InvalidateRequerySuggested();
+ }
+ }
+
+ public event EventHandler ActiveContentChanged;
+
+ public IWorkbenchWindow ActiveWorkbenchWindow {
+ get {
+ return (AvalonWorkbenchWindow)dockingManager.ActiveDocument;
+ }
+ }
+
+ public object ActiveContent {
+ get {
+ object activeContent = dockingManager.ActiveContent;
+ AvalonPadContent padContent = activeContent as AvalonPadContent;
+ if (padContent != null)
+ return padContent.PadContent;
+ AvalonWorkbenchWindow window = activeContent as AvalonWorkbenchWindow;
+ if (window != null)
+ return window.ActiveViewContent;
+ return null;
+ }
+ }
+
+ public IList WorkbenchWindows {
+ get {
+ return workbenchWindows.AsReadOnly();
+ }
+ }
+
+ public void Attach(IWorkbench workbench)
+ {
+ if (this.workbench != null)
+ throw new InvalidOperationException("Can attach only once!");
+ this.workbench = (WpfWorkbench)workbench;
+ this.workbench.mainContent.Content = dockingManager;
+ Busy = true;
+ try {
+ foreach (PadDescriptor pd in workbench.PadContentCollection) {
+ ShowPad(pd);
+ }
+ LoadConfiguration();
+ } finally {
+ Busy = false;
+ }
+ foreach (AvalonPadContent p in pads.Values) {
+ p.LoadPadContentIfRequired();
+ }
+ }
+
+ public void Detach()
+ {
+ StoreConfiguration();
+ this.workbench.mainContent.Content = null;
+ }
+
+ Dictionary pads = new Dictionary();
+ Dictionary padsByClass = new Dictionary();
+
+ public void ShowPad(PadDescriptor content)
+ {
+ AvalonPadContent pad;
+ if (pads.TryGetValue(content, out pad)) {
+ dockingManager.Show(pad);
+ } else {
+ pad = new AvalonPadContent(this, content);
+ pads.Add(content, pad);
+ padsByClass.Add(content.Class, pad);
+ AnchorStyle style;
+ if ((content.DefaultPosition & DefaultPadPositions.Top) != 0)
+ style = AnchorStyle.Top;
+ else if ((content.DefaultPosition & DefaultPadPositions.Left) != 0)
+ style = AnchorStyle.Left;
+ else if ((content.DefaultPosition & DefaultPadPositions.Bottom) != 0)
+ style = AnchorStyle.Bottom;
+ else
+ style = AnchorStyle.Right;
+ dockingManager.Show(pad, DockableContentState.Docked, style);
+ SetPaneSizeWorkaround(pad.ContainerPane);
+ if ((content.DefaultPosition & DefaultPadPositions.Hidden) != 0)
+ dockingManager.Hide(pad);
+ }
+ }
+
+ static void SetPaneSizeWorkaround(Pane pane)
+ {
+ ResizingPanel panel = pane.Parent as ResizingPanel;
+ if (panel.Orientation == Orientation.Horizontal) {
+ if (ResizingPanel.GetResizeWidth(pane) == 0)
+ ResizingPanel.SetResizeWidth(pane, 200);
+ } else if (panel.Orientation == Orientation.Vertical) {
+ if (ResizingPanel.GetResizeHeight(pane) == 0)
+ ResizingPanel.SetResizeHeight(pane, 150);
+ }
+ }
+
+ public void ActivatePad(PadDescriptor content)
+ {
+ ShowPad(content);
+ }
+
+ public void HidePad(PadDescriptor content)
+ {
+ AvalonPadContent p;
+ if (pads.TryGetValue(content, out p))
+ dockingManager.Hide(p);
+ }
+
+ public void UnloadPad(PadDescriptor content)
+ {
+ AvalonPadContent p = pads[content];
+ dockingManager.Hide(p);
+ DockablePane pane = p.Parent as DockablePane;
+ if (pane != null)
+ pane.Items.Remove(p);
+ p.Dispose();
+ }
+
+ public bool IsVisible(PadDescriptor padContent)
+ {
+ AvalonPadContent p;
+ if (pads.TryGetValue(padContent, out p))
+ return p.IsVisible;
+ else
+ return false;
+ }
+
+ public IWorkbenchWindow ShowView(IViewContent content)
+ {
+ AvalonWorkbenchWindow window = new AvalonWorkbenchWindow(this);
+ workbenchWindows.Add(window);
+ window.ViewContents.Add(content);
+ window.ViewContents.AddRange(content.SecondaryViewContents);
+ documentPane.Items.Add(window);
+ dockingManager.Show(window);
+ window.Closed += window_Closed;
+ return window;
+ }
+
+ void window_Closed(object sender, EventArgs e)
+ {
+ workbenchWindows.Remove((IWorkbenchWindow)sender);
+ }
+
+ public void LoadConfiguration()
+ {
+ try {
+ if (File.Exists(LayoutConfiguration.CurrentLayoutFileName)) {
+ dockingManager.RestoreLayout(LayoutConfiguration.CurrentLayoutFileName);
+ } else {
+ LoadDefaultLayoutConfiguration();
+ }
+ } catch (Exception ex) {
+ MessageService.ShowError(ex);
+ // ignore errors loading configuration
+ }
+ }
+
+ void LoadDefaultLayoutConfiguration()
+ {
+ if (File.Exists(LayoutConfiguration.CurrentLayoutTemplateFileName)) {
+ dockingManager.RestoreLayout(LayoutConfiguration.CurrentLayoutTemplateFileName);
+ }
+ }
+
+ public void StoreConfiguration()
+ {
+ try {
+ LayoutConfiguration current = LayoutConfiguration.CurrentLayout;
+ if (current != null && !current.ReadOnly) {
+ string configPath = Path.Combine(PropertyService.ConfigDirectory, "layouts");
+ Directory.CreateDirectory(configPath);
+ dockingManager.SaveLayout(Path.Combine(configPath, current.FileName));
+ }
+ } catch (Exception e) {
+ MessageService.ShowError(e);
+ }
+ }
+ }
+}
diff --git a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonPadContent.cs b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonPadContent.cs
new file mode 100644
index 0000000000..b03e0b77f9
--- /dev/null
+++ b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonPadContent.cs
@@ -0,0 +1,67 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using ICSharpCode.Core.Presentation;
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Threading;
+using AvalonDock;
+using ICSharpCode.Core;
+
+namespace ICSharpCode.SharpDevelop.Gui
+{
+ sealed class AvalonPadContent : DockableContent, IDisposable
+ {
+ PadDescriptor descriptor;
+ IPadContent content;
+ AvalonDockLayout layout;
+ TextBlock placeholder;
+
+ public IPadContent PadContent {
+ get { return content; }
+ }
+
+ public AvalonPadContent(AvalonDockLayout layout, PadDescriptor descriptor)
+ {
+ this.descriptor = descriptor;
+ this.layout = layout;
+
+ this.Name = descriptor.Class.Replace('.', '_');
+ this.Title = StringParser.Parse(descriptor.Title);
+ placeholder = new TextBlock { Text = this.Title };
+ this.Content = placeholder;
+ this.Icon = PresentationResourceService.GetPixelSnappedImage(descriptor.Icon);
+
+ placeholder.IsVisibleChanged += AvalonPadContent_IsVisibleChanged;
+ }
+
+ void AvalonPadContent_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(LoadPadContentIfRequired));
+ }
+
+ internal void LoadPadContentIfRequired()
+ {
+ if (placeholder != null && placeholder.IsVisible && !layout.Busy) {
+ placeholder.IsVisibleChanged -= AvalonPadContent_IsVisibleChanged;
+ content = descriptor.PadContent;
+ if (content != null) {
+ this.SetContent(content.Content);
+ placeholder = null;
+ }
+ }
+ }
+
+ public void Dispose()
+ {
+ if (content != null) {
+ content.Dispose();
+ }
+ }
+ }
+}
diff --git a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonWorkbenchWindow.cs b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonWorkbenchWindow.cs
new file mode 100644
index 0000000000..e4b076bd2c
--- /dev/null
+++ b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonWorkbenchWindow.cs
@@ -0,0 +1,406 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+using System.Windows.Media.Imaging;
+
+using AvalonDock;
+using ICSharpCode.Core;
+using ICSharpCode.Core.Presentation;
+
+namespace ICSharpCode.SharpDevelop.Gui
+{
+ sealed class AvalonWorkbenchWindow : DocumentContent, IWorkbenchWindow, IOwnerState
+ {
+ readonly static string contextMenuPath = "/SharpDevelop/Workbench/OpenFileTab/ContextMenu";
+
+ public bool IsDisposed { get { return false; } }
+
+ #region IOwnerState
+ [Flags]
+ public enum OpenFileTabStates {
+ Nothing = 0,
+ FileDirty = 1,
+ FileReadOnly = 2,
+ FileUntitled = 4
+ }
+
+ public System.Enum InternalState {
+ get {
+ IViewContent content = this.ActiveViewContent;
+ OpenFileTabStates state = OpenFileTabStates.Nothing;
+ if (content != null) {
+ if (content.IsDirty)
+ state |= OpenFileTabStates.FileDirty;
+ if (content.IsReadOnly)
+ state |= OpenFileTabStates.FileReadOnly;
+ if (content.PrimaryFile != null && content.PrimaryFile.IsUntitled)
+ state |= OpenFileTabStates.FileUntitled;
+ }
+ return state;
+ }
+ }
+ #endregion
+
+ TabControl viewTabControl;
+
+ ///
+ /// The current view content which is shown inside this window.
+ ///
+ public IViewContent ActiveViewContent {
+ get {
+ WorkbenchSingleton.DebugAssertMainThread();
+ if (viewTabControl != null && viewTabControl.SelectedIndex >= 0 && viewTabControl.SelectedIndex < ViewContents.Count) {
+ return ViewContents[viewTabControl.SelectedIndex];
+ } else if (ViewContents.Count == 1) {
+ return ViewContents[0];
+ } else {
+ return null;
+ }
+ }
+ set {
+ int pos = ViewContents.IndexOf(value);
+ if (pos < 0)
+ throw new ArgumentException();
+ SwitchView(pos);
+ }
+ }
+
+ public event EventHandler ActiveViewContentChanged;
+
+ IViewContent oldActiveViewContent;
+
+ void UpdateActiveViewContent()
+ {
+ UpdateTitle();
+ IViewContent newActiveViewContent = this.ActiveViewContent;
+ if (oldActiveViewContent != newActiveViewContent && ActiveViewContentChanged != null) {
+ ActiveViewContentChanged(this, EventArgs.Empty);
+ }
+ oldActiveViewContent = newActiveViewContent;
+ CommandManager.InvalidateRequerySuggested();
+ }
+
+ sealed class ViewContentCollection : Collection
+ {
+ readonly AvalonWorkbenchWindow window;
+
+ internal ViewContentCollection(AvalonWorkbenchWindow window)
+ {
+ this.window = window;
+ }
+
+ protected override void ClearItems()
+ {
+ foreach (IViewContent vc in this) {
+ window.UnregisterContent(vc);
+ }
+
+ base.ClearItems();
+ window.ClearContent();
+ window.UpdateActiveViewContent();
+ }
+
+ protected override void InsertItem(int index, IViewContent item)
+ {
+ base.InsertItem(index, item);
+
+ window.RegisterNewContent(item);
+
+ if (Count == 1) {
+ window.SetContent(item.Content);
+ } else {
+ if (Count == 2) {
+ window.CreateViewTabControl();
+ IViewContent oldItem = this[0];
+ if (oldItem == item) oldItem = this[1];
+
+ TabItem oldPage = new TabItem();
+ oldPage.Header = StringParser.Parse(oldItem.TabPageText);
+ oldPage.SetContent(oldItem.Content);
+ window.viewTabControl.Items.Add(oldPage);
+ }
+
+ TabItem newPage = new TabItem();
+ newPage.Header = StringParser.Parse(item.TabPageText);
+ newPage.SetContent(item.Content);
+
+ window.viewTabControl.Items.Insert(index, newPage);
+ }
+ window.UpdateActiveViewContent();
+ }
+
+ protected override void RemoveItem(int index)
+ {
+ window.UnregisterContent(this[index]);
+
+ base.RemoveItem(index);
+
+ if (Count < 2) {
+ window.ClearContent();
+ if (Count == 1) {
+ window.SetContent(this[0].Content);
+ }
+ } else {
+ window.viewTabControl.Items.RemoveAt(index);
+ }
+ window.UpdateActiveViewContent();
+ }
+
+ protected override void SetItem(int index, IViewContent item)
+ {
+ window.UnregisterContent(this[index]);
+
+ base.SetItem(index, item);
+
+ window.RegisterNewContent(item);
+
+ if (Count == 1) {
+ window.ClearContent();
+ window.SetContent(item.Content);
+ } else {
+ TabItem page = (TabItem)window.viewTabControl.Items[index];
+ page.SetContent(item.Content);
+ page.Header = StringParser.Parse(item.TabPageText);
+ }
+ window.UpdateActiveViewContent();
+ }
+ }
+
+ readonly ViewContentCollection viewContents;
+
+ public IList ViewContents {
+ get { return viewContents; }
+ }
+
+ ///
+ /// Gets whether any contained view content has changed
+ /// since the last save/load operation.
+ ///
+ public bool IsDirty {
+ get { return this.ViewContents.Any(vc => vc.IsDirty); }
+ }
+
+ public void SwitchView(int viewNumber)
+ {
+ if (viewTabControl != null) {
+ this.viewTabControl.SelectedIndex = viewNumber;
+ }
+ }
+
+ public void SelectWindow()
+ {
+ dockLayout.DockingManager.Show(this);
+ }
+
+ AvalonDockLayout dockLayout;
+
+ public AvalonWorkbenchWindow(AvalonDockLayout dockLayout)
+ {
+ if (dockLayout == null)
+ throw new ArgumentNullException("dockLayout");
+ this.dockLayout = dockLayout;
+ viewContents = new ViewContentCollection(this);
+
+ OnTitleNameChanged(this, EventArgs.Empty);
+ this.ContextMenu = MenuService.CreateContextMenu(this, contextMenuPath);
+ }
+
+ void Dispose()
+ {
+ // DetachContent must be called before the controls are disposed
+ List viewContents = this.ViewContents.ToList();
+ this.ViewContents.Clear();
+ viewContents.Foreach(vc => vc.Dispose());
+ }
+
+ private void CreateViewTabControl()
+ {
+ if (viewTabControl == null) {
+ viewTabControl = new TabControl();
+ viewTabControl.GotFocus += delegate {
+ TabItem page = (TabItem)viewTabControl.SelectedItem;
+ if (!page.IsFocused) page.Focus();
+ };
+ viewTabControl.TabStripPlacement = Dock.Bottom;
+ this.SetContent(viewTabControl);
+
+ viewTabControl.SelectionChanged += delegate {
+ UpdateActiveViewContent();
+ };
+ }
+ }
+
+ void ClearContent()
+ {
+ this.Content = null;
+ if (viewTabControl != null) {
+ foreach (TabItem page in viewTabControl.Items) {
+ page.SetContent(null);
+ }
+ viewTabControl = null;
+ }
+ }
+
+ void OnTitleNameChanged(object sender, EventArgs e)
+ {
+ if (sender == ActiveViewContent) {
+ UpdateTitle();
+ }
+ }
+
+ void OnIsDirtyChanged(object sender, EventArgs e)
+ {
+ UpdateTitle();
+ }
+
+ void UpdateTitle()
+ {
+ IViewContent content = ActiveViewContent;
+ if (content != null) {
+ base.ToolTip = content.PrimaryFileName;
+
+ string newTitle = content.TitleName;
+
+ if (this.IsDirty) {
+ newTitle += "*";
+ } else if (content.IsReadOnly) {
+ newTitle += "+";
+ }
+
+ if (newTitle != Title) {
+ Title = newTitle;
+ OnTitleChanged(EventArgs.Empty);
+ }
+ }
+ }
+
+ void RegisterNewContent(IViewContent content)
+ {
+ Debug.Assert(content.WorkbenchWindow == null);
+ content.WorkbenchWindow = this;
+
+ content.TabPageTextChanged += OnTabPageTextChanged;
+ content.TitleNameChanged += OnTitleNameChanged;
+ content.IsDirtyChanged += OnIsDirtyChanged;
+
+ this.dockLayout.Workbench.OnViewOpened(new ViewContentEventArgs(content));
+ }
+
+ void UnregisterContent(IViewContent content)
+ {
+ content.WorkbenchWindow = null;
+
+ content.TabPageTextChanged -= OnTabPageTextChanged;
+ content.TitleNameChanged -= OnTitleNameChanged;
+ content.IsDirtyChanged -= OnIsDirtyChanged;
+
+ this.dockLayout.Workbench.OnViewClosed(new ViewContentEventArgs(content));
+ }
+
+ void OnTabPageTextChanged(object sender, EventArgs e)
+ {
+ RefreshTabPageTexts();
+ }
+
+ bool forceClose;
+
+ public bool CloseWindow(bool force)
+ {
+ forceClose = force;
+ Close();
+ return this.ViewContents.Count == 0;
+ }
+
+ protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
+ {
+ base.OnClosing(e);
+ if (!e.Cancel && !forceClose && this.IsDirty) {
+ MessageBoxResult dr = MessageBox.Show(
+ ResourceService.GetString("MainWindow.SaveChangesMessage"),
+ ResourceService.GetString("MainWindow.SaveChangesMessageHeader") + " " + Title + " ?",
+ MessageBoxButton.YesNoCancel, MessageBoxImage.Question,
+ MessageBoxResult.Yes);
+ switch (dr) {
+ case MessageBoxResult.Yes:
+ foreach (IViewContent vc in this.ViewContents) {
+ if (!vc.IsDirty) continue;
+ if (vc.PrimaryFile != null) {
+ while (true) {
+ vc.Files.Foreach(ICSharpCode.SharpDevelop.Commands.SaveFile.Save);
+ if (vc.IsDirty) {
+ if (MessageService.AskQuestion("${res:MainWindow.DiscardChangesMessage}")) {
+ break;
+ }
+ } else {
+ break;
+ }
+ }
+ }
+ }
+ break;
+ case MessageBoxResult.No:
+ break;
+ case MessageBoxResult.Cancel:
+ e.Cancel = true;
+ break;
+ }
+ }
+ }
+
+ protected override void OnClosed()
+ {
+ base.OnClosed();
+ Dispose();
+ CommandManager.InvalidateRequerySuggested();
+ }
+
+ public void RedrawContent()
+ {
+ RefreshTabPageTexts();
+ }
+
+ void RefreshTabPageTexts()
+ {
+ if (viewTabControl != null) {
+ for (int i = 0; i < viewTabControl.Items.Count; ++i) {
+ TabItem tabPage = (TabItem)viewTabControl.Items[i];
+ tabPage.Header = StringParser.Parse(ViewContents[i].TabPageText);
+ }
+ }
+ }
+
+ void OnTitleChanged(EventArgs e)
+ {
+ if (TitleChanged != null) {
+ TitleChanged(this, e);
+ }
+ }
+
+ public event EventHandler TitleChanged;
+
+ BitmapSource icon;
+
+ BitmapSource IWorkbenchWindow.Icon {
+ get { return icon; }
+ set {
+ if (icon != value) {
+ icon = value;
+ base.Icon = new PixelSnapper(new Image { Source = value });
+ }
+ }
+ }
+ }
+}
diff --git a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
index cc76fae3d1..8831440a1d 100644
--- a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
+++ b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
@@ -386,7 +386,7 @@ namespace ICSharpCode.SharpDevelop.Gui
IPadContent content = padDescriptor.PadContent;
if (content == null)
return;
- Control control = content.Control;
+ Control control = content.Content;
control.Dock = DockStyle.Fill;
Controls.Add(control);
}
@@ -557,7 +557,7 @@ namespace ICSharpCode.SharpDevelop.Gui
return oldSdiWindow;
}
}
- content.Control.Dock = DockStyle.Fill;
+ content.Content.Dock = DockStyle.Fill;
SdiWorkspaceWindow sdiWorkspaceWindow = new SdiWorkspaceWindow();
sdiWorkspaceWindow.ViewContents.Add(content);
sdiWorkspaceWindow.ViewContents.AddRange(content.SecondaryViewContents);
diff --git a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs
index e5bf5204ab..3541421c75 100644
--- a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs
+++ b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceWindow.cs
@@ -122,9 +122,9 @@ namespace ICSharpCode.SharpDevelop.Gui
window.RegisterNewContent(item);
- item.Control.Dock = DockStyle.Fill;
+ item.Content.Dock = DockStyle.Fill;
if (Count == 1) {
- window.Controls.Add(item.Control);
+ window.Controls.Add(item.Content);
} else {
if (Count == 2) {
window.CreateViewTabControl();
@@ -132,12 +132,12 @@ namespace ICSharpCode.SharpDevelop.Gui
if (oldItem == item) oldItem = this[1];
TabPage oldPage = new TabPage(StringParser.Parse(oldItem.TabPageText));
- oldPage.Controls.Add(oldItem.Control);
+ oldPage.Controls.Add(oldItem.Content);
window.viewTabControl.TabPages.Add(oldPage);
}
TabPage newPage = new TabPage(StringParser.Parse(item.TabPageText));
- newPage.Controls.Add(item.Control);
+ newPage.Controls.Add(item.Content);
// Work around bug in TabControl: TabPages.Insert has no effect if inserting at end
if (index == window.viewTabControl.TabPages.Count) {
@@ -158,7 +158,7 @@ namespace ICSharpCode.SharpDevelop.Gui
if (Count < 2) {
window.ClearContent();
if (Count == 1) {
- window.Controls.Add(this[0].Control);
+ window.Controls.Add(this[0].Content);
}
} else {
window.viewTabControl.TabPages.RemoveAt(index);
@@ -174,14 +174,14 @@ namespace ICSharpCode.SharpDevelop.Gui
window.RegisterNewContent(item);
- item.Control.Dock = DockStyle.Fill;
+ item.Content.Dock = DockStyle.Fill;
if (Count == 1) {
window.ClearContent();
- window.Controls.Add(item.Control);
+ window.Controls.Add(item.Content);
} else {
TabPage page = window.viewTabControl.TabPages[index];
page.Controls.Clear();
- page.Controls.Add(item.Control);
+ page.Controls.Add(item.Content);
page.Text = StringParser.Parse(item.TabPageText);
}
window.UpdateActiveViewContent();
diff --git a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SimpleWorkbenchLayout.cs b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SimpleWorkbenchLayout.cs
index ceecac992b..71a3cb1955 100644
--- a/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SimpleWorkbenchLayout.cs
+++ b/src/Main/Base/Project/Src/Gui/Workbench/Layouts/SimpleWorkbenchLayout.cs
@@ -90,7 +90,7 @@ namespace ICSharpCode.SharpDevelop.Gui
{
this.Text = StringParser.Parse(desc.Title);
- Control ctl = desc.PadContent.Control;
+ Control ctl = desc.PadContent.Content;
ctl.Dock = DockStyle.Fill;
Controls.Add(ctl);
}
@@ -323,9 +323,9 @@ namespace ICSharpCode.SharpDevelop.Gui
window.RegisterNewContent(item);
- item.Control.Dock = DockStyle.Fill;
+ item.Content.Dock = DockStyle.Fill;
if (Count == 1) {
- window.Controls.Add(item.Control);
+ window.Controls.Add(item.Content);
} else {
if (Count == 2) {
window.CreateViewTabControl();
@@ -333,12 +333,12 @@ namespace ICSharpCode.SharpDevelop.Gui
if (oldItem == item) oldItem = this[1];
TabPage oldPage = new TabPage(StringParser.Parse(oldItem.TabPageText));
- oldPage.Controls.Add(oldItem.Control);
+ oldPage.Controls.Add(oldItem.Content);
window.viewTabControl.TabPages.Add(oldPage);
}
TabPage newPage = new TabPage(StringParser.Parse(item.TabPageText));
- newPage.Controls.Add(item.Control);
+ newPage.Controls.Add(item.Content);
// Work around bug in TabControl: TabPages.Insert has no effect if inserting at end
if (index == window.viewTabControl.TabPages.Count) {
@@ -359,7 +359,7 @@ namespace ICSharpCode.SharpDevelop.Gui
if (Count < 2) {
window.ClearContent();
if (Count == 1) {
- window.Controls.Add(this[0].Control);
+ window.Controls.Add(this[0].Content);
}
} else {
window.viewTabControl.TabPages.RemoveAt(index);
@@ -375,14 +375,14 @@ namespace ICSharpCode.SharpDevelop.Gui
window.RegisterNewContent(item);
- item.Control.Dock = DockStyle.Fill;
+ item.Content.Dock = DockStyle.Fill;
if (Count == 1) {
window.ClearContent();
- window.Controls.Add(item.Control);
+ window.Controls.Add(item.Content);
} else {
TabPage page = window.viewTabControl.TabPages[index];
page.Controls.Clear();
- page.Controls.Add(item.Control);
+ page.Controls.Add(item.Content);
page.Text = StringParser.Parse(item.TabPageText);
}
window.UpdateActiveViewContent();
diff --git a/src/Main/Base/Project/Src/Gui/Workbench/SingleInstanceHelper.cs b/src/Main/Base/Project/Src/Gui/Workbench/SingleInstanceHelper.cs
index b2f248799f..410e89a708 100644
--- a/src/Main/Base/Project/Src/Gui/Workbench/SingleInstanceHelper.cs
+++ b/src/Main/Base/Project/Src/Gui/Workbench/SingleInstanceHelper.cs
@@ -72,7 +72,7 @@ namespace ICSharpCode.SharpDevelop.Gui
m.Result = new IntPtr(RESULT_FILES_HANDLED);
try {
WorkbenchSingleton.SafeThreadAsyncCall(
- delegate { NativeMethods.SetForegroundWindow(WorkbenchSingleton.MainForm.Handle) ; }
+ delegate { NativeMethods.SetForegroundWindow(WorkbenchSingleton.MainWin32Window.Handle) ; }
);
string tempFileName = Path.Combine(Path.GetTempPath(), "sd" + fileNumber + ".tmp");
foreach (string file in File.ReadAllLines(tempFileName)) {
diff --git a/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs b/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs
new file mode 100644
index 0000000000..351f78c081
--- /dev/null
+++ b/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs
@@ -0,0 +1,332 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+
+using ICSharpCode.Core;
+using ICSharpCode.Core.Presentation;
+using System.Windows.Input;
+
+namespace ICSharpCode.SharpDevelop.Gui
+{
+ ///
+ /// Workbench implementation using WPF and AvalonDock.
+ ///
+ sealed partial class WpfWorkbench : Window, IWorkbench
+ {
+ const string mainMenuPath = "/SharpDevelop/Workbench/MainMenu";
+ const string viewContentPath = "/SharpDevelop/Workbench/Pads";
+
+ public event EventHandler ActiveWorkbenchWindowChanged;
+ public event EventHandler ActiveViewContentChanged;
+ public event EventHandler ActiveContentChanged;
+ public event ViewContentEventHandler ViewOpened;
+
+ internal void OnViewOpened(ViewContentEventArgs e)
+ {
+ if (ViewOpened != null) {
+ ViewOpened(this, e);
+ }
+ }
+
+ public event ViewContentEventHandler ViewClosed;
+
+ internal void OnViewClosed(ViewContentEventArgs e)
+ {
+ if (ViewClosed != null) {
+ ViewClosed(this, e);
+ }
+ }
+
+ public System.Windows.Forms.IWin32Window MainWin32Window { get; private set; }
+ public ISynchronizeInvoke SynchronizingObject { get; set; }
+ public Window MainWindow { get { return this; } }
+
+ List padViewContentCollection = new List();
+
+ ToolBar[] toolBars;
+
+ public WpfWorkbench()
+ {
+ this.SynchronizingObject = new WpfSynchronizeInvoke(this.Dispatcher);
+ this.MainWin32Window = this.GetWin32Window();
+ InitializeComponent();
+ }
+
+ public void Initialize()
+ {
+ foreach (PadDescriptor content in AddInTree.BuildItems(viewContentPath, this, false)) {
+ if (content != null) {
+ ShowPad(content);
+ }
+ }
+
+ mainMenu.ItemsSource = MenuService.CreateMenuItems(this, this, mainMenuPath);
+
+ toolBars = ToolBarService.CreateToolBars(this, "/SharpDevelop/Workbench/ToolBar");
+ foreach (ToolBar tb in toolBars) {
+ DockPanel.SetDock(tb, Dock.Top);
+ dockPanel.Children.Insert(1, tb);
+ }
+ DockPanel.SetDock(StatusBarService.Control, Dock.Bottom);
+ dockPanel.Children.Insert(dockPanel.Children.Count - 2, StatusBarService.Control);
+
+ UpdateMenu();
+
+ requerySuggestedEventHandler = new EventHandler(CommandManager_RequerySuggested);
+ CommandManager.RequerySuggested += requerySuggestedEventHandler;
+
+ StatusBarService.SetMessage("${res:MainWindow.StatusBar.ReadyMessage}");
+ }
+
+ // keep a reference to the event handler to prevent it from being gargabe collected
+ // (CommandManager.RequerySuggested only keeps weak references to the event handlers)
+ EventHandler requerySuggestedEventHandler;
+
+ void CommandManager_RequerySuggested(object sender, EventArgs e)
+ {
+ UpdateMenu();
+ }
+
+ void UpdateMenu()
+ {
+ MenuService.UpdateStatus(mainMenu.ItemsSource);
+ foreach (ToolBar tb in toolBars) {
+ ToolBarService.UpdateStatus(tb.ItemsSource);
+ }
+ }
+
+ public ICollection ViewContentCollection {
+ get {
+ return WorkbenchWindowCollection.SelectMany(w => w.ViewContents).ToList().AsReadOnly();
+ }
+ }
+
+ public IList WorkbenchWindowCollection {
+ get {
+ if (workbenchLayout != null)
+ return workbenchLayout.WorkbenchWindows;
+ else
+ return new IWorkbenchWindow[0];
+ }
+ }
+
+ public IList PadContentCollection {
+ get {
+ return padViewContentCollection.AsReadOnly();
+ }
+ }
+
+ IWorkbenchWindow activeWorkbenchWindow;
+
+ public IWorkbenchWindow ActiveWorkbenchWindow {
+ get {
+ return activeWorkbenchWindow;
+ }
+ private set {
+ if (activeWorkbenchWindow != value) {
+ if (activeWorkbenchWindow != null) {
+ activeWorkbenchWindow.ActiveViewContentChanged -= WorkbenchWindowActiveViewContentChanged;
+ }
+
+ activeWorkbenchWindow = value;
+
+ if (value != null) {
+ value.ActiveViewContentChanged += WorkbenchWindowActiveViewContentChanged;
+ }
+
+ if (ActiveWorkbenchWindowChanged != null) {
+ ActiveWorkbenchWindowChanged(this, EventArgs.Empty);
+ }
+ WorkbenchWindowActiveViewContentChanged(null, null);
+ }
+ }
+ }
+
+ void WorkbenchWindowActiveViewContentChanged(object sender, EventArgs e)
+ {
+ if (workbenchLayout != null) {
+ // update ActiveViewContent
+ IWorkbenchWindow window = this.ActiveWorkbenchWindow;
+ if (window != null)
+ this.ActiveViewContent = window.ActiveViewContent;
+ else
+ this.ActiveViewContent = null;
+
+ // update ActiveContent
+ this.ActiveContent = workbenchLayout.ActiveContent;
+ }
+ }
+
+ void OnActiveWindowChanged(object sender, EventArgs e)
+ {
+ if (closeAll)
+ return;
+
+ if (workbenchLayout != null) {
+ this.ActiveContent = workbenchLayout.ActiveContent;
+ this.ActiveWorkbenchWindow = workbenchLayout.ActiveWorkbenchWindow;
+ } else {
+ this.ActiveContent = null;
+ this.ActiveWorkbenchWindow = null;
+ }
+ }
+
+ IViewContent activeViewContent;
+
+ public IViewContent ActiveViewContent {
+ get { return activeViewContent; }
+ private set {
+ if (activeViewContent != value) {
+ activeViewContent = value;
+
+ if (ActiveViewContentChanged != null) {
+ ActiveViewContentChanged(this, EventArgs.Empty);
+ }
+ }
+ }
+ }
+
+ object activeContent;
+
+ public object ActiveContent {
+ get { return activeContent; }
+ private set {
+ if (activeContent != value) {
+ activeContent = value;
+
+ if (ActiveContentChanged != null) {
+ ActiveContentChanged(this, EventArgs.Empty);
+ }
+ }
+ }
+ }
+
+ IWorkbenchLayout workbenchLayout;
+
+ public IWorkbenchLayout WorkbenchLayout {
+ get {
+ return workbenchLayout;
+ }
+ set {
+ if (workbenchLayout != null) {
+ workbenchLayout.ActiveContentChanged -= OnActiveWindowChanged;
+ workbenchLayout.Detach();
+ }
+ if (value != null) {
+ value.Attach(this);
+ value.ActiveContentChanged += OnActiveWindowChanged;
+ }
+ workbenchLayout = value;
+ OnActiveWindowChanged(null, null);
+ }
+ }
+
+ public bool IsActiveWindow {
+ get {
+ return IsActive;
+ }
+ }
+
+ public void ShowView(IViewContent content)
+ {
+ if (content == null)
+ throw new ArgumentNullException("content");
+ System.Diagnostics.Debug.Assert(WorkbenchLayout != null);
+
+ WorkbenchLayout.ShowView(content);
+ content.WorkbenchWindow.SelectWindow();
+ }
+
+ public void ShowPad(PadDescriptor content)
+ {
+ if (content == null)
+ throw new ArgumentNullException("content");
+
+ padViewContentCollection.Add(content);
+
+ if (WorkbenchLayout != null) {
+ WorkbenchLayout.ShowPad(content);
+ }
+ }
+
+ public void UnloadPad(PadDescriptor content)
+ {
+ }
+
+ public PadDescriptor GetPad(Type type)
+ {
+ foreach (PadDescriptor pad in PadContentCollection) {
+ if (pad.Class == type.FullName) {
+ return pad;
+ }
+ }
+ return null;
+ }
+
+ ///
+ /// Flag used to prevent repeated ActiveWindowChanged events during CloseAllViews().
+ ///
+ bool closeAll;
+
+ public void CloseAllViews()
+ {
+ try {
+ closeAll = true;
+ foreach (IWorkbenchWindow window in this.WorkbenchWindowCollection.ToArray()) {
+ window.CloseWindow(false);
+ }
+ } finally {
+ closeAll = false;
+ OnActiveWindowChanged(this, EventArgs.Empty);
+ }
+ }
+
+ public void RedrawAllComponents()
+ {
+ }
+
+ public void UpdateRenderer()
+ {
+ }
+
+ public Properties CreateMemento()
+ {
+ Properties prop = new Properties();
+ prop.Set("WindowState", this.WindowState);
+ if (this.WindowState == System.Windows.WindowState.Normal) {
+ prop.Set("Left", this.Left);
+ prop.Set("Top", this.Top);
+ prop.Set("Width", this.Width);
+ prop.Set("Height", this.Height);
+ }
+ return prop;
+ }
+
+ public void SetMemento(Properties memento)
+ {
+ this.Left = memento.Get("Left", 10.0);
+ this.Top = memento.Get("Top", 10.0);
+ this.Width = memento.Get("Width", 600.0);
+ this.Height = memento.Get("Height", 400.0);
+ this.WindowState = memento.Get("WindowState", System.Windows.WindowState.Maximized);
+ }
+
+ protected override void OnClosing(CancelEventArgs e)
+ {
+ base.OnClosing(e);
+ if (!e.Cancel) {
+ this.WorkbenchLayout = null;
+ }
+ }
+ }
+}
diff --git a/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.xaml b/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.xaml
new file mode 100644
index 0000000000..f066c4f1e4
--- /dev/null
+++ b/src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs b/src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs
index e273590a4b..194e5ec292 100644
--- a/src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs
+++ b/src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs
@@ -7,6 +7,7 @@
using System;
using System.Diagnostics;
+using System.Windows;
using System.Windows.Forms;
using ICSharpCode.Core;
@@ -21,16 +22,27 @@ namespace ICSharpCode.SharpDevelop.Gui
const string workbenchMemento = "WorkbenchMemento";
const string activeContentState = "Workbench.ActiveContent";
- static STAThreadCaller caller;
static IWorkbench workbench;
///
/// Gets the main form. Returns null in unit-testing mode.
///
- public static Form MainForm {
+ public static IWin32Window MainWin32Window {
get {
if (workbench != null) {
- return workbench.MainForm;
+ return workbench.MainWin32Window;
+ }
+ return null;
+ }
+ }
+
+ ///
+ /// Gets the main window. Returns null in unit-testing mode.
+ ///
+ public static Window MainWindow {
+ get {
+ if (workbench != null) {
+ return workbench.MainWindow;
}
return null;
}
@@ -47,6 +59,8 @@ namespace ICSharpCode.SharpDevelop.Gui
public static Control ActiveControl {
get {
+ return null;
+ /*
ContainerControl container = WorkbenchSingleton.MainForm;
Control ctl;
do {
@@ -55,7 +69,7 @@ namespace ICSharpCode.SharpDevelop.Gui
return container;
container = ctl as ContainerControl;
} while(container != null);
- return ctl;
+ return ctl;*/
}
}
@@ -84,10 +98,11 @@ namespace ICSharpCode.SharpDevelop.Gui
///
public static void InitializeWorkbench()
{
- if (Environment.OSVersion.Platform == PlatformID.Unix)
- InitializeWorkbench(new DefaultWorkbench(), new SimpleWorkbenchLayout());
- else
- InitializeWorkbench(new DefaultWorkbench(), new SdiWorkbenchLayout());
+// if (Environment.OSVersion.Platform == PlatformID.Unix)
+// InitializeWorkbench(new DefaultWorkbench(), new SimpleWorkbenchLayout());
+// else
+// InitializeWorkbench(new DefaultWorkbench(), new SdiWorkbenchLayout());
+ InitializeWorkbench(new WpfWorkbench(), new AvalonDockLayout());
}
public static void InitializeWorkbench(IWorkbench workbench, IWorkbenchLayout layout)
@@ -104,14 +119,12 @@ namespace ICSharpCode.SharpDevelop.Gui
Project.CustomToolsService.Initialize();
Project.BuildModifiedProjectsOnlyService.Initialize();
- WinFormsMessageService.DialogOwner = workbench.MainForm;
- WinFormsMessageService.DialogSynchronizeInvoke = workbench.MainForm;
+ WinFormsMessageService.DialogOwner = workbench.MainWin32Window;
+ WinFormsMessageService.DialogSynchronizeInvoke = workbench.SynchronizingObject;
PropertyService.PropertyChanged += new PropertyChangedEventHandler(TrackPropertyChanges);
ResourceService.LanguageChanged += delegate { workbench.RedrawAllComponents(); };
- caller = new STAThreadCaller(workbench.MainForm);
-
workbench.Initialize();
workbench.SetMemento(PropertyService.Get(workbenchMemento, new Properties()));
workbench.WorkbenchLayout = layout;
@@ -154,47 +167,12 @@ namespace ICSharpCode.SharpDevelop.Gui
}
#region Safe Thread Caller
- ///
- /// Helper class for invoking methods on the main thread.
- ///
- private sealed class STAThreadCaller
- {
- Control ctl;
-
- public STAThreadCaller(Control ctl)
- {
- if (ctl == null)
- throw new ArgumentNullException("ctl");
- this.ctl = ctl;
- }
-
- public object Call(Delegate method, object[] arguments)
- {
- if (method == null) {
- throw new ArgumentNullException("method");
- }
- return ctl.Invoke(method, arguments);
- }
-
- public void BeginCall(Delegate method, object[] arguments)
- {
- if (method == null) {
- throw new ArgumentNullException("method");
- }
- try {
- ctl.BeginInvoke(method, arguments);
- } catch (InvalidOperationException ex) {
- LoggingService.Warn("Error in SafeThreadAsyncCall", ex);
- }
- }
- }
-
public static bool InvokeRequired {
get {
if (workbench == null)
return false; // unit test mode, don't crash
else
- return workbench.MainForm.InvokeRequired;
+ return workbench.SynchronizingObject.InvokeRequired;
}
}
@@ -227,7 +205,7 @@ namespace ICSharpCode.SharpDevelop.Gui
///
public static R SafeThreadFunction(Func method)
{
- return (R)caller.Call(method, emptyObjectArray);
+ return (R)workbench.SynchronizingObject.Invoke(method, emptyObjectArray);
}
///
@@ -237,7 +215,7 @@ namespace ICSharpCode.SharpDevelop.Gui
///
public static R SafeThreadFunction(Func method, A arg1)
{
- return (R)caller.Call(method, new object[] { arg1 });
+ return (R)workbench.SynchronizingObject.Invoke(method, new object[] { arg1 });
}
///
@@ -247,7 +225,7 @@ namespace ICSharpCode.SharpDevelop.Gui
///
public static void SafeThreadCall(Action method)
{
- caller.Call(method, emptyObjectArray);
+ workbench.SynchronizingObject.Invoke(method, emptyObjectArray);
}
///
@@ -257,7 +235,7 @@ namespace ICSharpCode.SharpDevelop.Gui
///
public static void SafeThreadCall(Action method, A arg1)
{
- caller.Call(method, new object[] { arg1 });
+ workbench.SynchronizingObject.Invoke(method, new object[] { arg1 });
}
///
@@ -267,7 +245,7 @@ namespace ICSharpCode.SharpDevelop.Gui
///
public static void SafeThreadCall(Action method, A arg1, B arg2)
{
- caller.Call(method, new object[] { arg1, arg2 });
+ workbench.SynchronizingObject.Invoke(method, new object[] { arg1, arg2 });
}
///
@@ -277,7 +255,7 @@ namespace ICSharpCode.SharpDevelop.Gui
///
public static void SafeThreadCall(Action method, A arg1, B arg2, C arg3)
{
- caller.Call(method, new object[] { arg1, arg2, arg3 });
+ workbench.SynchronizingObject.Invoke(method, new object[] { arg1, arg2, arg3 });
}
///
@@ -285,7 +263,7 @@ namespace ICSharpCode.SharpDevelop.Gui
///
public static void SafeThreadAsyncCall(Action method)
{
- caller.BeginCall(method, new object[0]);
+ workbench.SynchronizingObject.BeginInvoke(method, emptyObjectArray);
}
///
@@ -293,7 +271,7 @@ namespace ICSharpCode.SharpDevelop.Gui
///
public static void SafeThreadAsyncCall(Action method, A arg1)
{
- caller.BeginCall(method, new object[] { arg1 });
+ workbench.SynchronizingObject.BeginInvoke(method, new object[] { arg1 });
}
///
@@ -301,7 +279,7 @@ namespace ICSharpCode.SharpDevelop.Gui
///
public static void SafeThreadAsyncCall(Action method, A arg1, B arg2)
{
- caller.BeginCall(method, new object[] { arg1, arg2 });
+ workbench.SynchronizingObject.BeginInvoke(method, new object[] { arg1, arg2 });
}
///
@@ -309,7 +287,7 @@ namespace ICSharpCode.SharpDevelop.Gui
///
public static void SafeThreadAsyncCall(Action method, A arg1, B arg2, C arg3)
{
- caller.BeginCall(method, new object[] { arg1, arg2, arg3 });
+ workbench.SynchronizingObject.BeginInvoke(method, new object[] { arg1, arg2, arg3 });
}
#endregion
diff --git a/src/Main/Base/Project/Src/Internal/Doozers/PadDescriptor.cs b/src/Main/Base/Project/Src/Internal/Doozers/PadDescriptor.cs
index 66e2025208..dfc0da25de 100644
--- a/src/Main/Base/Project/Src/Internal/Doozers/PadDescriptor.cs
+++ b/src/Main/Base/Project/Src/Internal/Doozers/PadDescriptor.cs
@@ -11,6 +11,21 @@ using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.SharpDevelop
{
+ ///
+ /// Indicates the default position for a pad.
+ /// This is a bit-flag enum, Hidden can be combined with the directions.
+ ///
+ [Flags]
+ public enum DefaultPadPositions
+ {
+ None = 0,
+ Right = 1,
+ Left = 2,
+ Bottom = 4,
+ Top = 8,
+ Hidden = 16
+ }
+
///
/// Describes a pad.
///
@@ -39,6 +54,9 @@ namespace ICSharpCode.SharpDevelop
icon = codon.Properties["icon"];
title = codon.Properties["title"];
@class = codon.Properties["class"];
+ if (!string.IsNullOrEmpty(codon.Properties["defaultPosition"])) {
+ DefaultPosition = (DefaultPadPositions)Enum.Parse(typeof(DefaultPadPositions), codon.Properties["defaultPosition"]);
+ }
}
///
@@ -111,11 +129,10 @@ namespace ICSharpCode.SharpDevelop
}
}
- public bool HasFocus {
- get {
- return (padContent != null) ? padContent.Control.ContainsFocus : false;
- }
- }
+ ///
+ /// Gets/sets the default position of the pad.
+ ///
+ public DefaultPadPositions DefaultPosition { get; set; }
public IPadContent PadContent {
get {
@@ -132,13 +149,6 @@ namespace ICSharpCode.SharpDevelop
}
}
- public void RedrawContent()
- {
- if (padContent != null) {
- padContent.RedrawContent();
- }
- }
-
public void CreatePad()
{
#if DEBUG
diff --git a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs
index faf60ec663..929501098a 100644
--- a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs
+++ b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs
@@ -376,7 +376,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
customizer.Set("ProjectCreateInformation", projectCreateInformation);
customizer.Set("ProjectTemplate", this);
WizardDialog wizard = new WizardDialog("Project Wizard", customizer, wizardpath);
- if (wizard.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) != DialogResult.OK) {
+ if (wizard.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) != DialogResult.OK) {
return null;
}
}
diff --git a/src/Main/Base/Project/Src/Project/BuildEngine.cs b/src/Main/Base/Project/Src/Project/BuildEngine.cs
index 1300390cd3..ddd0bd0b4e 100644
--- a/src/Main/Base/Project/Src/Project/BuildEngine.cs
+++ b/src/Main/Base/Project/Src/Project/BuildEngine.cs
@@ -77,7 +77,7 @@ namespace ICSharpCode.SharpDevelop.Project
public void Done(bool success)
{
- WorkbenchSingleton.SafeThreadAsyncCall(delegate { guiBuildProgressMonitor = null; });
+ WorkbenchSingleton.SafeThreadAsyncCall( delegate { guiBuildProgressMonitor = null; });
}
}
@@ -524,7 +524,7 @@ namespace ICSharpCode.SharpDevelop.Project
combinedBuildFeedbackSink.Done(results.Result == BuildResultCode.Success);
}
if (options.Callback != null) {
- Gui.WorkbenchSingleton.MainForm.BeginInvoke(options.Callback, results);
+ Gui.WorkbenchSingleton.SafeThreadAsyncCall(delegate { options.Callback(results); });
}
}
#endregion
diff --git a/src/Main/Base/Project/Src/Services/AmbienceService/AmbienceService.cs b/src/Main/Base/Project/Src/Services/AmbienceService/AmbienceService.cs
index 736f3b930c..f3362bb3f7 100644
--- a/src/Main/Base/Project/Src/Services/AmbienceService/AmbienceService.cs
+++ b/src/Main/Base/Project/Src/Services/AmbienceService/AmbienceService.cs
@@ -101,7 +101,7 @@ namespace ICSharpCode.SharpDevelop
} catch (TreePathNotFoundException) {
ambience = null;
}
- if (ambience == null && Gui.WorkbenchSingleton.MainForm != null) {
+ if (ambience == null && Gui.WorkbenchSingleton.MainWin32Window != null) {
MessageService.ShowError("${res:ICSharpCode.SharpDevelop.Services.AmbienceService.AmbienceNotFoundError}");
}
defaultAmbience = ambience ?? new NetAmbience();
diff --git a/src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs b/src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs
index 672b3cd5ad..eff5f260de 100644
--- a/src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs
+++ b/src/Main/Base/Project/Src/Services/ClassBrowserIcons/ClassBrowserIconService.cs
@@ -6,6 +6,7 @@
//
using System;
+using System.Collections.Generic;
using System.Reflection;
using System.Windows.Forms;
@@ -214,85 +215,92 @@ namespace ICSharpCode.SharpDevelop
return BASE;
}
+ public static readonly IList ResourceNames;
+
static ClassBrowserIconService()
{
imglist = new ImageList();
imglist.ColorDepth = ColorDepth.Depth32Bit;
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Assembly"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.OpenAssembly"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Library"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.NameSpace"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.SubTypes"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.SuperTypes"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ClosedFolderBitmap"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.OpenFolderBitmap"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Reference"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ClosedReferenceFolder"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.OpenReferenceFolder"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ResourceFileIcon"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Event"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.SelectionArrow"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.CombineIcon"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Literal")); // const
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Local"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Parameter"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.TextFileIcon"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Class")); //19
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalClass"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedClass"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateClass"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Struct"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalStruct"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedStruct"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateStruct"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Interface"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalInterface"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedInterface"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateInterface"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Enum"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalEnum"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedEnum"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateEnum"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Method"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalMethod"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedMethod"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateMethod"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Property"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalProperty"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedProperty"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateProperty"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Field"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalField"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedField"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateField"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Delegate"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalDelegate"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedDelegate"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateDelegate"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Event"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalEvent"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedEvent"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateEvent"));
-
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.Indexer"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.InternalIndexer"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.ProtectedIndexer"));
- imglist.Images.Add(WinFormsResourceService.GetBitmap("Icons.16x16.PrivateIndexer"));
+ ResourceNames = new List {
+ "Icons.16x16.Assembly",
+ "Icons.16x16.OpenAssembly",
+
+ "Icons.16x16.Library",
+ "Icons.16x16.NameSpace",
+ "Icons.16x16.SubTypes",
+ "Icons.16x16.SuperTypes",
+
+ "Icons.16x16.ClosedFolderBitmap",
+ "Icons.16x16.OpenFolderBitmap",
+
+ "Icons.16x16.Reference",
+ "Icons.16x16.ClosedReferenceFolder",
+ "Icons.16x16.OpenReferenceFolder",
+
+ "Icons.16x16.ResourceFileIcon",
+ "Icons.16x16.Event",
+ "Icons.16x16.SelectionArrow",
+
+ "Icons.16x16.CombineIcon",
+ "Icons.16x16.Literal", // const
+
+ "Icons.16x16.Local",
+ "Icons.16x16.Parameter",
+ "Icons.16x16.TextFileIcon",
+
+ "Icons.16x16.Class", //19
+ "Icons.16x16.InternalClass",
+ "Icons.16x16.ProtectedClass",
+ "Icons.16x16.PrivateClass",
+
+ "Icons.16x16.Struct",
+ "Icons.16x16.InternalStruct",
+ "Icons.16x16.ProtectedStruct",
+ "Icons.16x16.PrivateStruct",
+
+ "Icons.16x16.Interface",
+ "Icons.16x16.InternalInterface",
+ "Icons.16x16.ProtectedInterface",
+ "Icons.16x16.PrivateInterface",
+
+ "Icons.16x16.Enum",
+ "Icons.16x16.InternalEnum",
+ "Icons.16x16.ProtectedEnum",
+ "Icons.16x16.PrivateEnum",
+
+ "Icons.16x16.Method",
+ "Icons.16x16.InternalMethod",
+ "Icons.16x16.ProtectedMethod",
+ "Icons.16x16.PrivateMethod",
+
+ "Icons.16x16.Property",
+ "Icons.16x16.InternalProperty",
+ "Icons.16x16.ProtectedProperty",
+ "Icons.16x16.PrivateProperty",
+
+ "Icons.16x16.Field",
+ "Icons.16x16.InternalField",
+ "Icons.16x16.ProtectedField",
+ "Icons.16x16.PrivateField",
+
+ "Icons.16x16.Delegate",
+ "Icons.16x16.InternalDelegate",
+ "Icons.16x16.ProtectedDelegate",
+ "Icons.16x16.PrivateDelegate",
+
+ "Icons.16x16.Event",
+ "Icons.16x16.InternalEvent",
+ "Icons.16x16.ProtectedEvent",
+ "Icons.16x16.PrivateEvent",
+
+ "Icons.16x16.Indexer",
+ "Icons.16x16.InternalIndexer",
+ "Icons.16x16.ProtectedIndexer",
+ "Icons.16x16.PrivateIndexer"
+ }.AsReadOnly();
+ foreach (string r in ResourceNames) {
+ imglist.Images.Add(WinFormsResourceService.GetBitmap(r));
+ }
}
}
}
diff --git a/src/Main/Base/Project/Src/Services/Debugger/DebuggerGridControl.cs b/src/Main/Base/Project/Src/Services/Debugger/DebuggerGridControl.cs
index b421656b6b..25deaeb1e5 100644
--- a/src/Main/Base/Project/Src/Services/Debugger/DebuggerGridControl.cs
+++ b/src/Main/Base/Project/Src/Services/Debugger/DebuggerGridControl.cs
@@ -78,26 +78,22 @@ namespace ICSharpCode.SharpDevelop.Debugging
return true;
} else {
Console.WriteLine("Handling " + keyData);
- var i = FindItemByShortcut(Gui.WorkbenchSingleton.MainForm.MainMenuStrip.Items, keyData);
- if (i != null)
- i.PerformClick();
- return false;
- }
- }
-
- static ToolStripMenuItem FindItemByShortcut(ToolStripItemCollection c, Keys shortcut)
- {
- foreach (ToolStripItem i in c) {
- ToolStripMenuItem mi = i as ToolStripMenuItem;
- if (mi != null) {
- if (mi.ShortcutKeys == shortcut && mi.Enabled)
- return mi;
- mi = FindItemByShortcut(mi.DropDownItems, shortcut);
- if (mi != null)
- return mi;
+ var window = Gui.WorkbenchSingleton.MainWindow;
+ foreach (System.Windows.Input.InputBinding inputBinding in window.InputBindings) {
+ if (inputBinding.Gesture.Matches(null, new System.Windows.Input.KeyEventArgs(
+ System.Windows.Input.Keyboard.PrimaryDevice,
+ System.Windows.PresentationSource.FromVisual(window),
+ 0,
+ System.Windows.Input.KeyInterop.KeyFromVirtualKey((int)(keyData & ~Keys.Modifiers))
+ ))) {
+ if (inputBinding.Command.CanExecute(inputBinding.CommandParameter)) {
+ inputBinding.Command.Execute(inputBinding.CommandParameter);
+ return true;
+ }
+ }
}
}
- return null;
+ return false;
}
}
diff --git a/src/Main/Base/Project/Src/Services/File/FileChangeWatcher.cs b/src/Main/Base/Project/Src/Services/File/FileChangeWatcher.cs
index e8ecd1ea45..2a6dd54ae6 100644
--- a/src/Main/Base/Project/Src/Services/File/FileChangeWatcher.cs
+++ b/src/Main/Base/Project/Src/Services/File/FileChangeWatcher.cs
@@ -50,7 +50,7 @@ namespace ICSharpCode.SharpDevelop
if (file == null)
throw new ArgumentNullException("file");
this.file = file;
- WorkbenchSingleton.MainForm.Activated += MainForm_Activated;
+ WorkbenchSingleton.MainWindow.Activated += MainForm_Activated;
file.FileNameChanged += file_FileNameChanged;
activeWatchers.Add(this);
SetWatcher();
@@ -66,7 +66,7 @@ namespace ICSharpCode.SharpDevelop
WorkbenchSingleton.AssertMainThread();
activeWatchers.Remove(this);
if (file != null) {
- WorkbenchSingleton.MainForm.Activated -= MainForm_Activated;
+ WorkbenchSingleton.MainWindow.Activated -= MainForm_Activated;
file.FileNameChanged -= file_FileNameChanged;
file = null;
}
@@ -80,8 +80,8 @@ namespace ICSharpCode.SharpDevelop
public bool Enabled {
get { return enabled; }
- set {
- enabled = value;
+ set {
+ enabled = value;
SetWatcher();
}
}
@@ -110,7 +110,8 @@ namespace ICSharpCode.SharpDevelop
try {
if (watcher == null) {
watcher = new FileSystemWatcher();
- watcher.SynchronizingObject = WorkbenchSingleton.MainForm;
+ if (WorkbenchSingleton.Workbench != null)
+ watcher.SynchronizingObject = WorkbenchSingleton.Workbench.SynchronizingObject;
watcher.Changed += new FileSystemEventHandler(this.OnFileChangedEvent);
}
watcher.Path = Path.GetDirectoryName(fileName);
diff --git a/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs b/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs
index 662182b184..136e29ea74 100644
--- a/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs
+++ b/src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs
@@ -6,12 +6,13 @@
//
using System;
-using System.Linq;
using System.IO;
+using System.Linq;
using System.Text;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
+using System.Windows.Input;
namespace ICSharpCode.SharpDevelop.Project
{
@@ -37,6 +38,7 @@ namespace ICSharpCode.SharpDevelop.Project
LoggingService.Info("CurrentProject changed to " + (value == null ? "null" : value.Name));
currentProject = value;
OnCurrentProjectChanged(new ProjectEventArgs(currentProject));
+ CommandManager.InvalidateRequerySuggested();
}
}
}
@@ -244,6 +246,11 @@ namespace ICSharpCode.SharpDevelop.Project
}
public static void LoadSolution(string fileName)
+ {
+ FileUtility.ObservedLoad(LoadSolutionInternal, fileName);
+ }
+
+ static void LoadSolutionInternal(string fileName)
{
if (!Path.IsPathRooted(fileName))
throw new ArgumentException("Path must be rooted!");
@@ -251,6 +258,7 @@ namespace ICSharpCode.SharpDevelop.Project
OnSolutionLoading(fileName);
try {
openSolution = Solution.Load(fileName);
+ CommandManager.InvalidateRequerySuggested();
if (openSolution == null)
return;
} catch (UnauthorizedAccessException ex) {
@@ -306,12 +314,17 @@ namespace ICSharpCode.SharpDevelop.Project
/// Load a single project as solution.
///
public static void LoadProject(string fileName)
+ {
+ FileUtility.ObservedLoad(LoadSolutionInternal, fileName);
+ }
+
+ static void LoadProjectInternal(string fileName)
{
if (!Path.IsPathRooted(fileName))
throw new ArgumentException("Path must be rooted!");
string solutionFile = Path.ChangeExtension(fileName, ".sln");
if (File.Exists(solutionFile)) {
- LoadSolution(solutionFile);
+ LoadSolutionInternal(solutionFile);
if (openSolution != null) {
bool found = false;
@@ -479,6 +492,7 @@ namespace ICSharpCode.SharpDevelop.Project
openSolution = null;
OnSolutionClosed(EventArgs.Empty);
+ CommandManager.InvalidateRequerySuggested();
}
}
diff --git a/src/Main/Base/Project/Src/Services/StatusBar/StatusBarService.cs b/src/Main/Base/Project/Src/Services/StatusBar/StatusBarService.cs
index d90037c5ce..e4d3f0143f 100644
--- a/src/Main/Base/Project/Src/Services/StatusBar/StatusBarService.cs
+++ b/src/Main/Base/Project/Src/Services/StatusBar/StatusBarService.cs
@@ -7,9 +7,8 @@
using System;
using System.Linq;
-using System.Drawing;
-using System.Windows.Forms;
-
+using System.Windows;
+using System.Windows.Media.Imaging;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
@@ -27,15 +26,15 @@ namespace ICSharpCode.SharpDevelop
public static bool Visible {
get {
System.Diagnostics.Debug.Assert(statusBar != null);
- return statusBar.Visible;
+ return statusBar.Visibility == Visibility.Visible;
}
set {
System.Diagnostics.Debug.Assert(statusBar != null);
- statusBar.Visible = value;
+ statusBar.Visibility = value ? Visibility.Visible : Visibility.Collapsed;
}
}
- public static Control Control {
+ internal static SdStatusBar Control {
get {
System.Diagnostics.Debug.Assert(statusBar != null);
return statusBar;
@@ -44,7 +43,7 @@ namespace ICSharpCode.SharpDevelop
public static void SetCaretPosition(int x, int y, int charOffset)
{
- statusBar.CursorStatusBarPanel.Text = StringParser.Parse(
+ statusBar.CursorStatusBarPanel.Content = StringParser.Parse(
"${res:StatusBarService.CursorStatusBarPanelText}",
new string[,] {
{"Line", String.Format("{0,-10}", y)},
@@ -55,7 +54,7 @@ namespace ICSharpCode.SharpDevelop
public static void SetInsertMode(bool insertMode)
{
- statusBar.ModeStatusBarPanel.Text = insertMode ? StringParser.Parse("${res:StatusBarService.CaretModes.Insert}") : StringParser.Parse("${res:StatusBarService.CaretModes.Overwrite}");
+ statusBar.ModeStatusBarPanel.Content = insertMode ? StringParser.Parse("${res:StatusBarService.CaretModes.Insert}") : StringParser.Parse("${res:StatusBarService.CaretModes.Overwrite}");
}
public static void ShowErrorMessage(string message)
@@ -71,7 +70,7 @@ namespace ICSharpCode.SharpDevelop
statusBar.SetMessage(StringParser.Parse(message));
}
- public static void SetMessage(Image image, string message)
+ public static void SetMessage(BitmapSource image, string message)
{
System.Diagnostics.Debug.Assert(statusBar != null);
statusBar.SetMessage(image, StringParser.Parse(message));
diff --git a/src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPad.cs b/src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPad.cs
index 993e9d2d51..174dce1741 100644
--- a/src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPad.cs
+++ b/src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPad.cs
@@ -40,7 +40,7 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
Dictionary fileNodes = new Dictionary();
- public override Control Control {
+ public override object Content {
get {
return myPanel;
}
diff --git a/src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPadToolbarCommands.cs b/src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPadToolbarCommands.cs
index e1884cfc84..74973f168d 100644
--- a/src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPadToolbarCommands.cs
+++ b/src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPadToolbarCommands.cs
@@ -35,12 +35,12 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
}
}
- #endregion Goto Commands
+ #endregion Goto Commands
#region Delete BookMark(s) commands
public abstract class AbstractDeleteMarkClass : AbstractMenuCommand
- {
+ {
protected void deleteBookMark (BookmarkNode node) {
if (node.Bookmark.Document != null) {
node.Bookmark.Document.BookmarkManager.RemoveMark(node.Bookmark);
@@ -70,7 +70,6 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
}
}
}
- WorkbenchSingleton.MainForm.Refresh();
}
}
@@ -96,7 +95,6 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
deleteBookMark(folderNode.Nodes[i] as BookmarkNode);
}
}
- WorkbenchSingleton.MainForm.Refresh();
}
}
}
diff --git a/src/Main/Base/Project/Src/TextEditor/Commands/FormatCommands.cs b/src/Main/Base/Project/Src/TextEditor/Commands/FormatCommands.cs
index 5844419a80..c561e14fbd 100644
--- a/src/Main/Base/Project/Src/TextEditor/Commands/FormatCommands.cs
+++ b/src/Main/Base/Project/Src/TextEditor/Commands/FormatCommands.cs
@@ -232,8 +232,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
}
using (SortOptionsDialog sortOptionsDialog = new SortOptionsDialog()) {
- sortOptionsDialog.Owner = WorkbenchSingleton.MainForm;
- if (sortOptionsDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (sortOptionsDialog.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
TextArea textarea = ((ITextEditorControlProvider)viewContent).TextEditorControl.ActiveTextAreaControl.TextArea;
textarea.BeginUpdate();
if (textarea.SelectionManager.HasSomethingSelected) {
diff --git a/src/Main/Base/Project/Src/TextEditor/Commands/GenerateCodeCommand.cs b/src/Main/Base/Project/Src/TextEditor/Commands/GenerateCodeCommand.cs
index f2be4b853c..572b6a03c7 100644
--- a/src/Main/Base/Project/Src/TextEditor/Commands/GenerateCodeCommand.cs
+++ b/src/Main/Base/Project/Src/TextEditor/Commands/GenerateCodeCommand.cs
@@ -50,7 +50,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
if (currentClass != null) {
var generators = AddInTree.BuildItems("/AddIns/DefaultTextEditor/CodeGenerator", this, true);
using (CodeGenerationForm form = new CodeGenerationForm(textEditorControl, generators.ToArray(), currentClass)) {
- form.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
+ form.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window);
}
}
}
diff --git a/src/Main/Base/Project/Src/TextEditor/Commands/ToolCommands.cs b/src/Main/Base/Project/Src/TextEditor/Commands/ToolCommands.cs
index 37eaf7cbb3..b834708eae 100644
--- a/src/Main/Base/Project/Src/TextEditor/Commands/ToolCommands.cs
+++ b/src/Main/Base/Project/Src/TextEditor/Commands/ToolCommands.cs
@@ -33,7 +33,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
TextEditorControl textarea = ((ITextEditorControlProvider)viewContent).TextEditorControl;
using (SharpDevelopColorDialog cd = new SharpDevelopColorDialog()) {
- if (cd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (cd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
string ext = Path.GetExtension(textarea.FileName).ToLowerInvariant();
string colorstr;
if (ext == ".cs" || ext == ".vb" || ext == ".boo") {
diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.cs b/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.cs
index d1639fcdbb..d88e4027e6 100644
--- a/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.cs
+++ b/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.cs
@@ -1,28 +1,30 @@
//
//
//
-//
+//
// $Revision$
//
using System;
using System.Collections;
using System.Collections.Generic;
-using System.Drawing;
+using System.ComponentModel;
using System.IO;
-using System.Windows.Forms;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
using ICSharpCode.Core;
+using ICSharpCode.Core.Presentation;
using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor;
using ICSharpCode.SharpDevelop.Dom;
-using ICSharpCode.SharpDevelop.Gui.XmlForms;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Gui.CompletionWindow;
namespace ICSharpCode.SharpDevelop.Gui
{
- public class GotoDialog : BaseSharpDevelopForm
+ public partial class GotoDialog : Window
{
static GotoDialog Instance = null;
@@ -30,65 +32,79 @@ namespace ICSharpCode.SharpDevelop.Gui
{
if (Instance == null) {
Instance = new GotoDialog();
- Instance.Show(WorkbenchSingleton.MainForm);
+ Instance.Owner = WorkbenchSingleton.MainWindow;
+ Instance.Show();
} else {
- Instance.Focus();
+ Instance.Activate();
}
}
- ListView listView;
- TextBox textBox;
-
public GotoDialog()
{
- SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("Resources.GotoDialog.xfrm"));
- ControlDictionary["okButton"].Click += new EventHandler(OKButtonClick);
- ControlDictionary["cancelButton"].Click += new EventHandler(CancelButtonClick);
- listView = (ListView)ControlDictionary["listView"];
- textBox = (TextBox)ControlDictionary["textBox"];
- textBox.TextChanged += TextBoxTextChanged;
- textBox.KeyDown += TextBoxKeyDown;
- listView.SmallImageList = ClassBrowserIconService.ImageList;
- listView.ItemActivate += OKButtonClick;
- listView.Sorting = SortOrder.Ascending;
- listView.SizeChanged += ListViewSizeChanged;
- listView.HideSelection = false;
- ListViewSizeChanged(null, null);
- Owner = WorkbenchSingleton.MainForm;
- Icon = null;
- FormLocationHelper.Apply(this, "ICSharpCode.SharpDevelop.Gui.GotoDialog.Bounds", true);
+ InitializeComponent();
+// FormLocationHelper.Apply(this, "ICSharpCode.SharpDevelop.Gui.GotoDialog.Bounds", true);
+ textBox.Focus();
+ ParserService.LoadSolutionProjectsThreadEnded += ParserService_LoadSolutionProjectsThreadEnded;
+ }
+
+ void ParserService_LoadSolutionProjectsThreadEnded(object sender, EventArgs e)
+ {
+ // refresh the list box contents when parsing has completed
+ Dispatcher.BeginInvoke(
+ System.Windows.Threading.DispatcherPriority.Background,
+ new Action(delegate { textBoxTextChanged(null, null); }));
}
- void ListViewSizeChanged(object sender, EventArgs e)
+ class MyListBoxItem : ListBoxItem, IComparable
{
- listView.Columns[0].Width = listView.Width - 24;
+ public readonly string Text;
+
+ public MyListBoxItem(string text, int imageIndex)
+ {
+ this.Text = text;
+ this.Content = new StackPanel {
+ Orientation = Orientation.Horizontal,
+ Children = {
+ PresentationResourceService.GetPixelSnappedImage(ClassBrowserIconService.ResourceNames[imageIndex]),
+ new TextBlock {
+ Text = text,
+ Margin = new Thickness(4, 0, 0, 0)
+ }
+ }
+ };
+ }
+
+ public int CompareTo(MyListBoxItem other)
+ {
+ return Text.CompareTo(other.Text);
+ }
}
- void TextBoxKeyDown(object sender, KeyEventArgs e)
+ void textBoxPreviewKeyDown(object sender, KeyEventArgs e)
{
- if (listView.SelectedItems.Count == 0)
+ if (listBox.SelectedItem == null)
return;
- if (e.KeyData == Keys.Up) {
+ if (e.Key == Key.Up) {
e.Handled = true;
ChangeIndex(-1);
- } else if (e.KeyData == Keys.Down) {
+ } else if (e.Key == Key.Down) {
e.Handled = true;
ChangeIndex(+1);
- } else if (e.KeyData == Keys.PageUp) {
+ } else if (e.Key == Key.PageUp) {
e.Handled = true;
- ChangeIndex(-listView.ClientSize.Height / listView.Items[0].Bounds.Height);
- } else if (e.KeyData == Keys.PageDown) {
+ ChangeIndex((int)Math.Round(-listBox.ActualHeight / ((ListBoxItem)listBox.SelectedItem).ActualHeight));
+ } else if (e.Key == Key.PageDown) {
e.Handled = true;
- ChangeIndex(+listView.ClientSize.Height / listView.Items[0].Bounds.Height);
+ ChangeIndex((int)Math.Round(+listBox.ActualHeight / ((ListBoxItem)listBox.SelectedItem).ActualHeight));
}
}
void ChangeIndex(int increment)
{
- int index = listView.SelectedIndices[0];
- index = Math.Max(0, Math.Min(listView.Items.Count - 1, index + increment));
- listView.Items[index].Selected = true;
- listView.EnsureVisible(index);
+ int index = listBox.SelectedIndex;
+ index = Math.Max(0, Math.Min(listBox.Items.Count - 1, index + increment));
+ ((ListBoxItem)listBox.Items[index]).IsSelected = true;
+ listBox.ScrollIntoView(listBox.Items[index]);
}
ICompletionData[] ctrlSpaceCompletionData;
@@ -127,21 +143,20 @@ namespace ICSharpCode.SharpDevelop.Gui
Dictionary visibleEntries = new Dictionary();
int bestMatchType;
double bestPriority;
- ListViewItem bestItem;
+ List newItems = new List();
+ ListBoxItem bestItem;
- void TextBoxTextChanged(object sender, EventArgs e)
+ void textBoxTextChanged(object sender, TextChangedEventArgs e)
{
string text = textBox.Text.Trim();
- listView.BeginUpdate();
- listView.Items.Clear();
+ listBox.Items.Clear();
+ newItems.Clear();
visibleEntries.Clear();
bestItem = null;
if (text.Length == 0) {
- listView.EndUpdate();
return;
}
if (text.Length == 1 && !char.IsDigit(text, 0)) {
- listView.EndUpdate();
return;
}
int dotPos = text.IndexOf('.');
@@ -190,11 +205,13 @@ namespace ICSharpCode.SharpDevelop.Gui
AddSourceFiles(text, 0);
ShowCtrlSpaceCompletion(text);
}
+ newItems.Sort();
+ foreach (MyListBoxItem item in newItems)
+ listBox.Items.Add(item);
if (bestItem != null) {
- bestItem.Selected = true;
- listView.EnsureVisible(bestItem.Index);
+ bestItem.IsSelected = true;
+ listBox.ScrollIntoView(bestItem);
}
- listView.EndUpdate();
}
void AddSourceFiles(string text, int lineNumber)
@@ -336,7 +353,8 @@ namespace ICSharpCode.SharpDevelop.Gui
if (visibleEntries.ContainsKey(text))
return;
visibleEntries.Add(text, null);
- ListViewItem item = new ListViewItem(text, imageIndex);
+ MyListBoxItem item = new MyListBoxItem(text, imageIndex);
+ item.MouseDoubleClick += okButtonClick;
item.Tag = tag;
if (bestItem == null
|| (tag is IMember && bestItem.Tag is IClass)
@@ -347,7 +365,7 @@ namespace ICSharpCode.SharpDevelop.Gui
bestPriority = priority;
bestMatchType = matchType;
}
- listView.Items.Add(item);
+ newItems.Add(item);
}
void AddItem(IClass c, int matchType)
@@ -369,7 +387,7 @@ namespace ICSharpCode.SharpDevelop.Gui
AddItem(e.Name + " (" + e.FullyQualifiedName + ")", imageIndex, e, priority, matchType);
}
- void CancelButtonClick(object sender, EventArgs e)
+ void cancelButtonClick(object sender, RoutedEventArgs e)
{
Close();
}
@@ -390,12 +408,12 @@ namespace ICSharpCode.SharpDevelop.Gui
return null;
}
- void OKButtonClick(object sender, EventArgs e)
+ void okButtonClick(object sender, RoutedEventArgs e)
{
try {
- if (listView.SelectedItems.Count == 0)
+ if (listBox.SelectedItem == null)
return;
- object tag = listView.SelectedItems[0].Tag;
+ object tag = ((ListBoxItem)listBox.SelectedItem).Tag;
if (tag is int) {
TextEditorControl editor = GetEditor();
if (editor != null) {
diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.xaml b/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.xaml
new file mode 100644
index 0000000000..0f7fb45828
--- /dev/null
+++ b/src/Main/Base/Project/Src/TextEditor/Gui/Dialogs/GotoDialog.xaml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs
index bd077f3fe8..fa3af66a9c 100644
--- a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs
+++ b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs
@@ -358,7 +358,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
public void ShowInsightWindow(IInsightDataProvider insightDataProvider)
{
if (insightWindow == null || insightWindow.IsDisposed) {
- insightWindow = new InsightWindow(WorkbenchSingleton.MainForm, this);
+ insightWindow = new InsightWindow(WorkbenchSingleton.MainWin32Window, this);
insightWindow.Closed += new EventHandler(CloseInsightWindow);
}
insightWindow.AddInsightDataProvider(insightDataProvider, this.FileName);
@@ -373,7 +373,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
public void ShowCompletionWindow(ICompletionDataProvider completionDataProvider, char ch)
{
- codeCompletionWindow = CodeCompletionWindow.ShowCompletionWindow(WorkbenchSingleton.MainForm, this, this.FileName, completionDataProvider, ch);
+ codeCompletionWindow = CodeCompletionWindow.ShowCompletionWindow(WorkbenchSingleton.MainWin32Window, this, this.FileName, completionDataProvider, ch);
if (codeCompletionWindow != null) {
codeCompletionWindow.Closed += new EventHandler(CloseCodeCompletionWindow);
}
diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorBasedPad.cs b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorBasedPad.cs
index 60d096c51b..670d05d9e5 100644
--- a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorBasedPad.cs
+++ b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorBasedPad.cs
@@ -23,7 +23,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
get;
}
- public override System.Windows.Forms.Control Control {
+ public override object Content {
get { return this.TextEditorControl; }
}
@@ -80,12 +80,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
this.TextEditorControl.Redo();
}
- public override void RedrawContent()
- {
- this.TextEditorControl.OptionsChanged();
- this.TextEditorControl.Refresh();
- }
-
#region IPositionable implementation
void IPositionable.JumpTo(int line, int column)
{
@@ -112,7 +106,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
}
#endregion
- Control IToolsHost.ToolsControl {
+ object IToolsHost.ToolsContent {
get { return TextEditorSideBar.Instance; }
}
diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs
index 6adcdec4c4..bcd14cd008 100644
--- a/src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs
+++ b/src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs
@@ -12,7 +12,7 @@ using System.IO;
using System.Windows.Forms;
using ICSharpCode.Core;
-using ICSharpCode.Core.WinForms;
+using ICSharpCode.Core.Presentation;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.TextEditor;
@@ -123,7 +123,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
}
}
- public override Control Control {
+ public override object Content {
get {
return textEditorControl;
}
@@ -189,12 +189,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
NavigationService.ContentChanging(this.textEditorControl, e);
}
- public override void RedrawContent()
- {
- textEditorControl.OptionsChanged();
- textEditorControl.Refresh();
- }
-
public override void Dispose()
{
if (this.PrimaryFile.IsUntitled) {
@@ -338,7 +332,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
void SetIcon()
{
if (this.WorkbenchWindow != null) {
- System.Drawing.Icon icon = WinFormsResourceService.GetIcon(IconService.GetImageForFile(this.PrimaryFileName));
+ var icon = PresentationResourceService.GetBitmapSource(IconService.GetImageForFile(this.PrimaryFileName));
if (icon != null) {
this.WorkbenchWindow.Icon = icon;
}
@@ -508,7 +502,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
}
#endregion
- Control IToolsHost.ToolsControl {
+ object IToolsHost.ToolsContent {
get { return TextEditorSideBar.Instance; }
}
}
diff --git a/src/Main/Base/Project/Src/TextEditor/Gui/OptionPanels/CodeTemplatePanel.cs b/src/Main/Base/Project/Src/TextEditor/Gui/OptionPanels/CodeTemplatePanel.cs
index fef7e84cea..1bd188e4c4 100644
--- a/src/Main/Base/Project/Src/TextEditor/Gui/OptionPanels/CodeTemplatePanel.cs
+++ b/src/Main/Base/Project/Src/TextEditor/Gui/OptionPanels/CodeTemplatePanel.cs
@@ -147,7 +147,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
{
CodeTemplate newTemplate = new CodeTemplate();
using (EditTemplateDialog etd = new EditTemplateDialog(newTemplate)) {
- if (etd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (etd.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
CurrentTemplateGroup.Templates.Add(newTemplate);
((ListView)ControlDictionary["templateListView"]).SelectedItems.Clear();
BuildListView();
@@ -165,7 +165,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
template = new CodeTemplate(template.Shortcut, template.Description, template.Text);
using (EditTemplateDialog etd = new EditTemplateDialog(template)) {
- if (etd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) {
+ if (etd.ShowDialog(WorkbenchSingleton.MainWin32Window) == DialogResult.OK) {
item.Tag = template;
StoreTemplateGroup();
}
diff --git a/src/Main/Base/Project/Src/Util/ExtensionMethods.cs b/src/Main/Base/Project/Src/Util/ExtensionMethods.cs
index d120c8f547..4a075b0909 100644
--- a/src/Main/Base/Project/Src/Util/ExtensionMethods.cs
+++ b/src/Main/Base/Project/Src/Util/ExtensionMethods.cs
@@ -10,7 +10,11 @@ using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
-using System.Windows.Forms;
+using System.Windows;
+using System.Windows.Controls;
+
+using WinForms = System.Windows.Forms;
+using System.Windows.Documents;
namespace ICSharpCode.SharpDevelop
{
@@ -50,14 +54,117 @@ namespace ICSharpCode.SharpDevelop
return string.Join(separator, input.ToArray());
}
- public static IEnumerable GetRecursive(this Control.ControlCollection collection)
+ public static IEnumerable GetRecursive(this WinForms.Control.ControlCollection collection)
{
- foreach (Control ctl in collection) {
+ foreach (WinForms.Control ctl in collection) {
yield return ctl;
- foreach (Control subCtl in ctl.Controls.GetRecursive()) {
+ foreach (WinForms.Control subCtl in ctl.Controls.GetRecursive()) {
yield return subCtl;
}
}
}
+
+ ///
+ /// Creates an array containing a part of the array (similar to string.Substring).
+ ///
+ public static T[] Splice(this T[] array, int startIndex)
+ {
+ if (array == null)
+ throw new ArgumentNullException("array");
+ return Splice(array, startIndex, array.Length - startIndex);
+ }
+
+ ///
+ /// Creates an array containing a part of the array (similar to string.Substring).
+ ///
+ public static T[] Splice(this T[] array, int startIndex, int length)
+ {
+ if (array == null)
+ throw new ArgumentNullException("array");
+ if (startIndex < 0 || startIndex > array.Length)
+ throw new ArgumentOutOfRangeException("startIndex", startIndex, "Value must be between 0 and " + array.Length);
+ if (length < 0 || length > array.Length - startIndex)
+ throw new ArgumentOutOfRangeException("length", length, "Value must be between 0 and " + (array.Length - startIndex));
+ T[] result = new T[length];
+ Array.Copy(array, startIndex, result, 0, length);
+ return result;
+ }
+
+ ///
+ /// Gets the IWin32Window associated with a WPF window.
+ ///
+ public static WinForms.IWin32Window GetWin32Window(this System.Windows.Window window)
+ {
+ var wnd = System.Windows.PresentationSource.FromVisual(window) as System.Windows.Interop.IWin32Window;
+ if (wnd != null)
+ return new Win32WindowAdapter(wnd);
+ else
+ return null;
+ }
+
+ sealed class Win32WindowAdapter : WinForms.IWin32Window
+ {
+ System.Windows.Interop.IWin32Window window;
+
+ public Win32WindowAdapter(System.Windows.Interop.IWin32Window window)
+ {
+ this.window = window;
+ }
+
+ public IntPtr Handle {
+ get { return window.Handle; }
+ }
+ }
+
+ ///
+ /// Sets the Content property of the specified ControlControl to the specified content.
+ /// If the content is a Windows-Forms control, it is wrapped in a WindowsFormsHost.
+ /// If the content control already contains a WindowsFormsHost with that content,
+ /// the old WindowsFormsHost is kept.
+ /// When a WindowsFormsHost is replaced with another content, the host is disposed (but the control
+ /// inside the host isn't)
+ ///
+ public static void SetContent(this ContentControl contentControl, object content)
+ {
+ if (contentControl == null)
+ throw new ArgumentNullException("contentControl");
+ var host = contentControl.Content as SDWindowsFormsHost;
+ if (host != null) {
+ if (host.Child == content)
+ return;
+ host.Dispose();
+ }
+ if (content is WinForms.Control) {
+ contentControl.Content = new SDWindowsFormsHost((WinForms.Control)content);
+ } else if (content is string) {
+ contentControl.Content = new TextBlock(new Run(content.ToString())) { TextWrapping = TextWrapping.Wrap };
+ } else {
+ contentControl.Content = content;
+ }
+ }
+
+ class SDWindowsFormsHost : WinForms.Integration.WindowsFormsHost
+ {
+ public SDWindowsFormsHost(WinForms.Control child)
+ {
+ this.Child = child;
+ child.Disposed += child_Disposed;
+ }
+
+ void child_Disposed(object sender, EventArgs e)
+ {
+ Dispose();
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && Child != null) {
+ Child.Disposed -= child_Disposed;
+ // prevent child from being disposed
+ Child = null;
+ }
+ base.Dispose(disposing);
+ }
+ }
}
}
diff --git a/src/Main/Base/Project/Src/Util/NativeMethods.cs b/src/Main/Base/Project/Src/Util/NativeMethods.cs
index dd9dc4fb2d..aaa258d4cf 100644
--- a/src/Main/Base/Project/Src/Util/NativeMethods.cs
+++ b/src/Main/Base/Project/Src/Util/NativeMethods.cs
@@ -99,7 +99,7 @@ namespace ICSharpCode.SharpDevelop
if (!File.Exists(fileName) && !Directory.Exists(fileName))
throw new FileNotFoundException("File not found.", fileName);
SHFILEOPSTRUCT info = new SHFILEOPSTRUCT();
- info.hwnd = Gui.WorkbenchSingleton.MainForm.Handle;
+ info.hwnd = Gui.WorkbenchSingleton.MainWin32Window.Handle;
info.wFunc = FO_FUNC.FO_DELETE;
info.fFlags = FILEOP_FLAGS.FOF_ALLOWUNDO | FILEOP_FLAGS.FOF_NOCONFIRMATION;
info.lpszProgressTitle = "Delete " + Path.GetFileName(fileName);
diff --git a/src/Main/Base/Project/Src/Util/WpfSynchronizeInvoke.cs b/src/Main/Base/Project/Src/Util/WpfSynchronizeInvoke.cs
new file mode 100644
index 0000000000..a02358f82d
--- /dev/null
+++ b/src/Main/Base/Project/Src/Util/WpfSynchronizeInvoke.cs
@@ -0,0 +1,113 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.ComponentModel;
+using System.Threading;
+using System.Windows.Threading;
+
+namespace ICSharpCode.SharpDevelop
+{
+ ///
+ /// Description of WpfSynchronizeInvoke.
+ ///
+ sealed class WpfSynchronizeInvoke : ISynchronizeInvoke
+ {
+ readonly Dispatcher dispatcher;
+
+ public WpfSynchronizeInvoke(Dispatcher dispatcher)
+ {
+ if (dispatcher == null)
+ throw new ArgumentNullException("dispatcher");
+ this.dispatcher = dispatcher;
+ }
+
+ public bool InvokeRequired {
+ get {
+ return !dispatcher.CheckAccess();
+ }
+ }
+
+ public IAsyncResult BeginInvoke(Delegate method, object[] args)
+ {
+ DispatcherOperation op;
+ if (args.Length == 0)
+ op = dispatcher.BeginInvoke(DispatcherPriority.Normal, method);
+ else if (args.Length == 1)
+ op = dispatcher.BeginInvoke(DispatcherPriority.Normal, method, args[0]);
+ else
+ op = dispatcher.BeginInvoke(DispatcherPriority.Normal, method, args[0], args.Splice(1));
+ return new AsyncResult(op);
+ }
+
+ sealed class AsyncResult : IAsyncResult
+ {
+ internal readonly DispatcherOperation op;
+ readonly object lockObj = new object();
+ ManualResetEvent resetEvent;
+
+ public AsyncResult(DispatcherOperation op)
+ {
+ this.op = op;
+ }
+
+ public bool IsCompleted {
+ get {
+ return op.Status == DispatcherOperationStatus.Completed;
+ }
+ }
+
+ public WaitHandle AsyncWaitHandle {
+ get {
+ lock (lockObj) {
+ if (resetEvent == null) {
+ op.Completed += op_Completed;
+ resetEvent = new ManualResetEvent(false);
+ if (IsCompleted)
+ resetEvent.Set();
+ }
+ return resetEvent;
+ }
+ }
+ }
+
+ void op_Completed(object sender, EventArgs e)
+ {
+ lock (lockObj) {
+ resetEvent.Set();
+ }
+ }
+
+ public object AsyncState {
+ get { return null; }
+ }
+
+ public bool CompletedSynchronously {
+ get { return false; }
+ }
+ }
+
+ public object EndInvoke(IAsyncResult result)
+ {
+ AsyncResult r = result as AsyncResult;
+ if (r == null)
+ throw new ArgumentException("result must be the return value of a WpfSynchronizeInvoke.BeginInvoke call!");
+ r.op.Wait();
+ return r.op.Result;
+ }
+
+ public object Invoke(Delegate method, object[] args)
+ {
+ if (args.Length == 0)
+ return dispatcher.Invoke(DispatcherPriority.Normal, method);
+ else if (args.Length == 1)
+ return dispatcher.Invoke(DispatcherPriority.Normal, method, args[0]);
+ else
+ return dispatcher.Invoke(DispatcherPriority.Normal, method, args[0], args.Splice(1));
+ }
+ }
+}
diff --git a/src/Main/Core/Project/Src/Services/ResourceService/ResourceService.cs b/src/Main/Core/Project/Src/Services/ResourceService/ResourceService.cs
index 14a0ce6fea..2c5b20ba79 100644
--- a/src/Main/Core/Project/Src/Services/ResourceService/ResourceService.cs
+++ b/src/Main/Core/Project/Src/Services/ResourceService/ResourceService.cs
@@ -50,6 +50,8 @@ namespace ICSharpCode.Core
}
}
+ static readonly object loadLock = new object();
+
/// English strings (list of resource managers)
static List strings = new List();
/// Neutral/English images (list of resource managers)
@@ -178,33 +180,34 @@ namespace ICSharpCode.Core
static void LoadLanguageResources(string language)
{
- if (ClearCaches != null)
- ClearCaches(null, EventArgs.Empty);
-
- try {
- Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(language);
- } catch (Exception) {
+ lock (loadLock) {
try {
- Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(language.Split('-')[0]);
- } catch (Exception) {}
- }
-
- localStrings = Load(stringResources, language);
- if (localStrings == null && language.IndexOf('-') > 0) {
- localStrings = Load(stringResources, language.Split('-')[0]);
- }
-
- localIcons = Load(imageResources, language);
- if (localIcons == null && language.IndexOf('-') > 0) {
- localIcons = Load(imageResources, language.Split('-')[0]);
- }
-
- localStringsResMgrs.Clear();
- localIconsResMgrs.Clear();
- currentLanguage = language;
- foreach (ResourceAssembly ra in resourceAssemblies) {
- ra.Load();
+ Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(language);
+ } catch (Exception) {
+ try {
+ Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(language.Split('-')[0]);
+ } catch (Exception) {}
+ }
+
+ localStrings = Load(stringResources, language);
+ if (localStrings == null && language.IndexOf('-') > 0) {
+ localStrings = Load(stringResources, language.Split('-')[0]);
+ }
+
+ localIcons = Load(imageResources, language);
+ if (localIcons == null && language.IndexOf('-') > 0) {
+ localIcons = Load(imageResources, language.Split('-')[0]);
+ }
+
+ localStringsResMgrs.Clear();
+ localIconsResMgrs.Clear();
+ currentLanguage = language;
+ foreach (ResourceAssembly ra in resourceAssemblies) {
+ ra.Load();
+ }
}
+ if (ClearCaches != null)
+ ClearCaches(null, EventArgs.Empty);
}
static Hashtable Load(string fileName)
@@ -241,68 +244,72 @@ namespace ICSharpCode.Core
///
public static string GetString(string name)
{
- if (localStrings != null && localStrings[name] != null) {
- return localStrings[name].ToString();
- }
-
- string s = null;
- foreach (ResourceManager resourceManger in localStringsResMgrs) {
- try {
- s = resourceManger.GetString(name);
- }
- catch (Exception) { }
-
- if (s != null) {
- break;
+ lock (loadLock) {
+ if (localStrings != null && localStrings[name] != null) {
+ return localStrings[name].ToString();
}
- }
-
- if (s == null) {
- foreach (ResourceManager resourceManger in strings) {
+
+ string s = null;
+ foreach (ResourceManager resourceManger in localStringsResMgrs) {
try {
s = resourceManger.GetString(name);
}
catch (Exception) { }
-
+
if (s != null) {
break;
}
}
+
+ if (s == null) {
+ foreach (ResourceManager resourceManger in strings) {
+ try {
+ s = resourceManger.GetString(name);
+ }
+ catch (Exception) { }
+
+ if (s != null) {
+ break;
+ }
+ }
+ }
+ if (s == null) {
+ throw new ResourceNotFoundException("string >" + name + "<");
+ }
+
+ return s;
}
- if (s == null) {
- throw new ResourceNotFoundException("string >" + name + "<");
- }
-
- return s;
}
public static object GetImageResource(string name)
{
- object iconobj = null;
- if (localIcons != null && localIcons[name] != null) {
- iconobj = localIcons[name];
- } else {
- foreach (ResourceManager resourceManger in localIconsResMgrs) {
- iconobj = resourceManger.GetObject(name);
- if (iconobj != null) {
- break;
- }
- }
-
- if (iconobj == null) {
- foreach (ResourceManager resourceManger in icons) {
- try {
- iconobj = resourceManger.GetObject(name);
- }
- catch (Exception) { }
-
+ lock (loadLock) {
+ object iconobj = null;
+ if (localIcons != null && localIcons[name] != null) {
+ iconobj = localIcons[name];
+ } else {
+ foreach (ResourceManager resourceManger in localIconsResMgrs) {
+ iconobj = resourceManger.GetObject(name);
if (iconobj != null) {
break;
}
}
+
+ if (iconobj == null) {
+ foreach (ResourceManager resourceManger in icons) {
+ try {
+ iconobj = resourceManger.GetObject(name);
+ }
+ catch (Exception) { }
+
+ if (iconobj != null) {
+ break;
+ }
+ }
+ }
}
+ return iconobj;
}
- return iconobj;
}
}
}
diff --git a/src/Main/ICSharpCode.Core.Presentation/ConditionalSeparator.cs b/src/Main/ICSharpCode.Core.Presentation/ConditionalSeparator.cs
new file mode 100644
index 0000000000..9bf65f80e8
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/ConditionalSeparator.cs
@@ -0,0 +1,44 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace ICSharpCode.Core.Presentation
+{
+ ///
+ /// A Separator that is invisible when it is excluded by a condition.
+ ///
+ sealed class ConditionalSeparator : Separator, IStatusUpdate
+ {
+ readonly Codon codon;
+ readonly object caller;
+
+ public ConditionalSeparator(Codon codon, object caller, bool inToolbar)
+ {
+ this.codon = codon;
+ this.caller = caller;
+
+ if (inToolbar) {
+ SetResourceReference(FrameworkElement.StyleProperty, ToolBar.SeparatorStyleKey);
+ }
+ }
+
+ public void UpdateText()
+ {
+ }
+
+ public void UpdateStatus()
+ {
+ if (codon.GetFailedAction(caller) == ConditionFailedAction.Exclude)
+ this.Visibility = Visibility.Collapsed;
+ else
+ this.Visibility = Visibility.Visible;
+ }
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/GetBitmapExtension.cs b/src/Main/ICSharpCode.Core.Presentation/GetBitmapExtension.cs
new file mode 100644
index 0000000000..4067b05450
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/GetBitmapExtension.cs
@@ -0,0 +1,30 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Windows.Markup;
+
+namespace ICSharpCode.Core.Presentation
+{
+ ///
+ /// Markup extension that gets a BitmapSource object for a ResourceService bitmap.
+ ///
+ public class GetBitmapExtension : MarkupExtension
+ {
+ public GetBitmapExtension(string key)
+ {
+ this.key = key;
+ }
+
+ protected string key;
+
+ public override object ProvideValue(IServiceProvider sp)
+ {
+ return PresentationResourceService.GetBitmapSource(key);
+ }
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj b/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj
new file mode 100644
index 0000000000..5056f24f1a
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/ICSharpCode.Core.Presentation.csproj
@@ -0,0 +1,86 @@
+
+
+ {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}
+ Debug
+ AnyCPU
+ Library
+ ICSharpCode.Core.Presentation
+ ICSharpCode.Core.Presentation
+ v3.0
+ Properties
+ "C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\Misc\SourceAnalysis\Settings.SourceAnalysis"
+ ..\..\..\bin\
+ False
+ False
+ 4
+ false
+ True
+ ..\ICSharpCode.SharpDevelop.snk
+ False
+ File
+
+
+ true
+ Full
+ False
+ True
+ DEBUG;TRACE
+
+
+ False
+ None
+ True
+ False
+ TRACE
+
+
+ False
+ Auto
+ 4194304
+ AnyCPU
+ 4096
+
+
+
+
+ 3.0
+
+
+ 3.0
+
+
+
+
+
+ 3.0
+
+
+
+
+ Properties\GlobalAssemblyInfo.cs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}
+ ICSharpCode.Core
+ False
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Main/ICSharpCode.Core.Presentation/IStatusUpdate.cs b/src/Main/ICSharpCode.Core.Presentation/IStatusUpdate.cs
new file mode 100644
index 0000000000..41049c3470
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/IStatusUpdate.cs
@@ -0,0 +1,17 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+
+namespace ICSharpCode.Core.Presentation
+{
+ public interface IStatusUpdate
+ {
+ void UpdateText();
+ void UpdateStatus();
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/LocalizeExtension.cs b/src/Main/ICSharpCode.Core.Presentation/LocalizeExtension.cs
new file mode 100644
index 0000000000..9ae3dd12d6
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/LocalizeExtension.cs
@@ -0,0 +1,30 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Windows.Markup;
+
+namespace ICSharpCode.Core.Presentation
+{
+ ///
+ /// Markup extension that retrieves localized resource strings.
+ ///
+ public class LocalizeExtension : MarkupExtension
+ {
+ public LocalizeExtension(string key)
+ {
+ this.key = key;
+ }
+
+ protected string key;
+
+ public override object ProvideValue(IServiceProvider sp)
+ {
+ return ResourceService.GetString(key);
+ }
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/Menu/CoreMenuItem.cs b/src/Main/ICSharpCode.Core.Presentation/Menu/CoreMenuItem.cs
new file mode 100644
index 0000000000..e2642e0acd
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/Menu/CoreMenuItem.cs
@@ -0,0 +1,54 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Collections;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+
+namespace ICSharpCode.Core.Presentation
+{
+ ///
+ /// A menu item representing an AddIn-Tree element.
+ ///
+ class CoreMenuItem : MenuItem, IStatusUpdate
+ {
+ protected readonly Codon codon;
+ protected readonly object caller;
+
+ public CoreMenuItem(Codon codon, object caller)
+ {
+ this.codon = codon;
+ this.caller = caller;
+
+ if (codon.Properties.Contains("icon")) {
+ try {
+ var image = PresentationResourceService.GetImage(codon.Properties["icon"]);
+ image.Height = 16;
+ this.Icon = new PixelSnapper(image);
+ } catch (ResourceNotFoundException) {}
+ }
+ UpdateText();
+ }
+
+ public void UpdateText()
+ {
+ if (codon != null) {
+ Header = MenuService.ConvertLabel(StringParser.Parse(codon.Properties["label"]));
+ }
+ }
+
+ public virtual void UpdateStatus()
+ {
+ if (codon.GetFailedAction(caller) == ConditionFailedAction.Exclude)
+ this.Visibility = Visibility.Collapsed;
+ else
+ this.Visibility = Visibility.Visible;
+ }
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/Menu/IMenuItemBuilder.cs b/src/Main/ICSharpCode.Core.Presentation/Menu/IMenuItemBuilder.cs
new file mode 100644
index 0000000000..09bf26cbb1
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/Menu/IMenuItemBuilder.cs
@@ -0,0 +1,20 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Collections;
+
+namespace ICSharpCode.Core.Presentation
+{
+ ///
+ /// Description of IMenuItemBuilder.
+ ///
+ public interface IMenuItemBuilder
+ {
+ ICollection BuildItems(Codon codon, object owner);
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/Menu/MenuCommand.cs b/src/Main/ICSharpCode.Core.Presentation/Menu/MenuCommand.cs
new file mode 100644
index 0000000000..e66618f776
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/Menu/MenuCommand.cs
@@ -0,0 +1,105 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Collections;
+using System.Diagnostics;
+using System.Threading;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+
+namespace ICSharpCode.Core.Presentation
+{
+ class CommandWrapper : System.Windows.Input.ICommand
+ {
+ bool commandCreated;
+ ICommand addInCommand;
+ readonly Codon codon;
+ readonly object caller;
+
+ public CommandWrapper(Codon codon, object caller, bool createCommand)
+ {
+ this.codon = codon;
+ this.caller = caller;
+ if (createCommand) {
+ commandCreated = true;
+ CreateCommand();
+ }
+ }
+
+ void CreateCommand()
+ {
+ commandCreated = true;
+ try {
+ string link = codon.Properties["link"];
+ ICommand menuCommand;
+ if (link != null && link.Length > 0) {
+ if (MenuService.LinkCommandCreator == null)
+ throw new NotSupportedException("MenuCommand.LinkCommandCreator is not set, cannot create LinkCommands.");
+ menuCommand = MenuService.LinkCommandCreator(codon.Properties["link"]);
+ } else {
+ menuCommand = (ICommand)codon.AddIn.CreateObject(codon.Properties["class"]);
+ }
+ if (menuCommand != null) {
+ menuCommand.Owner = caller;
+ }
+ addInCommand = menuCommand;
+ } catch (Exception e) {
+ MessageService.ShowError(e, "Can't create menu command : " + codon.Id);
+ }
+ }
+
+ public event EventHandler CanExecuteChanged {
+ add { CommandManager.RequerySuggested += value; }
+ remove { CommandManager.RequerySuggested -= value; }
+ }
+
+ public void Execute(object parameter)
+ {
+ if (!commandCreated) {
+ CreateCommand();
+ }
+ LoggingService.Debug("Execute " + codon.Id);
+ if (CanExecute(parameter)) {
+ addInCommand.Run();
+ }
+ }
+
+ public bool CanExecute(object parameter)
+ {
+ //LoggingService.Debug("CanExecute " + codon.Id);
+ if (codon.GetFailedAction(caller) != ConditionFailedAction.Nothing)
+ return false;
+ if (!commandCreated)
+ return true;
+ if (addInCommand == null)
+ return false;
+ IMenuCommand menuCommand = addInCommand as IMenuCommand;
+ if (menuCommand != null) {
+ return menuCommand.IsEnabled;
+ } else {
+ return true;
+ }
+ }
+ }
+
+ class MenuCommand : CoreMenuItem
+ {
+ public MenuCommand(UIElement inputBindingOwner, Codon codon, object caller, bool createCommand) : base(codon, caller)
+ {
+ this.Command = new CommandWrapper(codon, caller, createCommand);
+ if (!string.IsNullOrEmpty(codon.Properties["shortcut"])) {
+ KeyGesture kg = MenuService.ParseShortcut(codon.Properties["shortcut"]);
+ inputBindingOwner.InputBindings.Add(
+ new InputBinding(this.Command, kg)
+ );
+ this.InputGestureText = kg.GetDisplayStringForCulture(Thread.CurrentThread.CurrentUICulture);
+ }
+ }
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/Menu/MenuService.cs b/src/Main/ICSharpCode.Core.Presentation/Menu/MenuService.cs
new file mode 100644
index 0000000000..f7867efe74
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/Menu/MenuService.cs
@@ -0,0 +1,141 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
+
+namespace ICSharpCode.Core.Presentation
+{
+ ///
+ /// Creates WPF menu controls from the AddIn Tree.
+ ///
+ public static class MenuService
+ {
+ public static void UpdateStatus(IEnumerable menuItems)
+ {
+ if (menuItems == null)
+ return;
+ foreach (object o in menuItems) {
+ IStatusUpdate cmi = o as IStatusUpdate;
+ if (cmi != null)
+ cmi.UpdateStatus();
+ }
+ }
+
+ public static ContextMenu CreateContextMenu(object owner, string addInTreePath)
+ {
+ return null;
+ }
+
+ public static IList CreateMenuItems(UIElement inputBindingOwner, object owner, string addInTreePath)
+ {
+ return CreateMenuItems(inputBindingOwner, AddInTree.BuildItems(addInTreePath, owner, false));
+ }
+
+ sealed class MenuItemBuilderPlaceholder
+ {
+ readonly IMenuItemBuilder builder;
+ readonly Codon codon;
+ readonly object caller;
+
+ public MenuItemBuilderPlaceholder(IMenuItemBuilder builder, Codon codon, object caller)
+ {
+ this.builder = builder;
+ this.codon = codon;
+ this.caller = caller;
+ }
+
+ public ICollection BuildItems()
+ {
+ return builder.BuildItems(codon, caller);
+ }
+ }
+
+ internal static IList CreateMenuItems(UIElement inputBindingOwner, IEnumerable descriptors)
+ {
+ ArrayList result = new ArrayList();
+ foreach (MenuItemDescriptor descriptor in descriptors) {
+ result.Add(CreateMenuItemFromDescriptor(inputBindingOwner, descriptor));
+ }
+ return result;
+ }
+
+ internal static IList ExpandMenuBuilders(ICollection input)
+ {
+ ArrayList result = new ArrayList(input.Count);
+ foreach (object o in input) {
+ MenuItemBuilderPlaceholder p = o as MenuItemBuilderPlaceholder;
+ if (p != null) {
+ result.AddRange(p.BuildItems());
+ } else {
+ result.Add(o);
+ IStatusUpdate statusUpdate = o as IStatusUpdate;
+ if (statusUpdate != null) {
+ statusUpdate.UpdateStatus();
+ statusUpdate.UpdateText();
+ }
+ }
+ }
+ return result;
+ }
+
+ static object CreateMenuItemFromDescriptor(UIElement inputBindingOwner, MenuItemDescriptor descriptor)
+ {
+ Codon codon = descriptor.Codon;
+ string type = codon.Properties.Contains("type") ? codon.Properties["type"] : "Command";
+ bool createCommand = codon.Properties["loadclasslazy"] == "false";
+
+ switch (type) {
+ case "Separator":
+ return new ConditionalSeparator(codon, descriptor.Caller, false);
+ case "CheckBox":
+ return "CheckBox";
+ //return new MenuCheckBox(codon, descriptor.Caller);
+ case "Item":
+ case "Command":
+ return new MenuCommand(inputBindingOwner, codon, descriptor.Caller, createCommand);
+ case "Menu":
+ var item = new CoreMenuItem(codon, descriptor.Caller) {
+ ItemsSource = new object[1]
+ };
+ var subItems = CreateMenuItems(inputBindingOwner, descriptor.SubItems);
+ item.SubmenuOpened += (sender, args) => {
+ item.ItemsSource = ExpandMenuBuilders(subItems);
+ args.Handled = true;
+ };
+ return item;
+ case "Builder":
+ IMenuItemBuilder builder = codon.AddIn.CreateObject(codon.Properties["class"]) as IMenuItemBuilder;
+ if (builder == null)
+ throw new NotSupportedException("Menu item builder " + codon.Properties["class"] + " does not implement IMenuItemBuilder");
+ return new MenuItemBuilderPlaceholder(builder, descriptor.Codon, descriptor.Caller);
+ default:
+ throw new System.NotSupportedException("unsupported menu item type : " + type);
+ }
+ }
+
+ public static string ConvertLabel(string label)
+ {
+ return label.Replace("_", "__").Replace("&", "_");
+ }
+
+ // HACK: find a better way to allow the host app to process link commands
+ public static Converter LinkCommandCreator;
+
+ ///
+ /// Creates an KeyGesture for a shortcut.
+ ///
+ public static KeyGesture ParseShortcut(string text)
+ {
+ return (KeyGesture)new KeyGestureConverter().ConvertFromInvariantString(text.Replace(',', '+').Replace('|', '+'));
+ }
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/PixelSnapper.cs b/src/Main/ICSharpCode.Core.Presentation/PixelSnapper.cs
new file mode 100644
index 0000000000..b5dbe1ae29
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/PixelSnapper.cs
@@ -0,0 +1,174 @@
+//
+//
+//
+//
+// $Revision$
+//
+using System;
+using System.Threading;
+using System.Windows;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Threading;
+
+namespace ICSharpCode.Core.Presentation
+{
+ ///
+ /// A WPF control that aligns its content on pixel boundaries.
+ ///
+ public class PixelSnapper : UIElement
+ {
+ public PixelSnapper()
+ {
+ }
+
+ public PixelSnapper(UIElement visualChild)
+ : this()
+ {
+ this.Child = visualChild;
+ }
+
+ UIElement _visualChild;
+
+ ///
+ /// Gets/sets the visual child.
+ ///
+ public UIElement Child {
+ get { return _visualChild; }
+ set {
+ RemoveVisualChild(_visualChild);
+ _visualChild = value;
+ AddVisualChild(_visualChild);
+ InvalidateMeasure();
+ }
+ }
+
+ ///
+ /// Gets the visual child.
+ ///
+ protected override Visual GetVisualChild(int index)
+ {
+ if (index == 0 && _visualChild != null)
+ return _visualChild;
+ else
+ throw new ArgumentOutOfRangeException("index");
+ }
+
+ ///
+ /// Gets the number of visual children.
+ ///
+ protected override int VisualChildrenCount {
+ get { return _visualChild != null ? 1 : 0; }
+ }
+
+ ///
+ /// Measure the visual child.
+ ///
+ protected override Size MeasureCore(Size availableSize)
+ {
+ if (_visualChild != null) {
+ _visualChild.Measure(availableSize);
+ return _visualChild.DesiredSize;
+ } else {
+ return base.MeasureCore(availableSize);
+ }
+ }
+
+ protected override void ArrangeCore(Rect finalRect)
+ {
+ base.ArrangeCore(finalRect);
+ if (_visualChild != null) {
+ _pixelOffset = GetPixelOffset();
+ //LoggingService.Debug("Arrange, Pixel Offset=" + _pixelOffset);
+ _visualChild.Arrange(new Rect(new Point(_pixelOffset.X, _pixelOffset.Y), finalRect.Size));
+
+ // check again after the whole layout pass has finished, maybe we need to move
+ Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new ThreadStart(CheckLayout));
+ }
+ }
+
+ private void CheckLayout()
+ {
+ 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) {
+ m *= transform.Value;
+ }
+
+ Vector offset = VisualTreeHelper.GetOffset(v);
+ m.Translate(offset.X, offset.Y);
+
+ return m;
+ }
+
+ return Matrix.Identity;
+ }
+
+ private Point ApplyVisualTransform(Point point, Visual v, bool inverse)
+ {
+ if (v != null) {
+ Matrix visualTransform = GetVisualTransform(v);
+ if (inverse)
+ visualTransform.Invert();
+ point = visualTransform.Transform(point);
+ }
+ return point;
+ }
+
+ 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));
+ }
+
+ private Point _pixelOffset;
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/PresentationResourceService.cs b/src/Main/ICSharpCode.Core.Presentation/PresentationResourceService.cs
new file mode 100644
index 0000000000..298a80f148
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/PresentationResourceService.cs
@@ -0,0 +1,105 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Runtime.InteropServices;
+using System.Windows;
+using System.Windows.Interop;
+using System.Windows.Media.Imaging;
+
+namespace ICSharpCode.Core.Presentation
+{
+ ///
+ /// Creates WPF BitmapSource objects from images in the ResourceService.
+ ///
+ public static class PresentationResourceService
+ {
+ static readonly Dictionary bitmapCache = new Dictionary();
+
+ static PresentationResourceService()
+ {
+ ResourceService.ClearCaches += ResourceService_ClearCaches;
+ }
+
+ static void ResourceService_ClearCaches(object sender, EventArgs e)
+ {
+ lock (bitmapCache) {
+ bitmapCache.Clear();
+ }
+ }
+
+ ///
+ /// Creates a new System.Windows.Controls.Image object containing the image with the
+ /// specified resource name.
+ ///
+ ///
+ /// The name of the requested bitmap.
+ ///
+ ///
+ /// Is thrown when the GlobalResource manager can't find a requested resource.
+ ///
+ public static System.Windows.Controls.Image GetImage(string name)
+ {
+ return new System.Windows.Controls.Image {
+ Source = GetBitmapSource(name)
+ };
+ }
+
+ ///
+ /// Creates a new PixelSnapper object containing the image with the
+ /// specified resource name.
+ ///
+ ///
+ /// The name of the requested bitmap.
+ ///
+ ///
+ /// Is thrown when the GlobalResource manager can't find a requested resource.
+ ///
+ public static PixelSnapper GetPixelSnappedImage(string name)
+ {
+ return new PixelSnapper(GetImage(name));
+ }
+
+ ///
+ /// Returns a BitmapSource from the resource database, it handles localization
+ /// transparent for the user.
+ ///
+ ///
+ /// The name of the requested bitmap.
+ ///
+ ///
+ /// Is thrown when the GlobalResource manager can't find a requested resource.
+ ///
+ public static BitmapSource GetBitmapSource(string name)
+ {
+ lock (bitmapCache) {
+ BitmapSource bs;
+ if (bitmapCache.TryGetValue(name, out bs))
+ return bs;
+ System.Drawing.Bitmap bmp = (System.Drawing.Bitmap)ResourceService.GetImageResource(name);
+ if (bmp == null) {
+ throw new ResourceNotFoundException(name);
+ }
+ IntPtr hBitmap = bmp.GetHbitmap();
+ try {
+ bs = Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero,
+ Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
+ bs.Freeze();
+ bitmapCache[name] = bs;
+ } finally {
+ DeleteObject(hBitmap);
+ }
+ return bs;
+ }
+ }
+
+ [DllImport("gdi32.dll")]
+ static extern bool DeleteObject(IntPtr hObject);
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/Properties/AssemblyInfo.cs b/src/Main/ICSharpCode.Core.Presentation/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..9dc85d4aec
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/Properties/AssemblyInfo.cs
@@ -0,0 +1,23 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Windows.Markup;
+
+[assembly: CLSCompliant(true)]
+[assembly: StringFreezing()]
+
+[assembly: AssemblyTitle("ICSharpCode.Core.Presentation")]
+[assembly: AssemblyDescription("ICSharpCode.Core, Windows Presentation Foundation implementation")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: XmlnsPrefix("http://icsharpcode.net/sharpdevelop/core", "core")]
+[assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/core", "ICSharpCode.Core.Presentation")]
diff --git a/src/Main/ICSharpCode.Core.Presentation/ToolBar/ToolBarButton.cs b/src/Main/ICSharpCode.Core.Presentation/ToolBar/ToolBarButton.cs
new file mode 100644
index 0000000000..a00e4317e4
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/ToolBar/ToolBarButton.cs
@@ -0,0 +1,60 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace ICSharpCode.Core.Presentation
+{
+ ///
+ /// A tool bar button based on the AddIn-tree.
+ ///
+ sealed class ToolBarButton : Button, IStatusUpdate
+ {
+ readonly Codon codon;
+ readonly object caller;
+
+ public ToolBarButton(Codon codon, object caller, bool createCommand)
+ {
+ ToolTipService.SetShowOnDisabled(this, true);
+
+ this.codon = codon;
+ this.caller = caller;
+ this.Command = new CommandWrapper(codon, caller, createCommand);
+
+ if (codon.Properties.Contains("icon")) {
+ var image = PresentationResourceService.GetImage(StringParser.Parse(codon.Properties["icon"]));
+ image.Height = 16;
+ image.SetResourceReference(StyleProperty, ToolBarService.ImageStyleKey);
+ this.Content = new PixelSnapper(image);
+ }
+ UpdateText();
+
+ SetResourceReference(FrameworkElement.StyleProperty, ToolBar.ButtonStyleKey);
+ }
+
+ public void UpdateText()
+ {
+ if (codon.Properties.Contains("label")){
+ this.Content = StringParser.Parse(codon.Properties["label"]);
+ }
+ if (codon.Properties.Contains("tooltip")) {
+ this.ToolTip = StringParser.Parse(codon.Properties["tooltip"]);
+ }
+ }
+
+ public void UpdateStatus()
+ {
+ if (codon.GetFailedAction(caller) == ConditionFailedAction.Exclude)
+ this.Visibility = Visibility.Collapsed;
+ else
+ this.Visibility = Visibility.Visible;
+ }
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/ToolBar/ToolBarComboBox.cs b/src/Main/ICSharpCode.Core.Presentation/ToolBar/ToolBarComboBox.cs
new file mode 100644
index 0000000000..0c0e7e9217
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/ToolBar/ToolBarComboBox.cs
@@ -0,0 +1,31 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Windows.Controls;
+
+namespace ICSharpCode.Core.Presentation
+{
+ sealed class ToolBarComboBox : ComboBox
+ {
+// readonly Codon codon;
+// readonly object caller;
+ IComboBoxCommand menuCommand;
+
+ public ToolBarComboBox(Codon codon, object caller)
+ {
+ this.IsEditable = false;
+ menuCommand = (IComboBoxCommand)codon.AddIn.CreateObject(codon.Properties["class"]);
+ menuCommand.Owner = this;
+ }
+ protected override void OnSelectionChanged(SelectionChangedEventArgs e)
+ {
+ base.OnSelectionChanged(e);
+ menuCommand.Run();
+ }
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.Presentation/ToolBar/ToolBarService.cs b/src/Main/ICSharpCode.Core.Presentation/ToolBar/ToolBarService.cs
new file mode 100644
index 0000000000..ab1333bd81
--- /dev/null
+++ b/src/Main/ICSharpCode.Core.Presentation/ToolBar/ToolBarService.cs
@@ -0,0 +1,116 @@
+//
+//
+//
+//
+// $Revision$
+//
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Windows.Controls;
+
+namespace ICSharpCode.Core.Presentation
+{
+ ///
+ /// Creates WPF toolbars from the AddIn Tree.
+ ///
+ public static class ToolBarService
+ {
+ ///
+ /// Style key used for toolbar images.
+ ///
+ public static readonly object ImageStyleKey = new object();
+
+ public static void UpdateStatus(IEnumerable toolBarItems)
+ {
+ MenuService.UpdateStatus(toolBarItems);
+ }
+
+ public static IList CreateToolBarItems(object owner, string addInTreePath)
+ {
+ return CreateToolBarItems(AddInTree.BuildItems(addInTreePath, owner, false));
+ }
+
+ static IList CreateToolBarItems(IEnumerable descriptors)
+ {
+ ArrayList result = new ArrayList();
+ foreach (ToolbarItemDescriptor descriptor in descriptors) {
+ object item = CreateToolBarItemFromDescriptor(descriptor);
+ if (item is IMenuItemBuilder) {
+ IMenuItemBuilder submenuBuilder = (IMenuItemBuilder)item;
+ result.AddRange(submenuBuilder.BuildItems(descriptor.Codon, descriptor.Caller));
+ } else {
+ result.Add(item);
+ }
+ }
+ return result;
+ }
+
+ static object CreateToolBarItemFromDescriptor(ToolbarItemDescriptor descriptor)
+ {
+ Codon codon = descriptor.Codon;
+ object caller = descriptor.Caller;
+ string type = codon.Properties.Contains("type") ? codon.Properties["type"] : "Item";
+
+ bool createCommand = codon.Properties["loadclasslazy"] == "false";
+
+ switch (type) {
+ case "Separator":
+ return new ConditionalSeparator(codon, caller, true);
+ case "CheckBox":
+ return "CheckBox";
+ //return new ToolBarCheckBox(codon, caller);
+ case "Item":
+ return new ToolBarButton(codon, caller, createCommand);
+ case "ComboBox":
+ return new ToolBarComboBox(codon, caller);
+ case "TextBox":
+ return "TextBox";
+ //return new ToolBarTextBox(codon, caller);
+ case "Label":
+ return "Label";
+ //return new ToolBarLabel(codon, caller);
+ case "DropDownButton":
+ return "DropDownButton";
+ //return new ToolBarDropDownButton(codon, caller, MenuService.CreateMenuItems(descriptor.SubItems));
+ case "SplitButton":
+ return "SplitButton";
+ //return new ToolBarSplitButton(codon, caller, MenuService.CreateMenuItems(descriptor.SubItems));
+ case "Builder":
+ return codon.AddIn.CreateObject(codon.Properties["class"]);
+ default:
+ throw new System.NotSupportedException("unsupported menu item type : " + type);
+ }
+ }
+
+ static ToolBar CreateToolBar(object owner, AddInTreeNode treeNode)
+ {
+ ToolBar tb = new ToolBar();
+ tb.ItemsSource = CreateToolBarItems(treeNode.BuildChildItems(owner));
+ UpdateStatus(tb.ItemsSource); // setting Visible is only possible after the items have been added
+ //new LanguageChangeWatcher(toolStrip);
+ return tb;
+ }
+
+ public static ToolBar CreateToolBar(object owner, string addInTreePath)
+ {
+ return CreateToolBar(owner, AddInTree.GetTreeNode(addInTreePath));
+ }
+
+ public static ToolBar[] CreateToolBars(object owner, string addInTreePath)
+ {
+ AddInTreeNode treeNode;
+ try {
+ treeNode = AddInTree.GetTreeNode(addInTreePath);
+ } catch (TreePathNotFoundException) {
+ return null;
+ }
+ List toolBars = new List();
+ foreach (AddInTreeNode childNode in treeNode.ChildNodes.Values) {
+ toolBars.Add(CreateToolBar(owner, childNode));
+ }
+ return toolBars.ToArray();
+ }
+ }
+}
diff --git a/src/Main/ICSharpCode.Core.WinForms/Menu/MenuService.cs b/src/Main/ICSharpCode.Core.WinForms/Menu/MenuService.cs
index 8ee255b6bf..f72169c806 100644
--- a/src/Main/ICSharpCode.Core.WinForms/Menu/MenuService.cs
+++ b/src/Main/ICSharpCode.Core.WinForms/Menu/MenuService.cs
@@ -30,7 +30,7 @@ namespace ICSharpCode.Core.WinForms
((IStatusUpdate)item).UpdateStatus();
} else {
ISubmenuBuilder submenuBuilder = (ISubmenuBuilder)item;
- collection.AddRange(submenuBuilder.BuildSubmenu(null, descriptor.Caller));
+ collection.AddRange(submenuBuilder.BuildSubmenu(descriptor.Codon, descriptor.Caller));
}
}
}
diff --git a/src/Main/ICSharpCode.Core.WinForms/Properties/AssemblyInfo.cs b/src/Main/ICSharpCode.Core.WinForms/Properties/AssemblyInfo.cs
index f876a4bc0f..a06970cd94 100644
--- a/src/Main/ICSharpCode.Core.WinForms/Properties/AssemblyInfo.cs
+++ b/src/Main/ICSharpCode.Core.WinForms/Properties/AssemblyInfo.cs
@@ -12,8 +12,8 @@ using System.Runtime.CompilerServices;
[assembly: CLSCompliant(true)]
[assembly: StringFreezing()]
-[assembly: AssemblyTitle("ICSharpCode.Core")]
-[assembly: AssemblyDescription("The ICSharpCode Core containing the AddInTree and service Subsystem")]
+[assembly: AssemblyTitle("ICSharpCode.Core.WinForms")]
+[assembly: AssemblyDescription("ICSharpCode.Core, Windows.Forms implementation")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
diff --git a/src/Main/ICSharpCode.Core.WinForms/ToolBar/ToolBarService.cs b/src/Main/ICSharpCode.Core.WinForms/ToolBar/ToolBarService.cs
index 51028bbe2c..716fda2598 100644
--- a/src/Main/ICSharpCode.Core.WinForms/ToolBar/ToolBarService.cs
+++ b/src/Main/ICSharpCode.Core.WinForms/ToolBar/ToolBarService.cs
@@ -29,7 +29,7 @@ namespace ICSharpCode.Core.WinForms
collection.Add((ToolStripItem)item);
} else {
ISubmenuBuilder submenuBuilder = (ISubmenuBuilder)item;
- collection.AddRange(submenuBuilder.BuildSubmenu(null, owner));
+ collection.AddRange(submenuBuilder.BuildSubmenu(descriptor.Codon, owner));
}
}
diff --git a/src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj b/src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj
index bd0e82b3fd..f14df9ee7d 100644
--- a/src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj
+++ b/src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.csproj
@@ -49,11 +49,20 @@
..\..\Libraries\log4net\log4net.dll
+
+ 3.0
+
+
+ 3.0
+
+
+ 3.0
+
@@ -89,6 +98,11 @@
Always
+
+ {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}
+ ICSharpCode.Core.Presentation
+ False
+
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}
ICSharpCode.Core.WinForms
diff --git a/src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs b/src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs
index 6bff317dfe..53ec7186ca 100644
--- a/src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs
+++ b/src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs
@@ -19,6 +19,7 @@ using ICSharpCode.Core;
using ICSharpCode.Core.WinForms;
using ICSharpCode.SharpDevelop.Commands;
using ICSharpCode.SharpDevelop.Gui;
+using System.Windows;
namespace ICSharpCode.SharpDevelop.Sda
{
@@ -66,6 +67,7 @@ namespace ICSharpCode.SharpDevelop.Sda
ResourceService.RegisterNeutralImages(new ResourceManager("Resources.BitmapResources", exe));
MenuCommand.LinkCommandCreator = delegate(string link) { return new LinkCommand(link); };
+ Core.Presentation.MenuService.LinkCommandCreator = MenuCommand.LinkCommandCreator;
StringParser.RegisterStringTagProvider(new SharpDevelopStringTagProvider());
LoggingService.Info("Looking for AddIns...");
@@ -233,8 +235,8 @@ namespace ICSharpCode.SharpDevelop.Sda
vc.WorkbenchWindow.CloseWindow(true);
}
}
- WorkbenchSingleton.MainForm.Close();
- return WorkbenchSingleton.MainForm.IsDisposed;
+ WorkbenchSingleton.MainWindow.Close();
+ return WorkbenchSingleton.MainWindow == null;
}
[SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
@@ -261,11 +263,11 @@ namespace ICSharpCode.SharpDevelop.Sda
}
bool GetWorkbenchVisibleInternal()
{
- return WorkbenchSingleton.MainForm.Visible;
+ return WorkbenchSingleton.MainWindow.Visibility == Visibility.Visible;
}
void SetWorkbenchVisibleInternal(bool value)
{
- WorkbenchSingleton.MainForm.Visible = value;
+ WorkbenchSingleton.MainWindow.Visibility = value ? Visibility.Visible : Visibility.Hidden;
}
}
}
diff --git a/src/Main/ICSharpCode.SharpDevelop.Sda/Src/ExceptionBox.cs b/src/Main/ICSharpCode.SharpDevelop.Sda/Src/ExceptionBox.cs
index cc030c8f27..de5b3b202f 100644
--- a/src/Main/ICSharpCode.SharpDevelop.Sda/Src/ExceptionBox.cs
+++ b/src/Main/ICSharpCode.SharpDevelop.Sda/Src/ExceptionBox.cs
@@ -15,6 +15,7 @@ using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.Core.WinForms;
+using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.SharpDevelop.Sda
{
@@ -40,6 +41,13 @@ namespace ICSharpCode.SharpDevelop.Sda
Application.ThreadException += ShowErrorBox;
AppDomain.CurrentDomain.UnhandledException += ShowErrorBox;
MessageService.CustomErrorReporter = ShowErrorBox;
+ System.Windows.Threading.Dispatcher.CurrentDispatcher.UnhandledException += Dispatcher_UnhandledException;
+ }
+
+ static void Dispatcher_UnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
+ {
+ ShowErrorBox(e.Exception, "Unhandled WPF exception", false);
+ e.Handled = true;
}
static void ShowErrorBox(object sender, ThreadExceptionEventArgs e)
@@ -69,7 +77,7 @@ namespace ICSharpCode.SharpDevelop.Sda
try {
using (ExceptionBox box = new ExceptionBox(exception, message, mustTerminate)) {
try {
- box.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
+ box.ShowDialog(WorkbenchSingleton.MainWin32Window);
} catch (InvalidOperationException) {
box.ShowDialog();
}
diff --git a/src/Main/StartUp/Project/app.template.config b/src/Main/StartUp/Project/app.template.config
index b47ecd6a89..2df06903a9 100644
--- a/src/Main/StartUp/Project/app.template.config
+++ b/src/Main/StartUp/Project/app.template.config
@@ -21,6 +21,10 @@
+
+
+
+
diff --git a/src/SharpDevelop.sln b/src/SharpDevelop.sln
index 128ae239d2..9acc40f795 100644
--- a/src/SharpDevelop.sln
+++ b/src/SharpDevelop.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
-# SharpDevelop 3.0.0.3280
+# SharpDevelop 3.0.0.3360
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AddIns", "AddIns", "{14A277EE-7DF1-4529-B639-7D1EF334C1C5}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
@@ -10,8 +10,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{CE5B42B7-6
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpRefactoring", "AddIns\Misc\SharpRefactoring\SharpRefactoring.csproj", "{3CA90546-3B4C-4663-9445-C4E9371750A7}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SourceAnalysis", "AddIns\Misc\SourceAnalysis\SourceAnalysis.csproj", "86CE7B3F-6273-4215-9E36-6184D98F854E"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SearchAndReplace", "AddIns\Misc\SearchAndReplace\Project\SearchAndReplace.csproj", "{9196DD8A-B4D4-4780-8742-C5762E547FC2}"
@@ -90,8 +88,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WixBinding", "AddIns\Backen
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlBinding", "AddIns\BackendBindings\XamlBinding\Project\XamlBinding.csproj", "{7C96B65D-28A5-4F28-A35B-8D83CE831EE8}"
EndProject
-Project("{982E8BC1-ACD7-4dbf-96AB-B2CE67D6A008}") = "FSharpBinding", "AddIns\BackendBindings\FSharp\FSharpBinding\Project\FSharpBinding.fsproj", "{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Display Bindings", "Display Bindings", "{4EA396ED-64AD-4AD0-A67A-AB363F3E0C79}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
@@ -150,8 +146,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "Libraries\NRe
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TextEditor", "Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj", "{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj", "{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Build.Tasks", "Libraries\ICSharpCode.Build.Tasks\Project\ICSharpCode.Build.Tasks.csproj", "{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aga.Controls", "Libraries\TreeViewAdv\Aga.Controls\Aga.Controls.csproj", "{E73BB233-D88B-44A7-A98F-D71EE158381D}"
@@ -160,6 +154,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{5A3EBEBA-0
ProjectSection(SolutionItems) = postProject
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core.Presentation", "Main\ICSharpCode.Core.Presentation\ICSharpCode.Core.Presentation.csproj", "{7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}"
+EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.BuildWorker", "Main\ICSharpCode.SharpDevelop.BuildWorker\ICSharpCode.SharpDevelop.BuildWorker.csproj", "{C3CBC8E3-81D8-4C5B-9941-DCCD12D50B1F}"
EndProject
Project("{00000000-0000-0000-0000-000000000000}") = "Tools", "Tools\Tools.build", "B13EFF7F-7EA4-4B68-A375-D112105E9182"
@@ -204,10 +200,6 @@ Global
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.Build.0 = Release|Any CPU
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.Build.0 = Release|Any CPU
- {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Release|Any CPU.Build.0 = Release|Any CPU
@@ -416,10 +408,6 @@ Global
{8D732610-8FC6-43BA-94C9-7126FD7FE361}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D732610-8FC6-43BA-94C9-7126FD7FE361}.Release|Any CPU.Build.0 = Release|Any CPU
{8D732610-8FC6-43BA-94C9-7126FD7FE361}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}.Release|Any CPU.Build.0 = Release|Any CPU
- {99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E618A9CD-A39F-4925-A538-E8A3FEF24E54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E618A9CD-A39F-4925-A538-E8A3FEF24E54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E618A9CD-A39F-4925-A538-E8A3FEF24E54}.Release|Any CPU.Build.0 = Release|Any CPU
@@ -436,10 +424,10 @@ Global
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Release|Any CPU.Build.0 = Release|Any CPU
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3CA90546-3B4C-4663-9445-C4E9371750A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3CA90546-3B4C-4663-9445-C4E9371750A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3CA90546-3B4C-4663-9445-C4E9371750A7}.Release|Any CPU.Build.0 = Release|Any CPU
- {3CA90546-3B4C-4663-9445-C4E9371750A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4EA396ED-64AD-4AD0-A67A-AB363F3E0C79} = {14A277EE-7DF1-4529-B639-7D1EF334C1C5}
@@ -464,13 +452,11 @@ Global
{4B8F0F98-8BE1-402B-AA8B-C8D548577B38} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
{9196DD8A-B4D4-4780-8742-C5762E547FC2} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
86CE7B3F-6273-4215-9E36-6184D98F854E = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
- {3CA90546-3B4C-4663-9445-C4E9371750A7} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2}
{EC06F96A-AEEC-49D6-B03D-AB87C6EB674C} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}
{1D18D788-F7EE-4585-A23B-34DC8EC63CB8} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}
{E6F4983F-DE41-4AEC-88E7-1FA9AFB4E6FF} = {BDDDCD01-D2FE-4EAD-9425-4B6B91922C7C}
{869951D5-A0D6-4DC6-9F1D-E6B9A12AC446} = {BDDDCD01-D2FE-4EAD-9425-4B6B91922C7C}
{000E4F64-5D0D-4EB1-B0BF-1A62ADBC6EAD} = {BDDDCD01-D2FE-4EAD-9425-4B6B91922C7C}
- {99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C}
{7C96B65D-28A5-4F28-A35B-8D83CE831EE8} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C}
{e1b288a2-08ee-4318-8bbb-8ab72c69e33e} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C}
{DBCF20A1-BA13-4582-BFA9-74DE4D987B73} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C}
@@ -503,7 +489,6 @@ Global
{66A378A1-E9F4-4AD5-8946-D0EC06C2902F} = {388C3979-2621-4839-A955-7E5C03BA0B63}
{E73BB233-D88B-44A7-A98F-D71EE158381D} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
- {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C}
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
@@ -515,5 +500,6 @@ Global
{1152B71B-3C05-4598-B20D-823B5D40559E} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
B13EFF7F-7EA4-4B68-A375-D112105E9182 = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
{C3CBC8E3-81D8-4C5B-9941-DCCD12D50B1F} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
+ {7E4A7172-7FF5-48D0-B719-7CD959DD1AC9} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486}
EndGlobalSection
EndGlobal