Example #1
0
        public override List <Message> GetMessages()
        {
            List <Message> newMessageQueue = new List <Message>();

            foreach (var message in Decoratee.GetMessages())
            {
                var cipherText = $"<Зашифровано> {message.GetText()} </Зашифровано>";

                var newMessage = new Message(message.GetAuthor(), message.GetRecipient(), cipherText);
                newMessageQueue.Add(newMessage);
            }

            return(newMessageQueue);
        }
Example #2
0
        public override List <Message> GetMessages()
        {
            List <Message> newMessageQueue = new List <Message>();

            foreach (var message in Decoratee.GetMessages())
            {
                var newAuthor    = message.GetAuthor().Length.ToString();
                var newRecipient = message.GetRecipient().Length.ToString();
                var newMessage   = new Message(newAuthor, newRecipient, message.GetText());

                newMessageQueue.Add(newMessage);
            }

            return(newMessageQueue);
        }