Esempio n. 1
0
 void sync_OnSyncDeviceDeleted()
 {
     Application.Current.Dispatcher.BeginInvoke((Action)(() =>
     {
         SystemTray.Logout();
         if (sync != null)
         {
             sync.SyncNoUser();
         }
     }));
 }
Esempio n. 2
0
        //void pbData_LoginToProfile(CredentialsRequiredEventArgs obj)
        //{
        //    logger.Debug("pbData_LoginToProfile");
        //    Application.Current.Dispatcher.Invoke(new Action(() =>
        //    {
        //        logger.Debug("pbData_LoginToProfile->Invoke");
        //        MasterPwdBox masterDialog = pbData.PinEnabled() ? new MasterPwdBox(true) : new MasterPwdBox();
        //        bool? res = masterDialog.ShowDialog() ?? false;
        //        if (res.Value)
        //        {
        //            if (pbData.PinEnabled())
        //            {
        //                obj.Password = pbData.GetMasterPwdFromPin(masterDialog.Password);
        //            }
        //            else
        //            {
        //                obj.Password = masterDialog.Password;
        //            }
        //        }
        //        else
        //        {
        //            obj.Cancel = true;
        //        }
        //    }));
        //}

        void ProfileLock(string eml)
        {
            logger.Debug("ProfileLock for {0}", eml);
            Application.Current.Dispatcher.BeginInvoke((Action)(() =>
            {
                if (this.Visibility == System.Windows.Visibility.Visible)
                {
                    SystemTray.Logout();
                }
            }));
        }
Esempio n. 3
0
        void sync_OnSyncFinished(bool status)
        {
            // RIO - Hot path
            if (!status)
            {
                try
                {
                    string _path = pbData.StorePath;

                    Application.Current.Dispatcher.Invoke((Action)(() =>
                    {
                        SystemTray.Logout();
                    }));

                    int cnt = 3;
                    do
                    {
                        Thread.Sleep(250);
                        try
                        {
                            if (Directory.Exists(_path))
                            {
                                Directory.Delete(_path, true);
                            }
                            cnt = 0;
                        }
                        catch (Exception ex)
                        {
                            logger.Error(ex.ToString());
                        }
                        cnt--;
                    } while (cnt > 0);

                    _finishVerification = false;
                }
                catch (Exception ex)
                {
                    logger.Error(ex.ToString());
                }
                finally
                {
                    Application.Current.Dispatcher.BeginInvoke((Action)(() =>
                    {
                        LoginWindow loginWindow = ((PBApp)Application.Current).FindWindow <LoginWindow>();
                        loginWindow.NavigateloginScreens();
                    }));
                    evtDone.Set();
                }
            }
            else
            {
                try
                {
                    LoginViewModel.CheckRSA(new GenerateKeysStep().Execute(), pbData, webAPI);
                    SyncImagesHelper syncImages = new SyncImagesHelper(this.pbData, this.webAPI);
                    syncImages.SyncImages();
                    _finishVerification = true;
                }
                finally
                {
                    evtDone.Set();
                }
            }
        }