private static string FormatUserID(string userID, BanInfo banInfo, UserState userState) { if (banInfo.Path != string.Empty) { return(TerminalStrings.Foreground(userID, TerminalColor.Red)); } else if (userState != UserState.Online) { return(TerminalStrings.Foreground(userID, TerminalColor.BrightBlack)); } else { return(userID); } }
private async Task TestAsync() { while (!this.cancellation.IsCancellationRequested) { if (this.IsPrompt == true) { this.shell.CurrentDirectory = $"{DateTime.Now}"; } else { Console.Write(DateTime.Now + Environment.NewLine + "wow" + Environment.NewLine + DateTime.Now + Environment.NewLine + "wow"); await this.Out.WriteAsync(DateTime.Now + Environment.NewLine + "wow" + Environment.NewLine + DateTime.Now + Environment.NewLine + "wow"); await this.Out.WriteAsync(TerminalStrings.Foreground("01234567890123456789012345678901234567890123456789012345678901234567890123456789", TerminalColor.Red)); await this.Out.WriteAsync(DateTime.Now + Environment.NewLine + "wow" + Environment.NewLine + DateTime.Now + Environment.NewLine + "wow"); var v = DateTime.Now.Millisecond % 4; // v = 2; switch (v) { case 0: await this.Out.WriteLineAsync(DateTime.Now + Environment.NewLine + "wow" + Environment.NewLine + "12093810938012"); break; case 1: await this.Out.WriteAsync(DateTime.Now + Environment.NewLine + "wow" + Environment.NewLine + DateTime.Now + Environment.NewLine + "wow" + Environment.NewLine + DateTime.Now + Environment.NewLine + "wow" + Environment.NewLine + DateTime.Now + Environment.NewLine + "wow" + Environment.NewLine + DateTime.Now + Environment.NewLine + "wow"); break; case 2: await this.Out.WriteAsync("01234567890123456789012345678901234567890123456789012345678901234567890123456789"); break; case 3: await this.Out.WriteLineAsync($"{DateTime.Now}"); break; } } Thread.Sleep(1000); } }