コード例 #1
0
 static void Main(string[] args)
 {
     AlienDetailsInputter.ReadAlienInput();
     AlienDetailsDisplayer.AlienDataDisplay(AlienDetailsInputter.getAlienDetails());
     MenuCreator.FormatExporterMenu();
     Console.ReadLine();
 }
コード例 #2
0
 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");
     }
 }