Ejemplo n.º 1
0
 /// <summary>
 /// ウィンドウが開かれた
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     whoWatchClient = new WhoWatchClient();
     whoWatchClient.OnCommentReceiveEach += whoWatchClient_OnCommentReceiveEach;
     whoWatchClient.OnCommentReceiveDone += whoWatchClient_OnCommentReceiveDone;
     whoWatchClient.OnLiveIdChanged      += WhoWatchClient_OnLiveIdChanged;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// ふわっちクライアントからコメントを受信した
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="comment"></param>
        private void whoWatchClient_OnCommentReceiveEach(WhoWatchClient sender, CommentStruct comment)
        {
            // コメントの追加
            UiCommentData uiCommentData = new UiCommentData();

            uiCommentData.UserThumbUrl = comment.UserThumbUrl;
            uiCommentData.UserName     = comment.UserName;
            uiCommentData.CommentStr   = comment.Text;

            System.Diagnostics.Debug.WriteLine("UserThumbUrl " + uiCommentData.UserThumbUrl);
            System.Diagnostics.Debug.WriteLine("UserName " + uiCommentData.UserName);
            System.Diagnostics.Debug.WriteLine("CommentStr " + uiCommentData.CommentStr);

            ViewModel viewModel = this.DataContext as ViewModel;
            ObservableCollection <UiCommentData> uiCommentDataList = viewModel.UiCommentDataCollection;

            uiCommentDataList.Add(uiCommentData);

            // コメントログを記録
            writeLog(uiCommentData.UserName, uiCommentData.CommentStr);

            // 棒読みちゃんへ送信
            bouyomiChan.Talk(uiCommentData.CommentStr);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// ライブIDが変更された
 /// </summary>
 /// <param name="sender"></param>
 private void WhoWatchClient_OnLiveIdChanged(WhoWatchClient sender)
 {
     updateAccountName();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// ふわっちクライアントのコメント受信が完了した
 /// </summary>
 /// <param name="sender"></param>
 private void whoWatchClient_OnCommentReceiveDone(WhoWatchClient sender)
 {
     // データグリッドを自動スクロール
     dataGridScrollToEnd();
 }