Example #1
0
        public MainWindow()
        {
            random     = new Random();
            generator  = new KenoLoader();
            _calculate = new Calculate();
            SystemMax  = generator.MaxSystem;
            SystemMin  = generator.MinSystem;
            InitializeComponent();
            this.Loaded  += MainWindow_Loaded;
            this.Closing += MainWindow_Closing;
            for (int i = 1; i <= generator.Maxnumber; i++)
            {
                var numberstat = new NumberStat()
                {
                    Number = i
                };
                numberStatDict[i] = numberstat;
                _numbersStatistic.Add(numberstat);
            }
            SavePlayer  = new Command <Player>(SaveClick);
            KillCommand = new Command <Player>(KillPlayer);

            stakes.Add(1, 1);
            stakes.Add(2, 2);
            stakes.Add(3, 5);
            stakes.Add(4, 10);
            stakes.Add(5, 15);
        }
Example #2
0
        public async Task GenerateNumbers()
        {
            cancellationTokenSource = new CancellationTokenSource();
            CancellationToken token = cancellationTokenSource.Token;

            GeneratorResult = new List <int>();
            CanRunGenerator = false;
            INumbersGenerator numbersGenerator = NumbersGeneratorFactory.CreateGenerator(GetGeneratorParams());

            try
            {
                GeneratorResult = await Task.Run(() => numbersGenerator.Generate(token), token);
            }
            catch (OperationCanceledException)
            {
                cancellationTokenSource = null;
                return;
            }

            await SaveResult();
            await InitailizeDataAsync();
        }
 public PhoneConfirmationService(Provider provider, INumbersGenerator numbersGenerator, ISmsService smsService)
 {
     this._provider         = provider;
     this._smsService       = smsService;
     this._numbersGenerator = numbersGenerator;
 }