/// <summary>
 /// Indica che le operazioni sulle password sono terminate
 /// </summary>
 public void EndOperation()
 {
     RenewLogin      = false;
     OperationStatus = PwdOperationStatus.Finished;
     if (PwdAlert != null)
     {
         PwdAlert.OnTimeout -= PwdAlert_OnTimeout;
     }
     PwdAlert = null;
     Debug.WriteLine("End operation in session");
 }
        private void PwdAlert_OnTimeout(object sender, EventArgs e)
        {
            if (OperationStatus == PwdOperationStatus.Finished ||
                OperationStatus == PwdOperationStatus.Aborted)
            {
                return;
            }

            RenewLogin      = true;
            OperationStatus = PwdOperationStatus.Timeout;
            Debug.WriteLine("Session timeout");
        }
        /// <summary>
        /// Indica l'avvio di una operazione sulle password
        /// </summary>
        public void BeginOperation()
        {
            EndOperation();

            RenewLogin      = false;
            OperationStatus = PwdOperationStatus.Started;

            PwdAlert = new Alert
            {
                Timeout = App.Settings.SessionTimeout
            };
            PwdAlert.OnTimeout += PwdAlert_OnTimeout;
            PwdAlert.StartTimer();
            Debug.WriteLine("Start operation in session");
        }
 public PwdSecurityManager()
 {
     RenewLogin         = false;
     OperationStatus    = PwdOperationStatus.Pending;
     StrengthCalculator = new Zxcvbn.Zxcvbn();
 }