Пример #1
0
        /// <summary>
        ///     Determines the display state of the command button.
        /// </summary>
        /// <param name="context">The command context</param>
        /// <returns>The state that the button should display in</returns>
        public override CommandState QueryState(CommandContext context)
        {
            Assert.ArgumentNotNull(context, "context");
            if (context.Items.Length != 1)
            {
                return(CommandState.Disabled);
            }

            return(_contextChecker.CanExecute(context.Items[0]) ? CommandState.Enabled : CommandState.Disabled);
        }
Пример #2
0
 /// <summary>
 ///     Process the request to determine if the base layouts dialog can execute on the current item.
 /// </summary>
 /// <returns>a value indicating if base layouts are supported for the current item</returns>
 public override PipelineProcessorResponseValue ProcessRequest()
 {
     return(new PipelineProcessorResponseValue {
         Value = _contextChecker.CanExecute(RequestContext.Item)
     });
 }