protected CommandCreator(IOutputManager outputManager, ITimeProvider timeProvider, IMessagesRepository messagesRepository, IFollowingRepository followingRepository)
 {
     OutputManager = outputManager;
     TimeProvider = timeProvider;
     MessagesRepository = messagesRepository;
     FollowingRepository = followingRepository;
 }
 public CommandCreatorsFactory(
     IOutputManager outputManager,
     ITimeProvider timeProvider,
     IMessagesRepository messagesRepository,
     IFollowingRepository followingRepository)
 {
     CommandCreators.Add(new PostMessageCommandCreator(outputManager, timeProvider, messagesRepository, followingRepository));
     CommandCreators.Add(new ListMessagesCommandCreator(outputManager, timeProvider, messagesRepository, followingRepository));
     CommandCreators.Add(new FollowUserCommandCreator(outputManager, timeProvider, messagesRepository, followingRepository));
     CommandCreators.Add(new ShowWallOfUserCommandCreator(outputManager, timeProvider, messagesRepository, followingRepository));
 }
Beispiel #3
0
        public FollowUserCommand(
            IOutputManager outputManager,
            IFollowingRepository followingRepository,
            string username1,
            string username2)
            : base(outputManager)
        {
            Username1 = username1;
            Username2 = username2;

            this.followingRepository = followingRepository;
        }
Beispiel #4
0
        static void ShowInstructions(IOutputManager output)
        {
            var sb = new StringBuilder();
            sb.AppendLine("You can:");
            sb.AppendLine("Post a message using: [your user name] -> [your message]");
            sb.AppendLine("  For example: john -> Such a wonderful day today!");
            sb.AppendLine("Read your messages using: [your user name]");
            sb.AppendLine("  For example: john");
            sb.AppendLine("Follow a user using: [your user name] follows [user name to follow]");
            sb.AppendLine("  For example: john follows bob");
            sb.AppendLine("Read your wall using: [your user name] wall");
            sb.AppendLine("  For example: john wall");

            output.Write(sb.ToString());
        }
Beispiel #5
0
        public ListMessagesCommand(
            IOutputManager outputManager,
            IMessagesRepository messagesRepository,
            string username)
            : base(outputManager)
        {
            this.messagesRepository = messagesRepository;

            Username = username;
        }
Beispiel #6
0
 protected Command(IOutputManager outputManager)
 {
     OutputManager = outputManager;
 }
Beispiel #7
0
        public ShowWallOfUserCommand(
            IOutputManager outputManager,
            ITimeProvider timeProvider,
            IMessagesRepository messagesRepository,
            IFollowingRepository followingRepository,
            string username)
            : base(outputManager)
        {
            this.timeProvider = timeProvider;
            this.messagesRepository = messagesRepository;
            this.followingRepository = followingRepository;

            Username = username;
        }
Beispiel #8
0
        public PostMessageCommand(
            IOutputManager outputManager,
            ITimeProvider timeProvider,
            IMessagesRepository messagesRepository,
            string username,
            string message)
            : base(outputManager)
        {
            this.timeProvider = timeProvider;
            this.messagesRepository = messagesRepository;

            Username = username;
            Message = message;
        }
 public ListMessagesCommandCreator(IOutputManager outputManager, ITimeProvider timeProvider, IMessagesRepository messagesRepository, IFollowingRepository followingRepository)
     : base(outputManager, timeProvider, messagesRepository, followingRepository)
 {
 }
 public FirstBufferItemCommand(BufferListCollection buffersIn)
 {
     buffers = buffersIn;
     _output = OutputManager.Instance;
 }