Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Security.Cryptography.X509Certificates;
- using System.Globalization;
- namespace Atividade5Ex2
- {
- public class Run
- {
- public void RunCode()
- {
- ControleRemoto Controle = new ControleRemoto();
- Televisao TV = new Televisao();
- bool flag = false;
- do
- {
- Console.Clear();
- Console.Write("Olá seja bem-vindo a Vir-TV, sua nova televisão virtual. \r\n" +
- "Digite CONTROLE para selecionar o controle remoto ou digite DESLIGAR para desligar a sua Vir-TV. \r\n" +
- "Sua resposta: ");
- string opcao = Console.ReadLine();
- flag = false;
- if (string.Compare(opcao, "CONTROLE", true) == 0)
- {
- flag = true;
- }
- else if (string.Compare(opcao, "DESLIGAR", true) == 0)
- {
- flag = true;
- Console.Clear();
- Console.WriteLine(" \r\n" +
- " DESLIGANDO... \r\n" +
- "");
- _ = Console.ReadLine();
- Environment.Exit(-1);
- }
- } while (flag == false);
- do
- {
- Console.Clear();
- flag = false;
- Console.WriteLine("\r\n" +
- " .--. \r\n" +
- " .-========-. -= Comandos do controle remoto =- \r\n" +
- " | === [II] | \r\n" +
- " | [IV][XX] | .---------. \r\n" +
- " | o ==== | | VOLUME+ | \r\n" +
- " | LILILILI | | VOLUME- | \r\n" +
- " | LILILILI | | | \r\n" +
- " | LILILILI | | CANAL+ | \r\n" +
- " | LILILILI | | CANAL- | \r\n" +
- " | __ __ | '---------' \r\n" +
- " | [++][--] | .-------------. \r\n" +
- " | [UP][][] | | TROCA_CANAL | \r\n" +
- " | [DW][][] | .---------'-------------'--------. \r\n" +
- " | OOO | | CONSULT_CANAL | CONSULT_VOLUME | \r\n" +
- " '-========-' '--------------------------------' \r\n" +
- " \r\n");
- Console.Write("SUA RESPOSTA: ");
- string resposta = Console.ReadLine();
- if (string.Compare(resposta, "VOLUME+", true) == 0)
- {
- do
- {
- Console.Clear();
- Console.Write("Você deseja aumentar o volume um número por vez? Se sim, deixe o campo em vazio.\r\n" +
- "Caso queira aumentar em uma quantidade específica de números digite o valor desejado: ");
- int quantidade = int.Parse(Console.ReadLine());
- if (quantidade == 0)
- {
- Controle.AumentarVolume(TV);
- }
- else
- {
- Controle.AumentarVolume(TV, quantidade);
- }
- Console.Clear();
- Console.Write("Volume aumentado. Digite MENU para voltar: ");
- string resposta0 = Console.ReadLine();
- if (string.Compare(resposta0, "MENU", true) == 0)
- {
- flag = false;
- }
- else { flag = true; }
- } while (flag == true);
- flag = false;
- }
- else if (string.Compare(resposta, "VOLUME-", true) == 0)
- {
- do
- {
- Console.Clear();
- Console.Write("Você deseja diminuir o volume um número por vez? Se sim, deixe o campo em vazio.\r\n" +
- "Caso queira diminuir em uma quantidade específica de números digite o valor desejado: ");
- int quantidade = int.Parse(Console.ReadLine());
- if (quantidade == 0)
- {
- Controle.DiminuirVolume(TV);
- }
- else
- {
- Controle.DiminuirVolume(TV, quantidade);
- }
- Console.Clear();
- Console.Write("Volume diminuido. Digite MENU para voltar: ");
- string resposta0 = Console.ReadLine();
- if (string.Compare(resposta0, "MENU", true) == 0)
- {
- flag = false;
- }
- else { flag = true; }
- } while (flag == true);
- flag = false;
- }
- else if (string.Compare(resposta, "CANAL+", true) == 0)
- {
- do
- {
- Console.Clear();
- Console.Write("Você deseja aumentar o canal um número por vez? Se sim, deixe o campo em vazio.\r\n" +
- "Caso queira aumentar em uma quantidade específica de números digite o valor desejado: ");
- int quantidade = int.Parse(Console.ReadLine());
- if (quantidade == 0)
- {
- Controle.AumentarCanal(TV);
- }
- else
- {
- Controle.AumentarCanal(TV, quantidade);
- }
- Console.Clear();
- Console.Write("Canal aumentado. Digite MENU para voltar: ");
- string resposta0 = Console.ReadLine();
- if (string.Compare(resposta0, "MENU", true) == 0)
- {
- flag = false;
- }
- else { flag = true; }
- } while (flag == true);
- flag = false;
- }
- else if (string.Compare(resposta, "CANAL-", true) == 0)
- {
- do
- {
- Console.Clear();
- Console.Write("Você deseja diminuir o canal um número por vez? Se sim, deixe o campo em vazio.\r\n" +
- "Caso queira diminuir em uma quantidade específica de números digite o valor desejado: ");
- int quantidade = int.Parse(Console.ReadLine());
- if (quantidade == 0)
- {
- Controle.DiminuirCanal(TV);
- }
- else
- {
- Controle.DiminuirCanal(TV, quantidade);
- }
- Console.Clear();
- Console.Write("Canal diminuido. Digite MENU para voltar: ");
- string resposta0 = Console.ReadLine();
- if (string.Compare(resposta0, "MENU", true) == 0)
- {
- flag = false;
- }
- else { flag = true; }
- } while (flag == true);
- flag = false;
- }
- else if (string.Compare(resposta, "TROCA_CANAL", true) == 0)
- {
- Console.Clear();
- Console.Write("LISTA DE CANAIS CADASTRADOS: \r\n" +
- "Canal 3: Rede Globo | Canal 5: SBT | Canal 6: RedeTV | Canal 9: Record \r\n" +
- " \r\n" +
- "Digite o número do canal desejado: ");
- int numero = int.Parse(Console.ReadLine());
- Controle.TrocarCanal(TV, numero);
- Console.Clear();
- Console.Write("Canal alterado. Digite MENU para voltar ao menu: ");
- string resposta0 = Console.ReadLine();
- if (string.Compare(resposta0, "MENU", true) == 0)
- {
- flag = false;
- }
- else
- {
- Console.Clear();
- flag = true;
- }
- }
- else if (string.Compare(resposta, "CONSULT_CANAL", true) == 0)
- {
- Console.Clear();
- Console.Write("O canal atual é o {0} \r\n" +
- "", Controle.CanalAtual(TV));
- Console.Write("Digite MENU para voltar ao menu: ");
- string resposta0 = Console.ReadLine();
- if (string.Compare(resposta0, "MENU", true) == 0)
- {
- flag = false;
- }
- else
- {
- Console.Clear();
- flag = true;
- }
- }
- else if (string.Compare(resposta, "CONSULT_VOLUME", true) == 0)
- {
- Console.Clear();
- Console.Write("O volume atual é: {0} \r\n" +
- "", Controle.VolumeAtual(TV));
- Console.Write("Digite MENU para voltar ao menu: ");
- string resposta0 = Console.ReadLine();
- if (string.Compare(resposta0, "MENU", true) == 0)
- {
- flag = false;
- }
- else
- {
- Console.Clear();
- flag = true;
- }
- }
- } while (flag == false);
- }
- ~Run()
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement