Exemplo n.º 1
0
        public StartBroadcastViewModel()
        {
            this.config = Model.Config.GetConfig();

            this.FrontLayerVisibility = Visibility.Hidden;
            this.IdVisible = BooleanType.False;
            this.AnonymousOnly = BooleanType.False;

            this.StartBroadcastCommand = new RelayCommand(p => {
                this.StartEntry(false);
            });
            this.StartTestBroadcastCommand = new RelayCommand(p => {
                var message = "テスト配信を開始します。よろしいですか?\n\nテスト配信は画質のチェックや音量の確認などを行うための機能です。\n配信通知は行われませんが、配信は10分程度で強制的に終了します。URLを教えれば他の人に見てもらうことも可能です。なお、録画は残ります。";
                var result = MessageBox.Show(message, "確認", MessageBoxButton.OKCancel, MessageBoxImage.Question, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
                if (result != MessageBoxResult.OK) {
                    return;
                }
                this.StartEntry(true);
            });
            this.LoadPreviousSettingCommand = new RelayCommand(p => {
                this.LoadPreviousSetting();
            });

            this.client = new CaveTubeClientWrapper();
            client.Connect();
        }
Exemplo n.º 2
0
		private async Task Init() {
			this.config = Model.Config.GetConfig();

			this.FrontLayerVisibility = Visibility.Hidden;
			this.IdVisible = BooleanType.False;
			this.AnonymousOnly = BooleanType.False;
			this.LoginOnly = BooleanType.False;

			this.StartBroadcastCommand = new RelayCommand(p => {
				this.StartEntry(false);
			});
			this.StartTestBroadcastCommand = new RelayCommand(p => {
				var message = "テスト配信を開始します。よろしいですか?\n\nテスト配信は配信通知が行われません。\nただし、配信は10分で自動終了します。\nそれ以外は通常の配信と同等です。";
				var result = MessageBox.Show(message, "確認", MessageBoxButton.OKCancel, MessageBoxImage.Question, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
				if (result != MessageBoxResult.OK) {
					return;
				}
				this.StartEntry(true);
			});
			this.LoadPreviousSettingCommand = new RelayCommand(p => {
				this.LoadPreviousSetting();
			});

			var accessKey = await CavetubeAuth.GetAccessKeyAsync(config.AccessKey);
			config.AccessKey = accessKey;
			config.Save();
			this.client = new CaveTubeClientWrapper(accessKey);
			this.client.Connect();

			this.genres = await this.RequestGenreAsync(this.config.ApiKey);
			this.Genre = this.genres.First();

			this.thumbnails = await this.RequestThumbnailsAsync(this.config.ApiKey);
			this.Thumbnail = this.thumbnails.First();
		}