private void button7_Click(object sender, EventArgs e) // Edit an account
        {
            var acc = GetSelectedAcc();

            if (acc != null)
            {
                using (var form = new AddAccount(acc))
                {
                    form.UpdateWindow();
                    var result = form.ShowDialog();
                    if (result != DialogResult.OK)
                    {
                        // TODO: log
                    }
                }
            }
        }
 private void button1_Click(object sender, EventArgs e) // Add account
 {
     using (var form = new AddAccount())
     {
         form.UpdateWindow();
         var result = form.ShowDialog();
         if (result == DialogResult.OK)
         {
             var acc = form.Acc;
             accounts.Add(acc);
             var access = acc.Access.GetCurrentAccess();
             InsertAccIntoListView(acc.AccInfo.Nickname,
                                   acc.AccInfo.ServerUrl,
                                   access.Proxy,
                                   access.ProxyPort);
         }
     }
 }
Example #3
0
        private void button1_Click(object sender, EventArgs e) // Add account
        {
            using (var form = new AddAccount())
            {
                form.UpdateWindow();
                var result = form.ShowDialog();
                if (result == DialogResult.OK)
                {
                    var acc = form.Acc;
                    DbRepository.SaveAccount(acc);
                    if (string.IsNullOrEmpty(acc.AccInfo.Nickname) ||
                        string.IsNullOrEmpty(acc.AccInfo.ServerUrl))
                    {
                        return;
                    }

                    accounts.Add(acc);
                    RefreshAccView();
                }
            }
        }