示例#1
0
        CommandBuilder <TC> BuildFromName <TC>(string name, ICommandBuildingConventions conventions) where TC : ICommand
        {
            var builder = new CommandBuilder <TC>(_commandCoordinator, _conventions);

            builder.WithName(conventions.CommandName(name));
            return(builder);
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of <see cref="CommandBuilder"/>
        /// </summary>
        /// <param name="commandCoordinator"><see cref="ICommandCoordinator"/> to use</param>
        public CommandBuilder(ICommandCoordinator commandCoordinator, ICommandBuildingConventions conventions)
        {
            _commandCoordinator = commandCoordinator;
            _conventions        = conventions;

            if (typeof(T) != typeof(Command) && typeof(T) != typeof(ICommand))
            {
                Name = conventions.CommandName(typeof(T).Name);
            }
        }