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


C# ICommandHandler.CanHandleCommand方法代码示例

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


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

示例1: CallCommandHandlerForEnabled

 /// <summary>
 /// protected virtual method that is called for each handler of a command to see whether that
 /// command is enabled for the handler.
 /// </summary>
 /// <param name="handler">the handler that is being queried</param>
 /// <param name="commandId">the command id that is being queried</param>
 /// <returns>true if the command is enabled for this handler</returns>
 protected virtual bool CallCommandHandlerForEnabled(ICommandHandler handler, string commandId)
 {
     return handler.CanHandleCommand(commandId);
 }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:11,代码来源:commanddispatcher.cs

示例2: CallCommandHandlerForEnabled

        /// <summary>
        /// protected overriden method that makes sure that we only run the "IsEnabled" call on the active
        /// page component.
        /// </summary>
        /// <param name="handler">a handler the passed in command</param>
        /// <param name="commandId">the command id</param>
        /// <returns>true if this handler is the active component and it can handle the passed in commandid</returns>
        protected override bool CallCommandHandlerForEnabled(ICommandHandler handler, string commandId)
        {
            // If this handler is not the active PageComponent, then the command is not enabled
            // for this component because it does not have the focus
            if (!_activeComponents.Contains(handler))
                return false;

            return handler.CanHandleCommand(commandId);
        }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:16,代码来源:focusmanager.cs


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