Exemple #1
0
 public void DeleteKey()
 {
     if (ContextManager.SingularKey == null)
     {
         MessageBox.Show("No Keys Selected");
     }
     else
     {
         foreach (ListViewItem Selected in KeyListView.SelectedItems)
         {
             ContextManager.CurrentKeySelection = ContextManager.CurrentKeySelection + 1;
             Key KeySelect = (Key)KeyListView.SelectedItems[0].Tag;
             Key delKey    = KeyChainManager.FindKey(ContextManager.SelectedGroup, KeySelect);
             KeyChainManager.DeleteKey(KeyChainManager.FindGroup(ContextManager.SelectedGroup), delKey);
             invokeKeyModified("Deleted", KeySelect);
             KeyListView.BeginUpdate();
             ContextManager.SingularKey = null;
             KeyListView.SelectedItems[0].Remove();
             KeyListView.EndUpdate();
         }
         KeyChainManager.KeyChain.IsModified = true;
         ContextManager.invokeKeySelected();
         ContextManager.invokeKeysCurrentlySelected();
     }
 }
Exemple #2
0
 private void _OnColumnClick(object sender, ColumnClickEventArgs e)
 {
     if (this.KeyListView.Sorting != SortOrder.Ascending)
     {
         this.KeyListView.Sorting = SortOrder.Ascending;
     }
     else
     {
         this.KeyListView.Sorting = SortOrder.Descending;
     }
     KeyListView.Sort();
 }
Exemple #3
0
 private void KeyListView_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ContextManager.SelectedGroup == null)
     {
         KeyListView.Clear();
     }
     ContextManager.CurrentKeySelection = 0;
     foreach (ListViewItem Selected in KeyListView.SelectedItems)
     {
         ContextManager.CurrentKeySelection = ContextManager.CurrentKeySelection + 1;
         string KeyName = Selected.Text;
         foreach (Key k in ContextManager.SelectedGroup.Keys)
         {
             if (KeyName == k.Title)
             {
                 ContextManager.SingularKey = k;
             }
         }
     }
     ContextManager.invokeKeySelected();
     ContextManager.invokeKeysCurrentlySelected();
 }
Exemple #4
0
 private void OnGroupSelected(Group g)
 {
     if (this.CurrentlyActive == true)
     {
         if (g == null)
         {
             KeyListView.Clear();
         }
         else
         {
             KeyListView.Items.Clear();
             foreach (Key k in g.Keys)
             {
                 ListViewItem l = KeyListView.Items.Add(k.Title);
                 l.Font = preffont;
                 l.SubItems.Add(k.Username);
                 l.SubItems.Add(k.Password);
                 l.SubItems.Add(k.URL);
                 l.Tag = k;
             }
         }
     }
 }