Example #1
0
        public override void Read(ConsoleReadContext context, IntegerTaskParameter param)
        {
            var value = UtilConsole.ReadInteger(param.Label, param.MinValue, param.MaxValue, param.DefaultValue);

            if (value == null)
            {
                context.IsCanceled = true;
                return;
            }

            context[param.Name] = value.Value;
        }
Example #2
0
        public override void LoadFromConsole(IntegerRangeModel columnModel)
        {
            var min = UtilConsole.ReadInteger("min");

            if (min == null)
            {
                throw new ApplicationException("Aborted");
            }

            var max = UtilConsole.ReadInteger("max");

            if (max == null)
            {
                throw new ApplicationException("Aborted");
            }

            columnModel.Min = min.Value;
            columnModel.Max = max.Value;
        }
Example #3
0
        public override void LoadFromConsole(RandomCharsModel columnModel)
        {
            var allowedChars = UtilConsole.ReadString("allowed chars");

            var min = UtilConsole.ReadInteger("min length");

            if (min == null)
            {
                throw new ApplicationException("Aborted");
            }

            var max = UtilConsole.ReadInteger("max length");

            if (min == null)
            {
                throw new ApplicationException("Aborted");
            }

            columnModel.AllowedChars = allowedChars;
            columnModel.MinLength    = min.Value;
            columnModel.MaxLength    = max.Value;
        }