Ejemplo n.º 1
0
 // Validate the input parameters and return alerts to the user
 static public bool ValidationInput(string[] input)
 {
     if (
         (input.Length <= 2 || input.Length > 5) ||
         (input.Length == 3 && (input[0] != "-level2" && input[0] != "-level5" && input[0] != "-level6" && input[0] != "-level7")) ||
         (input.Length == 4 && (input[0] != "-level1" && input[0] != "-level3")) ||
         (input.Length == 5 && input[0] != "-level4")
         )
     {
         Alerts.Alert_1();
         return(false);
     }
     else if (!File.Exists(input[1]))
     {
         Alerts.Alert_2(input[1]);
         return(false);
     }
     else if (input[0] == "-level1")
     {
         return(Validation.ValidationLevel_1(input[1], input[2], input[3]));
     }
     else if (input[0] == "-level3")
     {
         return(Validation.ValidationLevel_3(input[2]));
     }
     else if (input[0] == "-level4")
     {
         return(ValidationLevel_4(input));
     }
     else if (input[0] == "-level2" || input[0] == "-level5" || input[0] == "-level6" || input[0] == "-level7")
     {
         return(true);
     }
     return(false);
 }