private void Template(ConsoleRenderer renderer, TemplateModel model) { renderer.WriteMessage(model.Message); renderer.Write(model.Filter); for (int i = 0; i < model.Options.Count; i++) { var value = model.Options[i].Value; renderer.WriteLine(); if (model.SelectedIndex == i) { renderer.Write($"> {value}", ConsoleColor.Green); } else { renderer.Write($" {value}"); } } }
private void Template(ConsoleRenderer renderer, TemplateModel model) { renderer.WriteMessage(model.Message); renderer.Write(model.Filter); if (_showConfirm && string.IsNullOrEmpty(model.Filter)) { renderer.Write(" Press Tab to confirm", Prompt.ColorSchema.Answer); } for (int i = 0; i < model.Options.Count; i++) { var currentOption = model.Options[i]; var value = currentOption.Value; renderer.WriteLine(); if (model.SelectedOptions.Contains(currentOption) && model.CurrentIndex != i && currentOption.Enabled) { renderer.Write($" {ArrowRight} ", Prompt.ColorSchema.Select); renderer.Write($"{value}"); } else if (model.CurrentIndex == i && currentOption.Enabled && !_disabledByLimit.Contains(currentOption)) { renderer.Write($" {ArrowRight} {value}", Prompt.ColorSchema.Select); } // Check whether this option was disabled by default or whether it was disabled by the limiter else if (!currentOption.Enabled || _disabledByLimit.Contains(currentOption)) { renderer.Write($" {value} (disabled)", Prompt.ColorSchema.DisabledOption); } else { renderer.Write($" {value}", Console.ForegroundColor); } } }
private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model) { renderer.WriteMessage(model.Message); renderer.Write(model.Options[model.SelectedIndex].Value, ConsoleColor.Cyan); }
private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model) { renderer.WriteMessage(model.Message); renderer.Write(model.Result ? "Yes" : "No", Prompt.ColorSchema.Answer); }
private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model) { renderer.WriteMessage(model.Message); renderer.Write(model.Options[model.SelectedIndex].Value, Prompt.ColorSchema.Answer); }
private void Template(ConsoleRenderer renderer, TemplateModel model) { renderer.WriteMessage(model.Message); renderer.Write(new string('*', model.InputLength)); }
private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model) { renderer.WriteMessage(model.Message); renderer.Write(model.Result ? "Yes" : "No", ConsoleColor.Cyan); }