Example #1
0
        public void OnKeyEdit(object sender, EventArgs e)
        {
            KeyPropertiesForm f = new KeyPropertiesForm(ContextMgr.CurrentGroup, ContextMgr.CurrentKey);

            using (f)
            {
                if (f.ShowDialog(this) == DialogResult.Cancel)
                    return;
            }

            // save entries
            KeyPassMgr.ModifyKey(f.Group, f.Key);

               // UpdateGrid(f.Key, true);
            ContextMgr.FireGroupSelected();
        }
Example #2
0
        public void OnKeyAdd(object sender, EventArgs e)
        {
            if (ContextMgr.CurrentGroup == null)
            {
                MessageBox.Show("Please Select a Group.");
                return;
            }

            KeyPropertiesForm f = new KeyPropertiesForm(ContextMgr.CurrentGroup);
            using (f)
            {
                if (f.ShowDialog(this) == DialogResult.Cancel)
                    return;
            }

            KeyPassMgr.AddKey(f.Group, f.Key);

            //UpdateGrid(f.Key);
            ContextMgr.FireGroupSelected();
        }
Example #3
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		public void OnKeyEdit(object sender, EventArgs e)
		{
			Key selectedKey = (Key)_lvwKeys.SelectedItems[0].Tag;
			KeyPropertiesForm f = new KeyPropertiesForm(ContextMgr.SelectedGroup, selectedKey);
			using (f)
			{
				if (f.ShowDialog(this) != DialogResult.OK)
					return;

				if (!KeyChainMgr.ModifyKey(f.Group, f.Key))
				{
					MessageBoxHelper.Error(this, @"Failed to modify key {0}", f.Key);
					return;
				}

				// If the user modified the key the group belongs to, then remove the key from the current view.
				if (f.Group == ContextMgr.SelectedGroup)
					ModifyListItem(f.Key);
				else
					DeleteListItem(f.Key);

				AutoSizeColumns();
			}
		}
Example #4
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		public void OnKeyAdd(object sender, EventArgs e)
		{
			if (ContextMgr.SelectedGroup == null)
			{
				MessageBoxHelper.Info(this, "Please select a agroup.");
				return;
			}

			KeyPropertiesForm f = new KeyPropertiesForm(ContextMgr.SelectedGroup);
			using (f)
			{
				if (f.ShowDialog(this) != DialogResult.OK)
					return;

				if (!KeyChainMgr.AddKeyToGroup(f.Group, f.Key))
				{
					MessageBoxHelper.Error(this, @"Failed to add key {0}", f.Key);
					return;
				}

				// If the user modified the key the group belongs to, then tickle the group selected event through the ContextMgr
				if (f.Group.ToString() == ContextMgr.SelectedGroup.ToString())
				{
					AddListItem(f.Key);
				}
			}


		}