Ejemplo n.º 1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (lsvAccountList.SelectedItems.IsEmpty())
            {
                return;
            }

            var item = lsvAccountList.SelectedItems[0];
            var acct = item.Tag as Account;

            using (var form = new FrmDetails())
            {
                form.CategoryList.AddRange(_groupDict.Keys);
                form.Account = acct;
                if (form.ShowDialog() == DialogResult.OK)
                {
                    item.Group = GetOrCreateGroup(acct.CategoryName);
                    item.Text  = acct.Title;
                    item.SubItems["UserName"].Text   = acct.UserName;
                    item.SubItems["Password"].Text   = MaskPassword(acct.Password);
                    item.SubItems["ModifyDate"].Text = acct.ModifyDate.ToString();
                    item.SubItems["Url"].Text        = acct.Link;
                    ActMgr.Instance.Save(Account.ToJArray(_accounts));
                }
            }
        }
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            using (var form = new FrmDetails())
            {
                form.CategoryList.AddRange(_groupDict.Keys);

                if (form.ShowDialog() == DialogResult.OK)
                {
                    _accounts.Add(form.Account);
                    AddAccount(form.Account);
                    ActMgr.Instance.Save(Account.ToJArray(_accounts));
                }
            }
        }