private void Template(ConsoleRenderer renderer, TemplateModel model) { renderer.WriteMessage(model.Message); if (model.DefaultValue != null) { renderer.Write($"({(model.DefaultValue.Value ? "yes" : "no")}) "); } else { renderer.Write("(y/N) "); } }
private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model) { renderer.WriteMessage(model.Message); string joined = string.Join(", ", model.SelectedOptions.Select(res => res.Value)); renderer.Write(joined, ConsoleColor.Cyan); }
private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model) { renderer.WriteMessage(model.Message); var joined = string.Join(", ", model.SelectedOptions.Select(res => res.Value)); renderer.Write(joined, Prompt.ColorSchema.Answer); }
private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model) { renderer.WriteMessage(model.Message); if (model.Result != null) { renderer.Write(model.Result.ToString(), ConsoleColor.Cyan); } }
private void Template(ConsoleRenderer renderer, TemplateModel model) { renderer.WriteMessage(model.Message); if (model.DefaultValue != null) { renderer.Write($"({model.DefaultValue}) "); } }
private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model) { renderer.WriteMessage(model.Message); if (model.Result != null) { renderer.Write(model.Result.ToString(), Prompt.ColorSchema.Answer); } }
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); }