Exemple #1
0
        public async void OnMenuHIBP(object sender, EventArgs e)
        {
            bulkCheck = true;

            var progressDisplay = new ProgressDisplay();

            progressDisplay.Show();

            MainForm mainForm = HIBPOfflineCheckExt.Host.MainWindow;

            PwEntry[] selectedEntries = mainForm.GetSelectedEntries();

            for (int j = 0; j < selectedEntries.Length; j++)
            {
                PasswordEntry = selectedEntries[j];

                await System.Threading.Tasks.Task.Run(() => PasswordCheckWorker());

                TouchEntry(PasswordEntry);
                progressDisplay.progressBar.Value = (j + 1) * 100 / selectedEntries.Length;

                if (progressDisplay.UserTerminated)
                {
                    progressDisplay.Close();
                    break;
                }
            }

            UpdateUI();

            progressDisplay.Close();
        }
Exemple #2
0
        public async void CheckAll()
        {
            bulkCheck = true;

            var progressDisplay = new ProgressDisplay();

            progressDisplay.Show();

            var allEntries = new PwObjectList <PwEntry>();

            Host.Database.RootGroup.SearchEntries(SearchParameters.None, allEntries);

            var entries = allEntries.Select(x =>
                                            new { password = x, hash = GetPasswordHash(x) });
            int index = 0;

            foreach (var entry in entries)
            {
                await Task.Run(() => PasswordCheckWorker(entry.password, entry.hash));;
                TouchEntry(entry.password);

                progressDisplay.progressBar.Value = (index++) * 100 / allEntries.Count();

                if (progressDisplay.UserTerminated)
                {
                    progressDisplay.Close();
                    break;
                }
            }

            UpdateUI();

            progressDisplay.Close();
        }
Exemple #3
0
        public async void CheckAll()
        {
            bulkCheck = true;

            var progressDisplay = new ProgressDisplay();

            progressDisplay.Show();

            var allEntries = new PwObjectList <PwEntry>();

            Host.Database.RootGroup.SearchEntries(SearchParameters.None, allEntries);

            for (uint i = 0; i < allEntries.UCount; i++)
            {
                PasswordEntry = allEntries.GetAt(i);

                await System.Threading.Tasks.Task.Run(() => PasswordCheckWorker());

                TouchEntry(PasswordEntry);
                progressDisplay.progressBar.Value = ((int)i + 1) * 100 / ((int)allEntries.UCount);

                if (progressDisplay.UserTerminated)
                {
                    progressDisplay.Close();
                    break;
                }
            }

            UpdateUI();

            progressDisplay.Close();
        }
Exemple #4
0
        public async void OnMenuHIBP(object sender, EventArgs e)
        {
            bulkCheck = true;

            var progressDisplay = new ProgressDisplay();

            progressDisplay.Show();

            MainForm mainForm = HIBPOfflineCheckExt.Host.MainWindow;

            PwEntry[] selectedEntries = mainForm.GetSelectedEntries();

            if (selectedEntries != null)
            {
                var entries = selectedEntries.Select(x =>
                                                     new { password = x, hash = GetPasswordHash(x) });
                int index = 0;

                foreach (var entry in entries)
                {
                    await Task.Run(() => PasswordCheckWorker(entry.password, entry.hash));

                    TouchEntry(entry.password);

                    progressDisplay.progressBar.Value = (index++) * 100 / selectedEntries.Length;

                    if (progressDisplay.UserTerminated)
                    {
                        progressDisplay.Close();
                        break;
                    }
                }
            }

            UpdateUI();

            progressDisplay.Close();
        }