Generic parsing from string
private static void GetInput<T>(string prompt, ref T Input)
{
bool isValid = false;
while (!isValid)
{
try
{
Console.Write(prompt);
string sInput = Console.ReadLine();
Input = (T)Convert.ChangeType(sInput, typeof(T));
isValid = true;
}
catch
{
isValid = false;
}
}
}