本文整理匯總了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);
}