public static DACSettings GetDefaultSettings() { DACSettings result = new DACSettings { Introduction = "Please type a domain and press Enter. If you want to quit, write nothing and press Enter.", DomainAvailableText = "Domain is available.", DomainUnavailableText = "Domain is not available.", ErroneousDomainText = "Error.", PrintErrors = true, FinishText = "Bye." }; return(result); }
static void Main(string[] args) { bool printResultsAfterwards = true; DACConsoleSession session = new DACConsoleSession(DACSettings.GetDefaultSettings()); Console.WriteLine("Starting..."); DACSessionResult result = session.Start(); if (printResultsAfterwards) { if (result.AvailableDomains != null) { Console.WriteLine("\nAvailable domains:"); foreach (string domain in result.AvailableDomains) { Console.WriteLine(domain); } } if (result.UnavailableDomains != null) { Console.WriteLine("\nUnavailable domains:"); foreach (string domain in result.UnavailableDomains) { Console.WriteLine(domain); } } if (result.ErroneousDomains != null) { Console.WriteLine("\nErroneous domains:"); foreach (string domain in result.ErroneousDomains) { Console.WriteLine(domain); } } } }
public DACConsoleSession(DACSettings settings) { this.settings = settings; }