/// <summary> /// Gets and validates arguments passed from command line. /// Provides user with feedback in case of wrong arguments. /// Prompt user to enter the number manually from keyboard, /// Prints result on the console upon correct arguments been submitted. /// </summary> /// <param name="args">Command line arguments. </param> public void Run(string[] args) { InputStatus status = this.ValidateUserInput(args); switch (status) { case InputStatus.NoArgs: Console.WriteLine(ResourcesEN.USER_MANUAL); Console.WriteLine("==================================================================="); Console.WriteLine("The command line argument has not been submitted"); this.RepeatEntry(); break; case InputStatus.InvalidArgs: Console.WriteLine(ResourcesEN.USER_MANUAL); Console.WriteLine("==================================================================="); Console.WriteLine("Invalid command line argument has been submitted"); this.RepeatEntry(); break; case InputStatus.ValidArgs: this._converter = this.GetConverter(); this._words = this._converter.ConvertToWords(this._number); this.PrintResult(); this.RepeatEntry(); break; default: break; } }
private ConverterEurope GetConverter() { ConverterEurope converter = null; switch (this._local) { case Local.RU: converter = new ConverterRU(); break; case Local.UA: converter = new ConverterUA(); break; default: converter = new ConverterEN(); break; } return(converter); }