Skip to content

Instantly share code, notes, and snippets.

Created November 4, 2014 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/8b6de0571ea9b99df941 to your computer and use it in GitHub Desktop.
Save anonymous/8b6de0571ea9b99df941 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TemplateFoo
{
class Program
{
public static void Main(string[] args)
{
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TemplateFoo
{
class ProgramWrap
{
static void Main(string[] args)
{
ConsoleMessages.PrintWelcome();
do
{
Console.WriteLine();
TryMain(args);
} while (ShouldRerun());
}
private static bool ShouldRerun()
{
Console.WriteLine(ConsoleMessages.ConfirmExit);
return Console.ReadKey().Key == ConsoleKey.R;
}
static void TryMain(string[] args)
{
try
{
TemplateFoo.Program.Main(args);
}
catch (Exception ex)
{
ConsoleMessages.PrintException(ex);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment