Exemple #1
0
 public TicTacToePage()
 {
     InitializeComponent();
     _state = new BasicObserver <MatchState>();
     BackButton.Hide();
     _gameOver = false;
 }
Exemple #2
0
 public TicTacToePage()
 {
     InitializeComponent();
     _state = new BasicObserver<MatchState>();
     BackButton.Hide();
     _gameOver = false;
 }
Exemple #3
0
 private void ExitGame()
 {
     Dispose();
     UpdateTimer.Enabled = false;
     _state = new BasicObserver<MatchState>();
     _gameOver = false;
     var mainMenu = new MainMenu();
     mainMenu.ShowDialog();
 }
Exemple #4
0
        private void ExitGame()
        {
            Dispose();
            UpdateTimer.Enabled = false;
            _state    = new BasicObserver <MatchState>();
            _gameOver = false;
            var mainMenu = new MainMenu();

            mainMenu.ShowDialog();
        }
        public async void Normal()
        {
            var result = AsyncEnumerable.Range(1, 5)
                         .ToObservable();

            var consumer = new BasicObserver <int>();

            using (result.Subscribe(consumer))
            {
                await consumer.TerminateTask;

                Assert.Equal(new List <int>(new[] { 1, 2, 3, 4, 5 }), consumer.Values);
                Assert.Null(consumer.Error);
                Assert.True(consumer.Completed);
            }
        }
        public async void Error()
        {
            var ex     = new InvalidOperationException();
            var result = AsyncEnumerable.Error <int>(ex)
                         .ToObservable();

            var consumer = new BasicObserver <int>();

            using (result.Subscribe(consumer))
            {
                await consumer.TerminateTask;

                Assert.Empty(consumer.Values);
                Assert.Same(ex, consumer.Error);
                Assert.False(consumer.Completed);
            }
        }
        public async void Take()
        {
            var consumer = new BasicObserver <long>();

            using (AsyncEnumerable.Timer(TimeSpan.FromMilliseconds(200))
                   .ToObservable()
                   .Subscribe(consumer))
            {
                await Task.Delay(100);
            }

            await Task.Delay(200);

            Assert.Empty(consumer.Values);
            Assert.Null(consumer.Error);
            Assert.False(consumer.Completed);
        }