Ejemplo n.º 1
0
        private void AddAccountButton_Click(object sender, EventArgs e)
        {
            AccountViewForm acfr = new AccountViewForm(null);

            ////TODO: Weak References?
            acfr.AccountEditComplited += new EventHandler <EventArgs>((account, _e) =>
            {
                WebPanelAccount.AccountManager.ManagerInstance.Add((WebPanelAccount.Account)account);
                AccountManager.SaveAccounts(Setting.AccountFileName);
            });
            acfr.ShowDialog();
        }
Ejemplo n.º 2
0
 private void EditAccountButton_Click(object sender, EventArgs e)
 {
     if (this.AccountListView.SelectedIndices.Count > 0)
     {
         int             index = this.AccountListView.SelectedIndices[0];
         AccountViewForm acfr  = new AccountViewForm(AccountManager.ManagerInstance[index]);
         acfr.AccountEditComplited += new EventHandler <EventArgs>((account, _e) =>
         {
             WebPanelAccount.AccountManager.ManagerInstance[index] = (Account)account;
             AccountManager.SaveAccounts(Setting.AccountFileName);
         });
         acfr.ShowDialog();
     }
 }