Exemple #1
0
        private void FieldAction(ToolStripMenuItem Item, string FieldName, FIELD_ACTION action)
        {
            if (Item == null)
            {
                return;
            }

            PwEntry Entry = (PwEntry)Item.Tag;

            if (Entry == null)
            {
                return;
            }
            SetLastOne(Item);
            if (FieldName == PwDefs.PasswordField && PwDefs.IsTanEntry(Entry))
            {
                Entry.ExpiryTime = DateTime.Now;
                Entry.Expires    = true;
                Host.MainWindow.RefreshEntriesList();
                Host.MainWindow.UpdateUI(false, null, false, null, false, null, true);
            }

            if (action == FIELD_ACTION.CLIPBOARD_COPY)
            {
                ClipboardUtil.CopyAndMinimize(Entry.Strings.GetSafe(FieldName),
                                              true, Program.Config.MainWindow.MinimizeAfterClipboardCopy ?
                                              Host.MainWindow : null, Entry, Host.MainWindow.DocumentManager.ActiveDatabase);
                Host.MainWindow.StartClipboardCountdown();
            }
            else if (action == FIELD_ACTION.DRAG_DROP)
            {
                Item.DoDragDrop(Entry.Strings.ReadSafe(FieldName), DragDropEffects.Copy);
            }
        }