private void ResetTimer()
 {
     TextInactivityWarning.Text = "";
     TimerIdleWarning.Stop();
     TimerIdleWarning.Start();
     TimerIdleExit.Stop();
 }
 // User Inactivity Warning
 private void TimerIdleWarningDone(object sender, EventArgs e)
 {
     TimerIdleWarning.Stop();
     TimerIdleExit.Start();
     TextInactivityWarning.Text  = "GÜVENLİK UYARISI !";
     TextInactivityWarning.Text += Environment.NewLine;
     TextInactivityWarning.Text += "4 Dakikadır herhangi bir işlem yapmadınız. Güvenlik nedeni ile 60 saniye içinde oturumunuz kapanacak.";
 }
        private void ReturnToLoginForm()
        {
            TimerIdleWarning.Stop();
            TimerIdleExit.Stop();

            FormClosed            -= AccountForm_FormClosed;
            MouseMove             -= new MouseEventHandler(AccountForm_MouseMove);
            TimerIdleWarning.Tick -= TimerIdleWarningDone;
            TimerIdleExit.Tick    -= TimerIdleExitDone;

            MessageBox.Show("Güvenlik nedeni ile oturumunuz kapatıdı.");
            LoginFormRef.Show();
            this.Hide();
        }
Ejemplo n.º 4
0
        public AccountForm()
        {
            InitializeComponent();

            KeyPreview = true;

            FormClosed += AccountForm_FormClosed;
            MouseMove  += new MouseEventHandler(AccountForm_MouseMove);
            KeyDown    += new KeyEventHandler(AccountForm_KeyDown);


            TimerIdleWarning.Start();
            TimerIdleWarning.Tick += TimerIdleWarningDone;
            TimerIdleExit.Tick    += TimerIdleExitDone;

            TextInactivityWarning.Text = "";
        }
 // User Inactivity Timer end, handle shutdown form.
 private void TimerIdleExitDone(object sender, EventArgs e)
 {
     TimerIdleWarning.Stop();
     TimerIdleExit.Stop();
     ReturnToLoginForm();
 }