当前位置: 首页>>代码示例>>C#>>正文


C# DockContent.Close方法代码示例

本文整理汇总了C#中WeifenLuo.WinFormsUI.Docking.DockContent.Close方法的典型用法代码示例。如果您正苦于以下问题:C# DockContent.Close方法的具体用法?C# DockContent.Close怎么用?C# DockContent.Close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WeifenLuo.WinFormsUI.Docking.DockContent的用法示例。


在下文中一共展示了DockContent.Close方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleDockContentToolStripMenuClick

 private void HandleDockContentToolStripMenuClick(DockContent dockWindow, DockState state)
 {
     if (dockWindow.IsHidden || dockWindow.DockState == DockState.Unknown)
     {
         dockWindow.Show(dockPanel, state);
     }
     else
     {
         dockWindow.Close();
     }
 }
开发者ID:eberletj,项目名称:vixen,代码行数:11,代码来源:TimedSequenceEditorForm.cs

示例2: ShowContent

        /// <summary>
        /// Shows the content.
        /// </summary>
        /// <param name="vc">The vc.</param>
        /// <param name="region">The region.</param>
        public void ShowContent(IViewContent vc, ViewRegion region)
        {
            TabManager tm = ServiceManager.Instance.GetService<TabManager>();

            DockContent content = new DockContent();
            content.TabText = vc.Title;
            content.Text = vc.Title;
            content.ToolTipText = vc.Title;
            content.CloseButton = vc.CanClose;

            switch (region)
            {
                case ViewRegion.Bottom:
                    content.DockAreas = DockAreas.DockBottom;
                    break;
                case ViewRegion.Top:
                    content.DockAreas = DockAreas.DockTop;
                    break;
                case ViewRegion.Left:
                    content.DockAreas = DockAreas.DockLeft;
                    break;
                case ViewRegion.Right:
                    content.DockAreas = DockAreas.DockRight;
                    break;
                case ViewRegion.Document:
                    content.DockAreas = DockAreas.Document;
                    break;
                case ViewRegion.Floating:
                    content.DockAreas = DockAreas.Float;
                    break;
            }

            vc.TitleChanged += delegate(object sender, EventArgs e)
            {
                content.TabText = vc.Title;
                content.Text = vc.Title;
                content.ToolTipText = vc.Title;
            };

            vc.ViewContentClosing += delegate(object sender, EventArgs e)
            {
                if(vc.CanClose)
                    content.Close();
            };

            content.ClientSize = vc.ContentControl.Size;
            content.CloseButton = vc.CanClose;

            vc.ContentControl.Dock = DockStyle.Fill;
            content.Controls.Add(vc.ContentControl);

            if (vc is IConnectionDependentView)
            {
                tm.Register((IConnectionDependentView)vc);
            }

            if (region == ViewRegion.Dialog)
            {   
                content.StartPosition = FormStartPosition.CenterParent;
                content.ShowDialog();
            }
            else
            {
                content.Show(contentPanel);
            }
        }
开发者ID:jumpinjackie,项目名称:fdotoolbox,代码行数:71,代码来源:Workbench.cs


注:本文中的WeifenLuo.WinFormsUI.Docking.DockContent.Close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。