Exemplo n.º 1
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();
 }
Exemplo n.º 2
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;
            };
        }
Exemplo n.º 3
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;
            };
        }
Exemplo n.º 4
0
 private void _003CInitEvent_003Eb__7(object sender, MouseEventArgs e)
 {
     if (canLogin)
     {
         MouseTool.ShowIBeam();
     }
 }
Exemplo n.º 5
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(); });
                }
            };
        }
Exemplo n.º 6
0
        private void InitEvent()
        {
            LawDownloader lawDownloader = Singleton_LawDownloader.GetInstance();

            Start_callback      += new LawListCT_DownloadFileStart_Function(LawListCT_DownloadFileStart_Callback);
            Progress_callback   += new LawListCT_DownloadProgressChanged_Function(LawListCT_DownloadProgressChanged_Callback);
            Finish_callback     += new LawListCT_DownloadFileCompleted_Function(LawListCT_DownloadFileCompleted_Callback);
            UnZip_callback      += new LawListCT_UnZip_Function(LawListCT_UnZip_Callback);
            UnZipError_callback += new LawListCT_UnZipError_Function(LawListCT_UnZipError_Callback);
            GetBookVMs_ByMeetingFileCate_callback = new LawListCT_GetBookVMs_ByMeetingFileCate_Function(LawListCT_GetBookVMs_ByMeetingFileCate_Callback);

            lawDownloader.LawListCT_DownloadFileStart_Event       += Start_callback;
            lawDownloader.LawListCT_DownloadProgressChanged_Event += Progress_callback;
            lawDownloader.LawListCT_DownloadFileCompleted_Event   += Finish_callback;
            lawDownloader.LawListCT_UnZip_Event      += UnZip_callback;
            lawDownloader.LawListCT_UnZipError_Event += UnZipError_callback;

            txtKeyword.MouseEnter += (sender, e) => { MouseTool.ShowIBeam(); txtKeyword.Focus(); };
            txtKeyword.MouseLeave += (sender, e) => { MouseTool.ShowArrow(); }; //Keyboard.ClearFocus();
            txtKeyword.KeyUp      += txtKeyword_KeyUp;
            txtKeyword.Focus();
        }
Exemplo n.º 7
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 void _003CInitEvent_003Eb__b(object sender, MouseEventArgs e)
 {
     MouseTool.ShowIBeam();
     txtKeyword.Focus();
 }
Exemplo n.º 9
0
 private static void _003CInitEvent_003Eb__8(object sender, MouseEventArgs e)
 {
     MouseTool.ShowIBeam();
 }
Exemplo n.º 10
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;
        }
Exemplo n.º 11
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);
        }