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

            if (model.Result != null)
            {
                renderer.Write(model.Result.ToString(), ConsoleColor.Cyan);
            }
        }
Exemplo n.º 5
0
        private void Template(ConsoleRenderer renderer, TemplateModel model)
        {
            renderer.WriteMessage(model.Message);

            if (model.DefaultValue != null)
            {
                renderer.Write($"({model.DefaultValue}) ");
            }
        }
Exemplo n.º 6
0
        private void FinishTemplate(ConsoleRenderer renderer, FinishTemplateModel model)
        {
            renderer.WriteMessage(model.Message);

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