Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model)
        {
            renderer.WriteMessage(model.Message);

            if (model.Result != null)
            {
                renderer.Write(model.Result.ToString(), ConsoleColor.Cyan);
            }
        }
Beispiel #4
0
        private void Template(ConsoleRenderer renderer, TemplateModel model)
        {
            renderer.WriteMessage(model.Message);

            if (model.DefaultValue != null)
            {
                renderer.Write($"({model.DefaultValue}) ");
            }
        }
Beispiel #5
0
        private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model)
        {
            renderer.WriteMessage(model.Message);

            if (model.Result != null)
            {
                renderer.Write(model.Result.ToString(), Prompt.ColorSchema.Answer);
            }
        }
Beispiel #6
0
        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) ");
            }
        }
Beispiel #7
0
        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}");
                }
            }
        }
Beispiel #8
0
        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);
                }
            }
        }
Beispiel #9
0
 private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model)
 {
     renderer.WriteMessage(model.Message);
     renderer.Write(model.Options[model.SelectedIndex].Value, ConsoleColor.Cyan);
 }
Beispiel #10
0
 private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model)
 {
     renderer.WriteMessage(model.Message);
     renderer.Write(model.Result ? "Yes" : "No", Prompt.ColorSchema.Answer);
 }
Beispiel #11
0
 private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model)
 {
     renderer.WriteMessage(model.Message);
     renderer.Write(model.Options[model.SelectedIndex].Value, Prompt.ColorSchema.Answer);
 }
Beispiel #12
0
 private void Template(ConsoleRenderer renderer, TemplateModel model)
 {
     renderer.WriteMessage(model.Message);
     renderer.Write(new string('*', model.InputLength));
 }
Beispiel #13
0
 private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model)
 {
     renderer.WriteMessage(model.Message);
     renderer.Write(model.Result ? "Yes" : "No", ConsoleColor.Cyan);
 }