本文整理汇总了C#中IMenuCommandService.FindCommand方法的典型用法代码示例。如果您正苦于以下问题:C# IMenuCommandService.FindCommand方法的具体用法?C# IMenuCommandService.FindCommand怎么用?C# IMenuCommandService.FindCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMenuCommandService
的用法示例。
在下文中一共展示了IMenuCommandService.FindCommand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
//.........这里部分代码省略.........
{
}
try
{
m_oComponentRemovingHandler = new ComponentEventHandler(this.OnComponentRemoving);
}
catch
{
}
try
{
m_oComponentChangeService.ComponentAdded += m_oComponentAddedHandler;
}
catch
{
}
try
{
m_oComponentChangeService.ComponentRemoving += m_oComponentRemovingHandler;
}
catch
{
}
try
{
m_oNodeParentChanged = new EventHandler(this.OnNodeParentChanged);
}
catch
{
}
try
{
m_oOldCmdCopy = m_oMenuService.FindCommand(StandardCommands.Copy);
}
catch
{
}
try
{
m_oOldCmdPaste = m_oMenuService.FindCommand(StandardCommands.Paste);
}
catch
{
}
try
{
m_oOldCmdCut = m_oMenuService.FindCommand(StandardCommands.Cut);
}
catch
{
}
try
{
m_oOldBringFront = m_oMenuService.FindCommand(StandardCommands.BringToFront);
}
catch
{
}
try
{
m_oOldSendBack = m_oMenuService.FindCommand(StandardCommands.SendToBack);
}
catch
{
}
示例2: FindCommand
private MenuCommand FindCommand(CommandID commandID, IMenuCommandService menuService)
{
System.Windows.Forms.Design.Behavior.Behavior appropriateBehavior = this.GetAppropriateBehavior(this.hitTestedGlyph);
if (appropriateBehavior != null)
{
if (appropriateBehavior.DisableAllCommands)
{
MenuCommand command = menuService.FindCommand(commandID);
if (command != null)
{
command.Enabled = false;
}
return command;
}
MenuCommand command2 = appropriateBehavior.FindCommand(commandID);
if (command2 != null)
{
return command2;
}
}
return menuService.FindCommand(commandID);
}