static void PrintDomain(Contest.Domain domain) { var myDomainsList = Config.Domains; if (myDomainsList.Contains(domain.Name)) { Console.BackgroundColor = ConsoleColor.White; Console.ForegroundColor = ConsoleColor.Black; } Console.Write(domain.Name.PadRight(35)); Console.ResetColor(); if (domain.Changed) { Console.BackgroundColor = ConsoleColor.DarkBlue; } if (domain.Status == "checking") { Console.ForegroundColor = ConsoleColor.Green; } if (domain.Status == "Winner '19") { Console.ForegroundColor = ConsoleColor.Blue; } if (domain.Status == "Empty") { Console.ForegroundColor = ConsoleColor.Red; } Console.Write(domain.Status.PadRight(14)); Console.ResetColor(); if (domain.Status != "Empty") { if (domain.Authors.Any(x => x == Config.userName || x == Config.userNameSecond)) { Console.ForegroundColor = ConsoleColor.Green; } Console.Write(domain.Authors.First().PadRight(35)); Console.ResetColor(); if (domain.Status == "checking") { Console.Write($"-{DateTime.Now.Subtract(domain.WinningTemplatePublished).Subtract(TimeSpan.FromDays(3)).TotalDays.ToString("0.0")} d"); } else { Console.Write($"{TimeSpan.FromDays(3).Subtract(DateTime.Now.Subtract(domain.WinningTemplatePublished)).TotalHours.ToString("0.0")} h".PadLeft(1)); } } Console.WriteLine(); }
public async Task <Domain> AdvanceAsync() { var domain = await Domain.CreateAsync(Name, Status); return(domain); }