Exemplo n.º 1
0
        private void OldPassHovered()
        {
            infoSelection                  = InfoSelection.None;
            SelectedOldPassListIndex       = -1;
            SelectedOldPasswordParentIndex = -1;
            OldPassSelectionStartIndex     = -1;


            if (HoveredOldPassIndex >= 0)
            {
                int oldpassrectindex = HoveredOldPassIndex / 4;
                int total            = -1;
                for (int i = 0; i < passwords.ActivePerson.PasswordEntities.Count; i++)
                {
                    if (passwords.ActivePerson.PasswordEntities[i].OldPasswords.Count == 0)
                    {
                        continue;
                    }
                    total += passwords.ActivePerson.PasswordEntities[i].OldPasswords.Count;
                    if (oldpassrectindex <= total)
                    {
                        SelectedOldPasswordParentIndex = i;
                        total -= passwords.ActivePerson.PasswordEntities[i].OldPasswords.Count;
                        for (int j = 0; j < passwords.ActivePerson.PasswordEntities[i].OldPasswords.Count; j++)
                        {
                            total++;
                            if (total == oldpassrectindex)
                            {
                                SelectedOldPassListIndex = j;
                                break;
                            }
                        }

                        break;
                    }
                }
            }


            OldPassSelectionStartIndex = (HoveredOldPassIndex / 4) * 4;

            if (HoveredOldPassIndex % 4 == 0 || HoveredOldPassIndex % 4 == 1)
            {
                infoSelection = InfoSelection.Copy;
            }
            else if (HoveredOldPassIndex % 4 == 2)
            {
                infoSelection = InfoSelection.Edit;
            }
            else if (HoveredOldPassIndex % 4 == 3)
            {
                infoSelection = InfoSelection.Delete;
            }
        }
Exemplo n.º 2
0
 private void ResetSelections()
 {
     HoveredNameIndex            = -1;
     HoveredInfoIndex            = -1;
     HoveredOldPassIndex         = -1;
     SelectedPasswordEntityIndex = -1;
     SelectedOldPassListIndex    = -1;
     SelectedOldPassIndex        = -1;
     selection     = Selection.None;
     infoSelection = InfoSelection.None;
 }
Exemplo n.º 3
0
        private void InfoHovered()
        {
            infoSelection = InfoSelection.None;
            SelectedPasswordEntityIndex = -1;
            //Name Details and extra info Fields
            if (HoveredInfoIndex < 9)
            {
                if (HoveredInfoIndex == 1 || HoveredInfoIndex == 2)
                {
                    infoSelection = InfoSelection.Name;
                }
                else if (HoveredInfoIndex == 4 || HoveredInfoIndex == 5)
                {
                    infoSelection = InfoSelection.Details;
                }
                else if (HoveredInfoIndex == 7 || HoveredInfoIndex == 8)
                {
                    infoSelection = InfoSelection.ExtraInfo;
                }
            }
            // password Field Selection
            else
            {
                SelectedPasswordEntityIndex = (HoveredInfoIndex - 9) / 6;
                InfoSelectionStartIndex     = (SelectedPasswordEntityIndex * 6 + 9);

                if (HoveredInfoIndex % 6 == 3 || HoveredInfoIndex % 6 == 1)
                {
                    infoSelection = InfoSelection.Edit;
                }
                else if (HoveredInfoIndex % 6 == 4)
                {
                    infoSelection = InfoSelection.CopyEmail;
                }
                else if (HoveredInfoIndex % 6 == 5 || HoveredInfoIndex % 6 == 0)
                {
                    infoSelection = InfoSelection.CopyPassword;
                }
                else if (HoveredInfoIndex % 6 == 2)
                {
                    infoSelection = InfoSelection.Delete;
                }
            }
        }