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


C# DockContent.AddHelp方法代码示例

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


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

示例1: RegisterControl

        /// <summary>
        /// Registers a control so it becomes visible as part of the main form</summary>
        /// <param name="control">Control</param>
        /// <param name="info">Control display information</param>
        /// <param name="client">Client that owns the control and receives notifications
        /// about its status, or null if no notifications are needed</param>
        /// <remarks>If IControlHostClient.Close() has been called, the IControlHostService
        /// also calls UnregisterControl. Call RegisterControl again to re-register the Control.</remarks>
        public void RegisterControl(Control control, ControlInfo info, IControlHostClient client)
        {
            if (control == null)
                throw new ArgumentNullException("control");
            if (info == null)
                throw new ArgumentNullException("info");

            if (FindControlInfo(control) != null)
                throw new ArgumentException("Control already registered");

            // allow null client
            if (client == null)
                client = Global<DefaultClient>.Instance;

            info.Client = client;
            info.Control = control;
            info.Changed += info_Changed;

            var dockContent = new DockContent(this);

            if (!string.IsNullOrEmpty(info.HelpUrl))
                dockContent.AddHelp(info.HelpUrl);

            // set persistence id one time only.
            // do not update dockContent.Name            
            // dockContent.Text is used for titlebar.
            dockContent.Name = GetPersistenceId(info);

            UpdateDockContent(dockContent, info);

            m_dockContent.Add(info, dockContent);
            m_controls.ActiveItem = info;

            info.HostControl = dockContent;

            // Any property we set on this Control needs to be restored in UnregisterControl.
            //  For example, QuadPanelControl was broken by setting Dock property but not restoring it.
            info.OriginalDock = control.Dock;
            control.Dock = DockStyle.Fill;

            dockContent.Controls.Add(control);

            dockContent.FormClosing += dockContent_FormClosing;

            ShowDockContent(dockContent, info);

            if (info.ShowInMenu)
            {
                if (info.IsDocument.HasValue && info.IsDocument.Value)
                {
                    // description( and the tooltip) for a document control by convention is the full path of the document
                    RegisterMenuCommand(info, "@" + info.Description);
                }
                else 
                    RegisterMenuCommand(info, "@" + dockContent.Text); // tells m_commandService not to interpret slashes as submenus
            }

            // Bring all the Controls for this client to the front.
            BringClientToFront(client);

            // Call the IControlHostClient's Activate method. Seems to be required when driving
            //  the app from a script and if the user clicks on another app at the wrong moment.
            ActivateClient(control);
        }
开发者ID:vincenthamm,项目名称:ATF,代码行数:72,代码来源:ControlHostService.cs


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