示例#1
0
        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
                    }
                }
            }
        }
示例#2
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;
             accounts.Add(acc);
             var access = acc.Access.GetCurrentAccess();
             InsertAccIntoListView(acc.AccInfo.Nickname,
                                   acc.AccInfo.ServerUrl,
                                   access.Proxy,
                                   access.ProxyPort);
         }
     }
 }
示例#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();
                }
            }
        }