コード例 #1
0
        public async Task GetTitles()
        {
            OvrStreamConnection connection = new OvrStreamConnection(OvrStreamWebSocketAddress);
            await connection.ConnectAsync(CancellationToken.None);

            var titles = await connection.GetTitlesAsync(CancellationToken.None);

            Assert.IsNotNull(titles);
            Assert.Greater(titles.Length, 0);

            var imageBase64 = await connection.GetTitleIconAsync(titles[0], 114, 114, CancellationToken.None);

            Assert.IsNotNull(imageBase64);
            Assert.Greater(imageBase64.Length, 0);

            await connection.DisconnectAsync(CancellationToken.None);
        }
コード例 #2
0
        public async Task DeactivateAndActivateTitle()
        {
            OvrStreamConnection connection = new OvrStreamConnection(OvrStreamWebSocketAddress);
            await connection.ConnectAsync(CancellationToken.None);

            await connection.DeactivateTitleAsync("Basic BRB Screen", CancellationToken.None);

            await Task.Delay(2000);

            await connection.ActivateTitleAsync("Basic BRB Screen", CancellationToken.None);

            await Task.Delay(1000);

            var titles = await connection.GetTitlesAsync(CancellationToken.None);

            var title = titles.Single(t => t.Name.Equals("Basic BRB Screen", StringComparison.InvariantCultureIgnoreCase));
            await connection.DeactivateTitleAsync(title, CancellationToken.None);

            await Task.Delay(2000);

            await connection.ActivateTitleAsync(title, CancellationToken.None);

            await connection.DisconnectAsync(CancellationToken.None);
        }