Skip to content

Commit

Permalink
Limpeza de código & correção de syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcos Gonçalves committed Aug 21, 2017
1 parent c358808 commit 6fc4ecb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 65 deletions.
64 changes: 1 addition & 63 deletions Cielo.Demo/AppConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,69 +71,7 @@ public void Execute(String[] args)
}
}
}

public void ExecuteX(String[] args)
{
int index = 0;
bool pause = false;
bool success = false;


// process any options
while (index < args.Length && args[index][0] == '-')
{
String option = args[index].Substring(1).ToLower();

if ("pause".Equals(option))
pause = true;
index++;
}

if (index >= args.Length)
{
Console.WriteLine(@"Escolha uma opção para executar");
ListCommands();
//if (pause)
//{
// Pause();
//}
return;
}

//String command = "megasena";
String command = args[index++];

// get any arguments
var pargs = new String[args.Length - index];
for (int i = 0; i < pargs.Length; i++)
{
pargs[i] = args[index + i];
}

foreach (CieloDemoInfo info in demos)
{
if (String.Compare(command, info.Command, true) == 0 ||
String.Compare(command, "all", true) == 0)
{
ICieloDemo demo = info.CreateInstance();
demo.Execute(new ConsoleInterface(pargs));
success = true;

if (String.Compare(command, "all", true) != 0)
{
break;
}
}
}

if (!success)
{
Console.WriteLine($"Comando desconhecido: {command}");
ListCommands();
}
}



public void Pause()
{
Console.Write("\n\nAperte qualquer tecla para continuar...");
Expand Down
4 changes: 2 additions & 2 deletions Cielo.Demo/Helpers/ConsoleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ public static void WriteResult(CardResponse response)
Console.ForegroundColor = ConsoleColor.Gray;
}

public static void WriteFooter(long runtime)
public static void WriteFooter(long elapsedTime)
{
string time = $"Runtime {runtime} ms";
string time = $"Elapsed {elapsedTime} ms";

Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine("");
Expand Down

0 comments on commit 6fc4ecb

Please sign in to comment.