Download data/DWSIM.Controls.DockPanel/WinFormsUI/Docking/DockContent.cs from introvoyz041/Dwsim: direct link, hf CLI and curl.
- Browser
- Download file 11.4 kB
-
https://huggingface.co/datasets/introvoyz041/Dwsim/resolve/main/data/DWSIM.Controls.DockPanel/WinFormsUI/Docking/DockContent.cs
- Command line
-
hf download hf://datasets/introvoyz041/Dwsim/data/DWSIM.Controls.DockPanel/WinFormsUI/Docking/DockContent.cs
-
curl -L -o DockContent.cs https://huggingface.co/datasets/introvoyz041/Dwsim/resolve/main/data/DWSIM.Controls.DockPanel/WinFormsUI/Docking/DockContent.cs
11.4 kB
| 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); | |
| //Suggested as a fix by bensty regarding form resize | |
| this.ParentChanged += new EventHandler(DockContent_ParentChanged); | |
| } | |
| //Suggested as a fix by bensty regarding form resize | |
| private void DockContent_ParentChanged(object Sender, EventArgs e) | |
| { | |
| if (this.Parent != null) | |
| this.Font = this.Parent.Font; | |
| } | |
| private DockContentHandler m_dockHandler = null; | |
| [] | |
| public DockContentHandler DockHandler | |
| { | |
| get { return m_dockHandler; } | |
| } | |
| [] | |
| [] | |
| [] | |
| public bool AllowEndUserDocking | |
| { | |
| get { return DockHandler.AllowEndUserDocking; } | |
| set { DockHandler.AllowEndUserDocking = value; } | |
| } | |
| [] | |
| [] | |
| [] | |
| public DockAreas DockAreas | |
| { | |
| get { return DockHandler.DockAreas; } | |
| set { DockHandler.DockAreas = value; } | |
| } | |
| [] | |
| [] | |
| [] | |
| public double AutoHidePortion | |
| { | |
| get { return DockHandler.AutoHidePortion; } | |
| set { DockHandler.AutoHidePortion = value; } | |
| } | |
| private string m_tabText = null; | |
| [] | |
| [] | |
| [] | |
| [] | |
| public string TabText | |
| { | |
| get { return m_tabText; } | |
| set { DockHandler.TabText = m_tabText = value; } | |
| } | |
| private bool ShouldSerializeTabText() | |
| { | |
| return (m_tabText != null); | |
| } | |
| [] | |
| [] | |
| [] | |
| public bool CloseButton | |
| { | |
| get { return DockHandler.CloseButton; } | |
| set { DockHandler.CloseButton = value; } | |
| } | |
| [] | |
| [] | |
| [] | |
| public bool CloseButtonVisible | |
| { | |
| get { return DockHandler.CloseButtonVisible; } | |
| set { DockHandler.CloseButtonVisible = value; } | |
| } | |
| [] | |
| [] | |
| public DockPanel DockPanel | |
| { | |
| get { return DockHandler.DockPanel; } | |
| set { DockHandler.DockPanel = value; } | |
| } | |
| [] | |
| [] | |
| public DockState DockState | |
| { | |
| get { return DockHandler.DockState; } | |
| set { DockHandler.DockState = value; } | |
| } | |
| [] | |
| [] | |
| public DockPane Pane | |
| { | |
| get { return DockHandler.Pane; } | |
| set { DockHandler.Pane = value; } | |
| } | |
| [] | |
| [] | |
| public bool IsHidden | |
| { | |
| get { return DockHandler.IsHidden; } | |
| set { DockHandler.IsHidden = value; } | |
| } | |
| [] | |
| [] | |
| public DockState VisibleState | |
| { | |
| get { return DockHandler.VisibleState; } | |
| set { DockHandler.VisibleState = value; } | |
| } | |
| [] | |
| [] | |
| public bool IsFloat | |
| { | |
| get { return DockHandler.IsFloat; } | |
| set { DockHandler.IsFloat = value; } | |
| } | |
| [] | |
| [] | |
| public DockPane PanelPane | |
| { | |
| get { return DockHandler.PanelPane; } | |
| set { DockHandler.PanelPane = value; } | |
| } | |
| [] | |
| [] | |
| public DockPane FloatPane | |
| { | |
| get { return DockHandler.FloatPane; } | |
| set { DockHandler.FloatPane = value; } | |
| } | |
| [] | |
| protected virtual string GetPersistString() | |
| { | |
| return GetType().ToString(); | |
| } | |
| [] | |
| [] | |
| [] | |
| public bool HideOnClose | |
| { | |
| get { return DockHandler.HideOnClose; } | |
| set { DockHandler.HideOnClose = value; } | |
| } | |
| [] | |
| [] | |
| [] | |
| public DockState ShowHint | |
| { | |
| get { return DockHandler.ShowHint; } | |
| set { DockHandler.ShowHint = value; } | |
| } | |
| [] | |
| public bool IsActivated | |
| { | |
| get { return DockHandler.IsActivated; } | |
| } | |
| public bool IsDockStateValid(DockState dockState) | |
| { | |
| return DockHandler.IsDockStateValid(dockState); | |
| } | |
| [] | |
| [] | |
| [] | |
| public ContextMenu TabPageContextMenu | |
| { | |
| get { return DockHandler.TabPageContextMenu; } | |
| set { DockHandler.TabPageContextMenu = value; } | |
| } | |
| [] | |
| [] | |
| [] | |
| public ContextMenuStrip TabPageContextMenuStrip | |
| { | |
| get { return DockHandler.TabPageContextMenuStrip; } | |
| set { DockHandler.TabPageContextMenuStrip = value; } | |
| } | |
| [] | |
| [] | |
| [] | |
| [] | |
| 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); | |
| } | |
| [] | |
| 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); | |
| } | |
| [] | |
| 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); | |
| } | |
| void IDockContent.OnActivated(EventArgs e) | |
| { | |
| this.OnActivated(e); | |
| } | |
| void IDockContent.OnDeactivate(EventArgs e) | |
| { | |
| this.OnDeactivate(e); | |
| } | |
| private void DockHandler_DockStateChanged(object sender, EventArgs e) | |
| { | |
| OnDockStateChanged(e); | |
| } | |
| 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); | |
| } | |
| /// <summary> | |
| /// Overridden to avoid resize issues with nested controls | |
| /// </summary> | |
| /// <remarks> | |
| /// http://blogs.msdn.com/b/alejacma/archive/2008/11/20/controls-won-t-get-resized-once-the-nesting-hierarchy-of-windows-exceeds-a-certain-depth-x64.aspx | |
| /// http://support.microsoft.com/kb/953934 | |
| /// </remarks> | |
| protected override void OnSizeChanged(EventArgs e) | |
| { | |
| if (DockPanel != null && DockPanel.SupportDeeplyNestedContent && IsHandleCreated) | |
| { | |
| BeginInvoke((MethodInvoker)delegate | |
| { | |
| base.OnSizeChanged(e); | |
| }); | |
| } | |
| else | |
| { | |
| base.OnSizeChanged(e); | |
| } | |
| } | |
| private void InitializeComponent() | |
| { | |
| this.SuspendLayout(); | |
| // | |
| // DockContent | |
| // | |
| this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); | |
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; | |
| this.ClientSize = new System.Drawing.Size(284, 261); | |
| this.Name = "DockContent"; | |
| this.ResumeLayout(false); | |
| } | |
| } | |
| } | |