Beispiel #1
0
        /// <summary>
        /// ログインデータからログインを行います。
        /// 自動ログイン時などに使われます。
        /// </summary>
        private void ExecuteLogin(object sender, ExecutedRoutedEventArgs e)
        {
            if (this.model == null)
            {
                return;
            }

            try
            {
                // ログイン処理を行い、必要ならダイアログを表示します。
                var loginData = LoginInternal();
                if (loginData != null)
                {
                    if (IsShowMessageDialog)
                    {
                        DialogUtil.Show(
                            "ログインできました。ヽ( *^∇^*)ノ*:・'゚☆",
                            "OK",
                            MessageBoxButton.OK);
                    }

                    DialogResult = true;
                }
                else
                {
                    DialogUtil.ShowError(
                        "ログインできませんでした。( ´ω`)");
                }
            }
            catch (Exception ex)
            {
                DialogUtil.ShowError(ex,
                                     "ログインに失敗しました。( ´ω`)");
            }
        }
Beispiel #2
0
        /// <summary>
        /// 放送に接続します。
        /// </summary>
        private void ConnectButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (!this.nicoClient.IsLogin)
                {
                    MessageBox.Show(
                        "ログインしていません。",
                        "エラー",
                        MessageBoxButton.OK,
                        MessageBoxImage.Error);
                    return;
                }

                /*Live.LiveInfo.Create(
                 *  "lv203771397",
                 *  this.nicoClient.CookieContainer);*/

                this.commentClient.Connect(
                    LiveUrl,
                    this.nicoClient.CookieContainer);
                this.commentClient.StartReceiveMessage(1000);
            }
            catch (Exception ex)
            {
                DialogUtil.ShowError(ex,
                                     "放送への接続に失敗しました。");
                return;
            }

            DialogUtil.Show(
                "接続に成功しました。",
                "OK",
                MessageBoxButton.OK);
        }
Beispiel #3
0
 private void picQuit_Click(object sender, EventArgs e)
 {
     //如有子页面全部关闭
     if (this.MdiChildren.Length > 0)
     {
         foreach (Form myForm in this.MdiChildren)
         {
             myForm.Close();
         }
     }
     this.Dispose();
     DialogUtil.Show(new LoginFrm(false));
     //Application.Exit();
 }
Beispiel #4
0
 /// <summary>
 ///  退出功能
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void QuitToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //如有子页面全部关闭
     if (this.MdiChildren.Length > 0)
     {
         foreach (Form myForm in this.MdiChildren)
         {
             myForm.Close();
         }
     }
     CacheHelper.RemoveAllCache();
     this.Dispose();
     DialogUtil.Show(new LoginFrm(false));
     //Application.Exit();
 }
Beispiel #5
0
        /// <summary>
        /// 更新情報の確認やダイアログの表示などを行います。
        /// </summary>
        public void CheckToUpdate(TimeSpan timeout)
        {
            if (this.updateWindow != null || this.progressWindow != null)
            {
                // すでに確認用のウィンドウが起動しています。
                return;
            }

            if (!this.updater.LatestVersionEvent.WaitOne(timeout))
            {
                DialogUtil.ShowError(
                    string.Format(
                        "更新情報の確認ができません(T¬T){0}{0}" +
                        "少し時間をおいてから、もう一度試してみて下さい。",
                        Environment.NewLine));
                return;
            }

            var latestVersion = this.updater.LatestVersion;

            if (latestVersion == null)
            {
                DialogUtil.Show("更新はありません d(-_☆)", "確認", MessageBoxButton.OK);
                return;
            }

            // ファイルのダウンロード中なら
            if (!this.updater.DownloadDoneEvent.WaitOne(0))
            {
                ShowProgress();
            }
            else
            {
                if (ConfirmUpdate(true))
                {
                    ExecuteUpdate();
                }
            }
        }