예제 #1
0
        /// <summary>
        ///     Adds component command builder to <see cref="ComponentCommands"/>.
        /// </summary>
        /// <param name="name">Name of the command.</param>
        /// <param name="callback">Command callback to be executed.</param>
        /// <param name="configure"><see cref="ComponentCommandBuilder"/> factory.</param>
        /// <returns>
        ///     The builder instance.
        /// </returns>
        public ModuleBuilder AddComponentCommand(string name, ExecuteCallback callback, Action <ComponentCommandBuilder> configure)
        {
            var command = new ComponentCommandBuilder(this, name, callback);

            configure(command);
            _componentCommands.Add(command);
            return(this);
        }
예제 #2
0
        /// <summary>
        ///     Adds component command builder to <see cref="ComponentCommands"/>.
        /// </summary>
        /// <param name="configure"><see cref="ComponentCommandBuilder"/> factory.</param>
        /// <returns>
        ///     The builder instance.
        /// </returns>
        public ModuleBuilder AddComponentCommand(Action <ComponentCommandBuilder> configure)
        {
            var command = new ComponentCommandBuilder(this);

            configure(command);
            _componentCommands.Add(command);
            return(this);
        }