private void PwEntry_ContextMenu_Opening(object sender, CancelEventArgs e)
{
var selectedEntries = pluginHost.MainWindow.GetSelectedEntries();
if (selectedEntries != null) {
foreach (var entry in selectedEntries) {
// if any selected entry contains an SSH key then we show the KeeAgent menu item
if (entry.GetKeeAgentSettings().AllowUseOfSshKey) {
pwEntryContextMenuLoadKeyMenuItem.Visible = true;
var agentModeAgent = this.agent as Agent;
if (agentModeAgent != null && agentModeAgent.IsLocked)
{
pwEntryContextMenuLoadKeyMenuItem.Enabled = false;
pwEntryContextMenuLoadKeyMenuItem.Text = Translatable.StatusLocked;
} else {
pwEntryContextMenuLoadKeyMenuItem.Enabled = true;
pwEntryContextMenuLoadKeyMenuItem.Text = Translatable.LoadKeyContextMenuItem;
}
return;
}
}
}
pwEntryContextMenuLoadKeyMenuItem.Visible = false;
}