Beispiel #1
0
        private void _ButtonNewAccount_Click(object sender, EventArgs e)
        {
            // create a new account for the user to edit. this is how it's done on the mac, and requires less clicks.
            String  accountName = "[New Account]";
            Account account     = new Account(accountName, String.Empty);

            if (_ButtonAccounts.ButtonItems.Count == 0)
            {
                account.Default = true;
            }

            PreferencesButtonItem item = new PreferencesButtonItem()
            {
                ButtonText      = accountName,
                AssociatedPanel = new AccountPanel()
                {
                    Account          = account,
                    ControlBackColor = _PanelAccounts.ControlBackColor
                }
            };

            _PanelParent.Controls.Add(item.AssociatedPanel);

            InitPanelShapes(item.AssociatedPanel);

            item.AssociatedPanel.BringToFront();

            _ButtonAccounts.ButtonItems.Add(item);

            item.Activate();

            _PanelNewAccount.Hide();
        }