Ejemplo n.º 1
0
        private void GenerateButtonOnClicked(object sender, EventArgs eventArgs)
        {
            var constraint = new LotteryTicketConstraint(minValueStepper.Value.ToInt32(),
                                                         maxValueStepper.Value.ToInt32(), numberCountStepper.Value.ToInt32());

            numberGen = new NumberGen(constraint);
            var result = numberGen.Generate();

            result = result.OrderBy(e => e).ToList();
            var resStr = string.Join(",", result);

            resultLabel.Text = resStr;
        }
Ejemplo n.º 2
0
 public NumberGen(LotteryTicketConstraint constraint)
 {
     TicketConstraint = constraint;
     random           = new Random((int)DateTime.Now.Ticks & 0x0000FFFF);
 }