private void buildCommand(string commandName)
        {
            lock (this)
            {
                if (!_commands.ContainsKey(commandName))
                {
                    ICommand command = _commandFactory.BuildCommand(commandName);
                    command.Attach(_parent);

                    _commands.Add(commandName, command);
                }
            }
        }
        private IEnumerable <ICommandBuilder> GetCommands(IModuleBuilder builder)
        {
            var commandTypes = builder.Type.GetMethods()
                               .Where(a => _commandFactory.IsCommand(builder, a))
                               .ToList();

            var commands = ImmutableArray.CreateBuilder <ICommandBuilder>(commandTypes.Count);

            foreach (var commandType in commandTypes)
            {
                var commandBuilder = _commandFactory.BuildCommand(builder, commandType);

                commands.Add(commandBuilder);
            }

            return(commands.MoveToImmutable());
        }