Exemplo n.º 1
0
        public void SendMessageAllFriends(Profile profile, string message)
        {
            IProfileIterator iterator = _socialNetwork.ViewFriendsIterator(profile);
            var profileFriend         = iterator.GetNext();

            while (profileFriend != null)
            {
                GerenciadorSaida.SaidaConsole.EscreverTexto($"Id: {profileFriend.Id}\tNome Friend: {profileFriend.Name}\tMensagem: {message}");
                profileFriend = iterator.GetNext();
            }
        }
Exemplo n.º 2
0
        public void Send(IProfileIterator iterator, string message)
        {
            var profile = iterator.GetNext();

            SendEmail(profile.GetEmail(), message);
            while (iterator.HasMore())
            {
                profile = iterator.GetNext();
                SendEmail(profile.GetEmail(), message);
            }
        }