Пример #1
0
        private void InitEvent()
        {
            btnNO.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnNO.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnNO.MouseLeftButtonDown += (sender, e) => { this.DialogResult = false; tbPinCode.Text = ""; this.Close(); };

            btnYes.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnYes.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnYes.MouseLeftButtonDown += (sender, e) =>
            {
                CallWS();
            };

            tbPinCode.MouseEnter += (sender, e) => { MouseTool.ShowIBeam(); };
            tbPinCode.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };

            tbPinCode.PreviewKeyDown += tbPinCode_PreviewKeyDown;
            tbPinCode.Focus();

            btnPinCodeClear.MouseEnter += (sender, e) => { MouseTool.ShowHand(); };
            btnPinCodeClear.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };
            btnPinCodeClear.Click      += (sender, e) =>
            {
                tbPinCode.Text             = "";
                btnPinCodeClear.Visibility = Visibility.Collapsed;
            };
        }
Пример #2
0
        private void InitEvent()
        {
            btnDownload.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnDownload.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnDownload.MouseLeftButtonDown += btnDownload_MouseLeftButtonDown;

            btnDelete.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnDelete.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnDelete.MouseLeftButtonDown += btnDelete_MouseLeftButtonDown;

            btnOpen.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnOpen.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnOpen.MouseLeftButtonDown += btnOpen_MouseLeftButtonDown;

            btnUpdate.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnUpdate.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnUpdate.MouseLeftButtonDown += btnDownload_MouseLeftButtonDown;

            // 在這裡呼叫並且掛上MeetingDataCT的下載事件
            //if (IsLastRow == true && LawListCT_HangTheDownloadEvent_Event != null)
            if (IsAllLawRowFinished == true && LawListCT_HangTheDownloadEvent_Event != null)
            {
                LawListCT_HangTheDownloadEvent_Event(this.lawItem.ID);
            }
        }
Пример #3
0
        private void InitEvent()
        {
            switch (meetingUserType)
            {
            case MeetingUserType.議事管理人員:
                if (this.EnableTxtPLSSigned == true)
                {
                    txtPLSSigned.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
                    txtPLSSigned.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
                    txtPLSSigned.MouseLeftButtonDown += txtUnSigned_MouseLeftButtonDown;

                    imgSignedPic.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
                    imgSignedPic.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
                    imgSignedPic.MouseLeftButtonDown += txtUnSigned_MouseLeftButtonDown;
                }

                break;

            case MeetingUserType.與會人員:
                break;

            case MeetingUserType.代理人:
                break;

            case MeetingUserType.其它:
                break;
            }
        }
Пример #4
0
 private void InitEvent()
 {
     btnProgress.MouseEnter += delegate
     {
         MouseTool.ShowHand();
     };
     btnProgress.MouseLeave += delegate
     {
         MouseTool.ShowArrow();
     };
     btnProgress.Click     += btnProgress_Click;
     cbProgress.MouseLeave += delegate
     {
         cbProgress_SelectionChanged(cbProgress, new EventArgs());
     };
     txtAgendaName.MouseEnter += delegate
     {
         MouseTool.ShowHand();
     };
     txtAgendaName.MouseLeave += delegate
     {
         MouseTool.ShowArrow();
     };
     txtAgendaName.MouseLeftButtonDown += txtName_MouseLeftButtonDown;
 }
Пример #5
0
        private void InitEvent()
        {
            MVWindow_IsInSync_And_IsSyncOwner_Callback = new MVWindow_IsInSync_And_IsSyncOwner_Function(IsInSync_And_IsSyncOwner);
            MVWindow_MVAction_Callback = new MVWindow_MVAction_Function(MVAction);
            Singleton_Socket.mvWindow_OpenIEventManager.MVWindow_IsInSync_And_IsSyncOwner_Event += MVWindow_IsInSync_And_IsSyncOwner_Callback;
            Singleton_Socket.mvWindow_OpenIEventManager.MVWindow_MVAction_Event += MVWindow_MVAction_Callback;

            // 滑鼠偵測
            MouseTimer          = new DispatcherTimer();
            MouseTimer.Interval = TimeSpan.FromMilliseconds(1100);
            MouseTimer.Tick    += new EventHandler(MouseTimer_Tick);
            MouseTimer.Start();


            // 播放進度偵測
            MediaPlayerTimer          = new DispatcherTimer();
            MediaPlayerTimer.Interval = TimeSpan.FromMilliseconds(200);
            MediaPlayerTimer.Tick    += new EventHandler(MediaPlayerTimer_Tick);
            //MediaPlayerTimer.Start();

            btnClose.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnClose.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnClose.MouseLeftButtonDown += btnClose_MouseLeftButtonDown;

            btnSync.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnSync.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnSync.MouseLeftButtonDown += btnSync_MouseLeftButtonDown;

            btnLight.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnLight.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnLight.MouseLeftButtonDown += btnSync_MouseLeftButtonDown;

            btnFunction.MouseEnter += (sender, e) => { MouseTool.ShowHand(); };
            btnFunction.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };


            HeaderDP.MouseEnter += (sender, e) => { IsAlwaysShowHeaderFooter = true; };
            HeaderDP.MouseLeave += (sender, e) => { IsAlwaysShowHeaderFooter = false; };
            FooterDP.MouseEnter += (sender, e) => { IsAlwaysShowHeaderFooter = true; };
            FooterDP.MouseLeave += (sender, e) => { IsAlwaysShowHeaderFooter = false; };

            //SeekBar.MouseEnter += (sender, e) => { MouseTool.ShowHand(); };
            //SeekBar.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };
            SeekBar.ValueChanged += SeekBar_ValueChanged;


            mediaPlayer.MediaOpened += MediaPlayer_MediaOpened;
            mediaPlayer.Play();

            btnFunction.Source = new BitmapImage(new Uri("images/mv_pause.png", UriKind.Relative));

            img_animation.MouseLeftButtonDown += AnimationController_MouseLeftButtonDown;
            btnFunction.MouseLeftButtonDown   += AnimationController_MouseLeftButtonDown;
            mediaPlayer.MouseLeftButtonDown   += AnimationController_MouseLeftButtonDown;

            cbBooks.SelectionChanged += cbBooks_SelectionChanged;

            // PageJson
            ParsePageJson();
        }
Пример #6
0
        private void InitEvent()
        {
            btnNO.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnNO.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnNO.MouseLeftButtonDown += (sender, e) => { this.DialogResult = false;  tbPinCode.Text = ""; this.Close(); };

            btnYes.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnYes.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnYes.MouseLeftButtonDown += (sender, e) => {
                if (tbPinCode.Text.Trim().Equals("") == true)
                {
                    AutoClosingMessageBox.Show(string.Format("請先輸入{0}識別碼", PaperLess_Emeeting.Properties.Settings.Default.CourseOrMeeting_String));
                    return;
                }
                this.DialogResult = true; this.Close();
            };

            tbPinCode.MouseEnter += (sender, e) => { MouseTool.ShowIBeam(); };
            tbPinCode.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };

            tbPinCode.PreviewKeyDown += tbPinCode_PreviewKeyDown;
            tbPinCode.Focus();

            btnPinCodeClear.MouseEnter += (sender, e) => { MouseTool.ShowHand(); };
            btnPinCodeClear.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };
            btnPinCodeClear.Click      += (sender, e) =>
            {
                tbPinCode.Text             = "";
                btnPinCodeClear.Visibility = Visibility.Collapsed;
            };
        }
Пример #7
0
        private void InitEvent()
        {
            btnProgress.MouseEnter += (sender, e) => { MouseTool.ShowHand(); };
            btnProgress.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };
            btnProgress.Click      += btnProgress_Click;

            //cbProgress.DropDownClosed += cbProgress_DropDownClosed;
            //cbProgress.SelectionChanged += cbProgress_SelectionChanged;
            //cbProgress.SelectionChanged += SelectionChangeCommitted;
            cbProgress.MouseLeave += (sender, e) =>
            {
                cbProgress_SelectionChanged(cbProgress, new EventArgs());
            };
            txtAgendaName.MouseEnter += (sender, e) => {
                //if (IsHasFile == true  || (IsHasChildren==true && IsParent==true))
                MouseTool.ShowHand();
            };
            txtAgendaName.MouseLeave += (sender, e) => {
                //if (IsHasFile == true  || (IsHasChildren == true && IsParent == true))
                MouseTool.ShowArrow();
            };
            txtAgendaName.MouseLeftButtonDown += txtName_MouseLeftButtonDown;


            //notUse
            //txtName.AddHandler(TextBlock.MouseLeftButtonDownEvent
            //                , new MouseButtonEventHandler(txtName_MouseLeftButtonDown)
            //                , true);
        }
Пример #8
0
 private void _003CInitEvent_003Eb__c(object sender, MouseEventArgs e)
 {
     if (canLogin)
     {
         MouseTool.ShowHand();
     }
 }
Пример #9
0
 private void _003CInitEvent_003Eb__2(object sender, MouseEventArgs e)
 {
     MouseTool.ShowHand();
     if (!btnImg.Source.ToString().Contains("images/icon_arrow_active.png"))
     {
         base.Background = ColorTool.HexColorToBrush("#f1f5f6");
     }
 }
Пример #10
0
        private void InitEvent()
        {
            //txtIsSigned.MouseEnter += (sender, e) => { MouseTool.ShowHand(); };
            //txtIsSigned.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };
            //txtIsSigned.MouseLeftButtonDown += txtIsSigned_MouseLeftButtonDown;

            btnIndex.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); }; //ClearBorderColor(); btnIndex.BorderBrush = Brushes.Gray; };
            btnIndex.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnIndex.MouseLeftButtonDown += (sender, e) =>
            {
                ClearButtonColor();
                this.btnIndex.Background = ColorTool.HexColorToBrush("#019fde");
                this.txtIndex.Foreground = Brushes.White;
                ChangeSignRow_ByOrder(SignListCT_Order.序號);
            };

            btnDept.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); }; //ClearBorderColor(); btnDept.BorderBrush = Brushes.Gray; };
            btnDept.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnDept.MouseLeftButtonDown += (sender, e) =>
            {
                ClearButtonColor();
                this.btnDept.Background = ColorTool.HexColorToBrush("#019fde");
                this.txtDept.Foreground = Brushes.White;
                ChangeSignRow_ByOrder(SignListCT_Order.機關單位);
            };
            btnIsSigned.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); }; //ClearBorderColor(); btnIsSigned.BorderBrush = Brushes.Gray; };
            btnIsSigned.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnIsSigned.MouseLeftButtonDown += (sender, e) =>
            {
                ClearButtonColor();
                this.btnIsSigned.Background = ColorTool.HexColorToBrush("#019fde");
                this.txtIsSigned.Foreground = Brushes.White;
                ChangeSignRow_ByOrder(SignListCT_Order.是否簽到);
            };


            txtKeyword.MouseEnter += (sender, e) => { MouseTool.ShowIBeam(); txtKeyword.Focus(); };
            txtKeyword.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); }; //Keyboard.ClearFocus();
            txtKeyword.KeyUp      += txtKeyword_KeyUp;
            txtKeyword.Focus();

            btnAddUser.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnAddUser.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnAddUser.MouseLeftButtonDown += (sender, e) =>
            {
                Home Home_Window = Application.Current.Windows.OfType <Home>().FirstOrDefault();
                if (Home_Window != null)
                {
                    Home_Window.CC.Content = new SignPadCT("guest", "來賓", "", "", (x, y) => { Home_Window.CC.Content = new SignListCT_Mix(); });
                }
            };
        }
Пример #11
0
        private void InitEvent()
        {
            // 下載事件不能這麼快掛上去,要等全部FileRow產生完成,在掛上去
            // 不然如果在下載中,會阻塞到UI的產生
            FileDownloader fileDownloader = Singleton_FileDownloader.GetInstance(userMeeting.ID);

            Start_callback       = new MeetingRoom_DownloadFileStart_Function(MeetingRoom_DownloadFileStart_Callback);
            Progress_callback    = new MeetingRoom_DownloadProgressChanged_Function(MeetingRoom_DownloadProgressChanged_Callback);
            ErrorFinish_callback = new MeetingRoom_DownloadFileToErrorCompleted_Function(MeetingRoom_DownloadFileToErrorCompleted_Callback);

            fileDownloader.MeetingRoom_DownloadFileStart_Event            += Start_callback;
            fileDownloader.MeetingRoom_DownloadProgressChanged_Event      += Progress_callback;
            fileDownloader.MeetingRoom_DownloadFileToErrorCompleted_Event += ErrorFinish_callback;


            this.MouseLeftButtonDown += MeetingRoom_MouseLeftButtonDown;

            btnSeries.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnSeries.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnSeries.MouseLeftButtonDown += btnSeries_MouseLeftButtonDown;

            btnDelete.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnDelete.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnDelete.MouseLeftButtonDown += btnDelete_MouseLeftButtonDown;

            btnRefresh.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnRefresh.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnRefresh.MouseLeftButtonDown += btnDownload_btnPausing_MouseLeftButtonDown;

            btnDownload.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnDownload.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnDownload.MouseLeftButtonDown += btnDownload_btnPausing_MouseLeftButtonDown;

            // 要變成暫停下載
            btnPause.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnPause.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnPause.MouseLeftButtonDown += btnPause_MouseLeftButtonDown;

            // 要變成繼續下載
            btnPausing.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnPausing.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnPausing.MouseLeftButtonDown += btnDownload_btnPausing_MouseLeftButtonDown;
        }
Пример #12
0
        private void InitEvent()
        {
            this.MouseEnter += (sender, e) => {
                MouseTool.ShowHand();
                if (this.btnImg.Source.ToString().Contains("images/icon_arrow_active.png") == false)
                {
                    this.Background = ColorTool.HexColorToBrush("#f1f5f6");
                }
                //lblMousehover.Visibility = Visibility.Visible;
            };
            this.MouseLeave += (sender, e) => {
                MouseTool.ShowArrow();
                if (this.btnImg.Source.ToString().Contains("images/icon_arrow_active.png") == false)
                {
                    this.Background = Brushes.Transparent;
                }
                //lblMousehover.Visibility = Visibility.Collapsed;
            };

            this.MouseLeftButtonDown += SeriesMenu_MouseLeftButtonDown;
        }
Пример #13
0
        private void InitEvent()
        {
            btnNO.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnNO.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnNO.MouseLeftButtonDown += (sender, e) => { this.DialogResult = false;  this.Close(); };

            btnYes.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnYes.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnYes.MouseLeftButtonDown += (sender, e) =>
            {
                if (ReConfirm)
                {
                    MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show($"確定刪除「{FolderName}」資料夾及所有檔案資料?", "刪除 資料夾", System.Windows.MessageBoxButton.YesNo);
                    if (messageBoxResult == MessageBoxResult.Yes)
                    {
                        CallWS();
                    }
                }
                else
                {
                    CallWS();
                }
            };

            //tbPinCode.MouseEnter += (sender, e) => { MouseTool.ShowIBeam(); };
            //tbPinCode.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };

            //tbPinCode.PreviewKeyDown += tbPinCode_PreviewKeyDown;
            //tbPinCode.Focus();

            //btnPinCodeClear.MouseEnter += (sender, e) => { MouseTool.ShowHand(); };
            //btnPinCodeClear.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };
            //btnPinCodeClear.Click += (sender, e) =>
            //{
            //    tbPinCode.Text = "";
            //    btnPinCodeClear.Visibility = Visibility.Collapsed;
            //};
        }
Пример #14
0
        private void InitEvent()
        {
            btnExport.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnExport.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnExport.MouseLeftButtonDown += (sender, e) =>
            {
                Task.Factory.StartNew(() => {
                    Singleton_PDFFactory.AddBookInPDFWork(fileItem.ID);
                    this.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        btnExport.Visibility   = Visibility.Collapsed;
                        btnDownload.Visibility = Visibility.Collapsed;
                        sb.Begin();
                        DataTable dt = MSCE.GetDataTable("select PDFFactoryParameterJson from FileRow where userid=@1 and id=@2"
                                                         , fileItem.UserID
                                                         , fileItem.ID);
                        if (dt.Rows.Count > 0)
                        {
                            PDFFactoryParameter pdfFactoryParameter = JsonConvert.DeserializeObject <PDFFactoryParameter>(dt.Rows[0][0].ToString());
                            Home home = Application.Current.Windows.OfType <Home>().First();

                            if (home.IsInSync == true)
                            {
                                pdfFactoryParameter.UserAccount += "_Sync";
                            }

                            Singleton_PDFFactory.SavePDF(pdfFactoryParameter);
                        }
                    }));
                    Singleton_PDFFactory.RemoveBookInPDFWork(fileItem.ID);
                });
            };

            btnDownload.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnDownload.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnDownload.MouseLeftButtonDown += (sender, e) =>
            {
                Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
                //Environment.SpecialFolder.MyDocuments
                //This cannot be found as it is not a valid path, so nothing gets selected.
                dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                dlg.FileName         = FileNameTool.PureFileName(fileItem.FileName); // Default file name
                dlg.DefaultExt       = ".pdf";                                       // Default file extension
                dlg.Filter           = "PDF documents (.pdf)|*.pdf";                 // Filter files by extension
                // Show save file dialog box
                Nullable <bool> result = dlg.ShowDialog();
                // Process save file dialog box results
                if (result == true)
                {
                    // Save document
                    string srcFilePath  = System.IO.Path.Combine(fileItem.UnZipFilePath, "PDF.pdf");
                    string saveFilePath = dlg.FileName;
                    if (File.Exists(srcFilePath) == true)
                    {
                        File.Copy(srcFilePath, saveFilePath, true);
                    }
                }
            };


            //偵測是否轉檔中
            timer          = new DispatcherTimer();
            timer.Interval = TimeSpan.FromMilliseconds(1100);
            timer.Tick    += (sender, e) =>
            {
                if (Singleton_PDFFactory.IsPDFInWork(fileItem.ID) == true)
                {
                    //this.Dispatcher.BeginInvoke(new Action(() =>
                    //    {
                    //        //Console.Write(sb.GetIsPaused());
                    //        //sb.Begin();
                    //    }));
                    this.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        pdfStatus              = PDFStatus.匯出中;
                        btnExport.Visibility   = Visibility.Collapsed;
                        btnDownload.Visibility = Visibility.Collapsed;
                        txtStatus.Text         = pdfStatus.ToString();
                    }));
                }
                else if (File.Exists(System.IO.Path.Combine(fileItem.UnZipFilePath, "PDF.pdf")) == true && fileItem.FileType == MeetingFileType.已下載完成)
                {
                    this.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        sb.Stop();
                        pdfStatus              = PDFStatus.匯出成功;
                        btnExport.Visibility   = Visibility.Visible;
                        btnDownload.Visibility = Visibility.Visible;
                        txtStatus.Text         = pdfStatus.ToString();
                    }));
                }
                else
                {
                    this.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        sb.Stop();
                        pdfStatus              = PDFStatus.尚未匯出;
                        btnExport.Visibility   = Visibility.Collapsed;
                        btnDownload.Visibility = Visibility.Collapsed;
                        txtStatus.Text         = pdfStatus.ToString();
                    }));
                }
            };
            timer.Start();
        }
Пример #15
0
        private void InitEvent()
        {
            btnDownload.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnDownload.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnDownload.MouseLeftButtonDown += btnDownload_MouseLeftButtonDown;

            btnOpen.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnOpen.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnOpen.MouseLeftButtonDown += btnOpen_MouseLeftButtonDown;

            btnPause.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnPause.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnPause.MouseLeftButtonDown += btnPause_MouseLeftButtonDown;

            btnPausing.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnPausing.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnPausing.MouseLeftButtonDown += btnPausing_MouseLeftButtonDown;

            if (fileItem.CanUpdate == true)
            {
                txtFileName.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
                txtFileName.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
                txtFileName.MouseLeftButtonDown += txtFileName_MouseLeftButtonDown;
            }

            //if (PaperLess_Emeeting.Properties.Settings.Default.AssemblyName.Contains("TPI4F") == true)
            //{
            //        txtIndex.ToolTip = "開啟PDF";
            //        txtIndex.MouseEnter += (sender, e) => { MouseTool.ShowHand(); };
            //        txtIndex.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };
            //        txtIndex.MouseLeftButtonDown += (sender, e) =>
            //        {

            //            if (Singleton_PDFFactory.IsPDFInWork(fileItem.ID) == true)
            //            {
            //                AutoClosingMessageBox.Show("PDF轉檔中,請稍後");
            //                return;
            //            }

            //            string filePath = ClickOnceTool.GetFilePath();

            //            //string _bookPath = System.IO.Path.Combine(filePath, fileItem.UnZipFilePath);
            //            string UnZipFileFolder = PaperLess_Emeeting.Properties.Settings.Default.File_UnZipFileFolder;
            //            //string _bookPath = filePath + "\\" + UnZipFileFolder + "\\" + UserID + "\\" + MeetingID + "\\"+ fileItem.ID +"\\"+fileItem.FileVersion.ToString();
            //            // 等於上面那個路徑
            //            string _bookPath = fileItem.UnZipFilePath;

            //            // 從資料庫查詢上一次完成的檔案版本
            //            DataTable dt = MSCE.GetDataTable("SELECT FinishedFileVersion FROM FileRow where ID=@1 and UserID=@2 and MeetingID=@3"
            //                                    , meetingDataDownloadFileFile.ID
            //                                    , UserID
            //                                    , MeetingID);
            //            if (dt.Rows.Count > 0)
            //            {
            //                _bookPath = filePath + "\\" + UnZipFileFolder + "\\" + UserID + "\\" + MeetingID + "\\" + fileItem.ID + "\\" + dt.Rows[0]["FinishedFileVersion"].ToString();
            //            }

            //            string PdfPath = System.IO.Path.Combine(_bookPath, "PDF.pdf"); ;
            //            if (File.Exists(PdfPath) == false)
            //            {
            //                AutoClosingMessageBox.Show("請先瀏覽過書籍");
            //                return;
            //            }
            //            //在背景執行,無DOS視窗閃爍問題
            //            //System.Diagnostics.Process p = new System.Diagnostics.Process();
            //            //p.StartInfo.FileName = "cmd.exe";
            //            //p.StartInfo.Arguments = "/c "+ PdfPath;
            //            //p.StartInfo.UseShellExecute = false;
            //            //p.StartInfo.RedirectStandardInput = true;
            //            //p.StartInfo.RedirectStandardOutput = true;
            //            //p.StartInfo.RedirectStandardError = true;
            //            //p.StartInfo.CreateNoWindow = true;
            //            //p.Start();

            //            Process.Start(PdfPath);

            //        };
            //}

            Task.Factory.StartNew(() =>
            {
                // 重要觀念
                // 這裡已經是非同步了
                // 所以這裡的IsLastRow,雖然是最後一個
                // 但是不一定是最後才載入完成的
                // 所以會有狀態不一的問題發生。
                // 最簡單的方法就是在下面加上Thread.Sleep(100);
                // 或是Callback 回 MeetingDataCT
                // 判斷已經載入完成InitUI的數量等於FileRow數量
                // 不過要記得寫Callback
                // 在這裡呼叫並且掛上MeetingDataCT的下載事件
                //if (IsLastRow == true && MeetingDataCT_HangTheDownloadEvent_Event != null)
                if (IsAllFileRowFinished == true && MeetingDataCT_HangTheDownloadEvent_Event != null)
                {
                    // 先暫停一下,
                    // 慢一點再把自動下載的事件,加上去
                    //Thread.Sleep(100);
                    // 如果是自動下載,在這裡面判斷。

                    MeetingDataCT_HangTheDownloadEvent_Event(this.fileItem.ID);
                }
            });
        }
Пример #16
0
        private void InitEvent()
        {
            tbUserID.MouseEnter += (sender, e) => { if (canLogin == true)
                                                    {
                                                        MouseTool.ShowIBeam();                     /*tbUserID.Focus();*/
                                                    }
            };
            tbUserID.MouseLeave += (sender, e) => { if (canLogin == true)
                                                    {
                                                        MouseTool.ShowArrow();
                                                    }
            };
            tbUserID.PreviewKeyDown += tbUserID_PreviewKeyDown;
            tbUserID.KeyDown        += tbUserID_KeyDown;

            btnUserIDClear.MouseEnter += (sender, e) => { if (canLogin == true)
                                                          {
                                                              MouseTool.ShowHand();                     /*tbUserID.Focus();*/
                                                          }
            };
            btnUserIDClear.MouseLeave += (sender, e) => { if (canLogin == true)
                                                          {
                                                              MouseTool.ShowArrow();
                                                          }
            };
            btnUserIDClear.Click += (sender, e) => { tbUserID.Text = ""; btnUserIDClear.Visibility = Visibility.Collapsed; };

            tbUserPWD.MouseEnter += (sender, e) => { if (canLogin == true)
                                                     {
                                                         MouseTool.ShowIBeam();                     /*tbUserPWD.Focus();*/
                                                     }
            };
            tbUserPWD.MouseLeave += (sender, e) => { if (canLogin == true)
                                                     {
                                                         MouseTool.ShowArrow();
                                                     }
            };
            tbUserPWD.PreviewKeyDown += tbUserID_PreviewKeyDown;
            tbUserPWD.KeyDown        += tbUserID_KeyDown;

            btnUserPWDClear.MouseEnter += (sender, e) => { if (canLogin == true)
                                                           {
                                                               MouseTool.ShowHand();                     /*tbUserID.Focus();*/
                                                           }
            };
            btnUserPWDClear.MouseLeave += (sender, e) => { if (canLogin == true)
                                                           {
                                                               MouseTool.ShowArrow();
                                                           }
            };
            btnUserPWDClear.Click += (sender, e) => { tbUserPWD.Password = ""; btnUserPWDClear.Visibility = Visibility.Collapsed; };

            btnSubmit.MouseEnter += (sender, e) => { if (canLogin == true)
                                                     {
                                                         MouseTool.ShowHand();
                                                     }
            };
            btnSubmit.MouseLeave += (sender, e) => { if (canLogin == true)
                                                     {
                                                         MouseTool.ShowArrow();
                                                     }
            };
            btnSubmit.MouseLeftButtonDown += btnSubmit_MouseLeftButtonDown;

            this.KeyDown += tbUserID_KeyDown;
        }
 private static void _003CInitEvent_003Eb__d(object sender, MouseEventArgs e)
 {
     MouseTool.ShowHand();
 }
Пример #18
0
 private void InitEvent()
 {
     btnSign.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
     btnSign.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
     btnSign.MouseLeftButtonDown += btnSign_MouseLeftButtonDown;
 }
Пример #19
0
        private void InitEvent()
        {
            txtKeyword.MouseEnter += (sender, e) => { MouseTool.ShowIBeam(); txtKeyword.Focus(); };
            txtKeyword.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); }; //Keyboard.ClearFocus();
            txtKeyword.KeyUp      += txtKeyword_KeyUp;
            txtKeyword.Focus();

            btnServerCtrl.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnServerCtrl.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnServerCtrl.MouseLeftButtonDown += btnServerCtrl_MouseLeftButtonDown;

            BroadcastCT_ChangeList_Callback = new BroadcastCT_ChangeList_Function(ChangeList);
            BroadcastCT_ClearList_Callback  = new BroadcastCT_ClearList_Function(ClearList);

            Singleton_Socket.broadcastCT_OpenIEventManager.BroadcastCT_ChangeList_Event += BroadcastCT_ChangeList_Callback;
            Singleton_Socket.broadcastCT_CloseIEventManager.BroadcastCT_ClearList_Event += BroadcastCT_ClearList_Callback;

            Task.Factory.StartNew(() => { return(SyncServerAlreadyStarted(MeetingID)); }).ContinueWith(task =>
            {
                try
                {
                    this.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        ChangeServerCtrl(task.Result);
                    }));

                    if (task.Result == false)
                    {
                        //AutoClosingMessageBox.Show("同步伺服器尚未啟動,請聯絡議事管理員開啟同步");
                        return;
                    }

                    try
                    {
                        SocketClient socketClient = Singleton_Socket.GetInstance(MeetingID, UserID, UserName, false);
                        Task.Factory.StartNew(() =>
                        {
                            if (socketClient != null && socketClient.GetIsConnected() == true)
                            {
                                socketClient.getUserList();
                            }
                            else
                            {
                                // AutoClosingMessageBox.Show("同步伺服器尚未啟動,請聯絡議事管理員開啟同步");
                            }
                        });
                    }
                    catch (Exception ex)
                    {
                        LogTool.Debug(ex);
                    }
                }
                catch (Exception ex)
                {
                    //AutoClosingMessageBox.Show("同步伺服器尚未啟動,請聯絡議事管理員開啟同步");
                    LogTool.Debug(ex);
                }
            }).ContinueWith(task => {
                while (CanDetectServerState)
                {
                    bool inList = SyncServerAlreadyStarted(MeetingID);
                    this.Dispatcher.BeginInvoke(new Action(() =>
                    {
                        ChangeServerCtrl(inList);
                    }));

                    SocketClient socketClient = Singleton_Socket.GetInstance(MeetingID, UserID, UserName, false);
                    //20150708 Add
                    Task.Factory.StartNew(() =>
                    {
                        if (socketClient != null && socketClient.GetIsConnected() == true)
                        {
                            socketClient.getUserList();
                        }
                        else
                        {
                            //AutoClosingMessageBox.Show("同步伺服器尚未啟動,請聯絡議事管理員開啟同步");
                        }
                    });
                    //socketClient.getUserList();
                    Console.WriteLine("Detect Server Alive => IsCompleted: {0} IsCanceled: {1} IsFaulted: {2}",
                                      task.IsCompleted, task.IsCanceled, task.IsFaulted);

                    Thread.Sleep(1000 * PaperLess_Emeeting.Properties.Settings.Default.DetectSyncServerSeconds);
                }
            }, tokenSource.Token);
        }
Пример #20
0
        private void InitEvent()
        {
            Home Home_Window = Application.Current.Windows.OfType <Home>().FirstOrDefault();

            if (Home_Window != null)
            {
                Home_Window.KeyDown += Home_Window_KeyDown;
            }

            btnYes.MouseEnter += (sender, e) => { MouseTool.ShowHand(); };
            btnYes.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };
            btnYes.MouseDown  += btnYes_MouseDown;

            btnNO.MouseEnter += (sender, e) => { MouseTool.ShowHand(); };
            btnNO.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };
            btnNO.MouseDown  += (sender, e) =>
            {
                if (PicUrl.Equals("") == false || StackLines.Count > 0)
                {
                    MessageBoxResult result = MessageBox.Show("是否要清除簽名檔", "系統訊息", MessageBoxButton.OKCancel);

                    if (result == MessageBoxResult.Cancel)
                    {
                        return;
                    }
                    PicUrl = "";
                }
                imgSignedPicPanel.Visibility = Visibility.Collapsed;
                txtPLS.Visibility            = Visibility.Visible;
                SignPadPanel.Visibility      = Visibility.Visible;
                SignPad.Children.Clear();
                SignPad.Strokes.Clear();
                StackLines.Clear();
            };

            btnBack.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnBack.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnBack.MouseLeftButtonDown += (sender, e) => { Home_GoBackTogSignPictureCT_Event("", ""); };

            SignPad.MouseEnter += (sender, e) => { MouseTool.ShowPen(); };
            SignPad.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };
            //SignPad.MouseDown += SignPad_MouseDown;
            //SignPad.MouseMove += SignPad_MouseMove;
            //SignPad.MouseUp += SignPad_MouseUp;
            SignPad.PreviewMouseLeftButtonDown += (sender, e) =>
            {
                txtPLS.Visibility = Visibility.Collapsed;
            };



            imgSignedPicPanel.MouseEnter += (sender, e) => { MouseTool.ShowPen(); };
            imgSignedPicPanel.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };
            imgSignedPicPanel.PreviewMouseLeftButtonDown += (sender, e) =>
                                                            //imgSignedPicPanel.MouseLeftButtonDown += (sender, e) =>
            {
                imgSignedPicPanel.Visibility = Visibility.Collapsed;
                txtPLS.Visibility            = Visibility.Visible;
                SignPadPanel.Visibility      = Visibility.Visible;
            };

            btnSignOut.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnSignOut.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnSignOut.MouseLeftButtonDown += (sender, e) =>
            {
                MessageBoxResult result = MessageBox.Show("您確定要簽退?", "系統訊息", MessageBoxButton.YesNo);
                if (result != MessageBoxResult.Yes)
                {
                    return;
                }

                MouseTool.ShowLoading();

                GetSignOutUpload.AsyncPOST(MeetingID, DeptID, UserID, (so) => { GetSignOutUpload_DoAction(so); });
            };
        }
Пример #21
0
 private void InitEvent()
 {
     this.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
     this.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
     this.MouseLeftButtonDown += UserControl_MouseLeftButtonDown;
 }
Пример #22
0
        //TouchPoint TouchStart=default(TouchPoint);
        //bool AlreadySwiped = false;
        private void InitEvent()
        {
            //this.TouchDown += new EventHandler<TouchEventArgs>((sender,e) =>
            //{
            //    TouchStart = e.GetTouchPoint(this);
            //    txtPinCode.Text = "111";
            //});

            //this.TouchMove += new EventHandler<TouchEventArgs>((sender, e) =>
            //{
            //    if (!AlreadySwiped)
            //    {
            //        var Touch = e.GetTouchPoint(this);
            //        //right now a swipe is 200 pixels
            //        //Swipe Left
            //        if (TouchStart != null && Touch.Position.X > (TouchStart.Position.X + 200))
            //        {
            //            SwipeLeft();
            //            AlreadySwiped = true;
            //        }
            //        //Swipe Right
            //        if (TouchStart != null && Touch.Position.X < (TouchStart.Position.X - 200))
            //        {
            //            SwipeRight();
            //            AlreadySwiped = true;
            //        }
            //    }
            //    e.Handled = true;
            //});

            btnAdd.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnAdd.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnAdd.MouseLeftButtonDown += btnAdd_MouseLeftButtonDown;

            btnLast.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnLast.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnLast.MouseLeftButtonDown += btnLastNext_MouseLeftButtonDown;

            btnNext.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
            btnNext.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
            btnNext.MouseLeftButtonDown += btnLastNext_MouseLeftButtonDown;

            txtPinCode.MouseEnter += (sender, e) => { MouseTool.ShowIBeam(); txtPinCode.Focus(); };
            txtPinCode.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); };
            txtPinCode.KeyDown    += txtPinCode_KeyDown;
            txtPinCode.Focus();

            SV.ScrollToVerticalOffset(1);
            SV.ScrollChanged += (sender, e) =>
            {
                if (SV.CanContentScroll == false)
                {
                    Show_HiddenMeetingDayList();
                }
            };

            SV.MouseLeftButtonUp += (sender, e) =>
            {
                if (PaperLess_Emeeting.Properties.Settings.Default.AssemblyName.Contains("TPI4F") == false)
                {
                    string tagData = SV.Tag as string;

                    if (tagData != null && tagData.Equals("MoveRight"))
                    {
                        MouseButtonEventArgs args = new MouseButtonEventArgs(Mouse.PrimaryDevice, 100, MouseButton.Left);
                        args.RoutedEvent = UIElement.MouseLeftButtonDownEvent;
                        btnLast.RaiseEvent(args);

                        //UIElement container = VisualTreeHelper.GetParent(SV) as UIElement;
                        //Point MeetingDaySP_Point = MeetingDaySP.TranslatePoint(new Point(0, 0), container);
                        //Point SPP_Point = SPP.TranslatePoint(new Point(0, 0), container);

                        //double MeetingDaySP_From = MeetingDaySP_Point.X;
                        //double MeetingDaySP_To = MeetingDaySP_Point.X - SPP_Point.X;

                        //double SPP_From = SPP_Point.X;
                        //double SPP_To = MeetingDaySP_Point.X;

                        //TranslateTransform trans = new TranslateTransform();
                        //MeetingDaySP.RenderTransform = trans;
                        //DoubleAnimation ani = new DoubleAnimation(MeetingDaySP_From, MeetingDaySP_To, TimeSpan.FromMilliseconds(1000));
                        //trans.BeginAnimation(TranslateTransform.XProperty, ani);

                        //TranslateTransform trans = new TranslateTransform();
                        //SPP.RenderTransform = trans;
                        //DoubleAnimation ani = new DoubleAnimation(SPP_From, SPP_To, TimeSpan.FromMilliseconds(1000));
                        //trans.BeginAnimation(TranslateTransform.XProperty, ani);
                    }


                    if (tagData != null && tagData.Equals("MoveLeft"))
                    {
                        MouseButtonEventArgs args = new MouseButtonEventArgs(Mouse.PrimaryDevice, 100, MouseButton.Left);
                        args.RoutedEvent = UIElement.MouseLeftButtonDownEvent;
                        btnNext.RaiseEvent(args);
                    }
                }
            };

            //SV.MouseWheel += (sender, e) =>
            //    {
            //        MessageBox.Show("11");
            //    };
            //SV.ScrollChanged += (sender, e) =>
            //{
            //    //if (SV.CanContentScroll == true)
            //    //{
            //        if (e.VerticalOffset == 0 && e.VerticalChange <0 )
            //        {
            //            //MessageBox.Show(e.VerticalOffset.ToString());
            //            IEnumerable<MeetingDayList> list =MeetingDaySP.Children.OfType<MeetingDayList>();
            //            foreach(MeetingDayList mdl in list)
            //            {
            //                mdl.Visibility=Visibility.Visible;
            //            }
            //        }
            //    //}
            //};

            //this.MouseWheel += MeetingListCT_MouseWheel;
        }
Пример #23
0
 private void InitEvent()
 {
     LightGrid.MouseEnter          += (sender, e) => { MouseTool.ShowHand(); };
     LightGrid.MouseLeave          += (sender, e) => { MouseTool.ShowArrow(); };
     LightGrid.MouseLeftButtonDown += LightGrid_MouseLeftButtonDown;
 }
Пример #24
0
 private static void _003CInitEvent_003Eb__8(object sender, System.Windows.Input.MouseEventArgs e)
 {
     MouseTool.ShowHand();
 }