static void Main(string[] args) { AlienDetailsInputter.ReadAlienInput(); AlienDetailsDisplayer.AlienDataDisplay(AlienDetailsInputter.getAlienDetails()); MenuCreator.FormatExporterMenu(); Console.ReadLine(); }
public static void CheckFormat(int userChoice) { try { //Dynamically getting the Class name of the Format Type calledType = Type.GetType(@namespace + "." + ExportFileName(userChoice)); // Creating an instance of the Class object instance = Activator.CreateInstance(calledType); MethodInfo method = calledType.GetMethod("GenerateFile"); //passing method arguments with object method.Invoke(instance, new object[] { AlienDetailsInputter.getAlienDetails() }); } catch { Console.WriteLine("Invalid Menu Choice or the format is not implemented properly.Press Enter to Exit"); } }