public static void Requisicao()
        {
            var conta = new Conta("Rodrigo", 590);

            var req = new Requisicao.Requisicao(Formato.Xml);

            DeterminadorDeResposta.Executa(req, conta);
        }
Esempio n. 2
0
        public void Responde(Requisicao requisicao, Conta conta)
        {
            if (requisicao.Formato == Formato.Xml)
            {
                var xml = new StringBuilder()
                          .Append($"<conta>                           {Environment.NewLine}")
                          .Append($"   <titular>                      {Environment.NewLine}")
                          .Append($"         {conta.Titular }         {Environment.NewLine}")
                          .Append($"   </titular>                     {Environment.NewLine}")
                          .Append($"   <saldo>                        {Environment.NewLine}")
                          .Append($"         {conta.Saldo}            {Environment.NewLine}")
                          .Append($"   </saldo>                       {Environment.NewLine}")
                          .Append($"</conta>                          {Environment.NewLine}")
                          .ToString();

                MessageBox.Show(xml);
                return;
            }

            Proximo.Responde(requisicao, conta);
        }