public int Run() { Console.WriteLine("Downloading language list..."); var client = Program.AlbaClient(); client.Authenticate(Program.GetCredentials()); var useCase = new LanguageDownloader(client); useCase.SaveAs(FilePath); Console.WriteLine("Parsing language list file..."); var languages = LanguageDownloader.LoadLanguagesFrom(FilePath); Console.WriteLine($"Languages parsed: {languages.Count}"); foreach (var language in languages) { Console.WriteLine($" {language.Id,4:0}: {language.Name}"); } Console.WriteLine("Done"); return(0); }
public string LoadLanguages() { try { view.AppendResultText("Load Languages Result:" + Environment.NewLine + Environment.NewLine); string timeStamp = DateTime.Now.ToString("yyyy-MM-dd.HHmm"); string fileName = view.OpenFileDialog("html"); view.AppendResultText($"File Loaded: {fileName}"); view.AppendResultText("Parsing language file..."); var languages = LanguageDownloader.LoadLanguagesFrom(fileName); foreach (var language in languages) { view.AppendResultText($" {language.Id}: {language.Name}"); } return(fileName); } catch (Exception e) { view.ShowMessageBox(e.Message); return(null); } }
public int Run() { Console.WriteLine("Parsing language file..."); var languages = LanguageDownloader.LoadLanguagesFrom(FilePath); Console.WriteLine($"Languages parsed: {languages.Count}"); foreach (var language in languages) { Console.WriteLine($" {language.Id,4:0}: {language.Name}"); } Console.WriteLine("Done"); return(0); }