private void buttonEdit_Click(object sender, EventArgs e)
        {
            HMEntities.UserProfiles.User selectedUser = new HM.Entities.HattrickManager.UserProfiles.User();
            int selectedIndex = listBoxUserProfiles.SelectedIndex;

            foreach (HMEntities.UserProfiles.User currentUser in userProfiles.userListField)
            {
                if (listBoxUserProfiles.SelectedItem.ToString() == currentUser.accessToken)
                {
                    selectedUser = currentUser;
                    break;
                }
            }

            using (FormAddEditUser formAddEditUser = new FormAddEditUser(selectedUser)) {
                formAddEditUser.ShowDialog(this);

                if (formAddEditUser.DialogResult == DialogResult.OK)
                {
                    ReloadUsers();
                    // restore selection
                    listBoxUserProfiles.SelectedIndex = selectedIndex;
                }
            }
        }
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            using (FormAddEditUser formAddEditUser = new FormAddEditUser()) {
                formAddEditUser.ShowDialog(this);

                if (formAddEditUser.DialogResult == DialogResult.OK) {
                    ReloadUsers();
                }
            }
        }
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            using (FormAddEditUser formAddEditUser = new FormAddEditUser()) {
                formAddEditUser.ShowDialog(this);

                if (formAddEditUser.DialogResult == DialogResult.OK)
                {
                    ReloadUsers();
                }
            }
        }
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            HMEntities.UserProfiles.User selectedUser = new HM.Entities.HattrickManager.UserProfiles.User();
            int selectedIndex = listBoxUserProfiles.SelectedIndex;

            foreach (HMEntities.UserProfiles.User currentUser in userProfiles.userListField) {
                if (listBoxUserProfiles.SelectedItem.ToString() == currentUser.accessToken) {
                    selectedUser = currentUser;
                    break;
                }
            }

            using (FormAddEditUser formAddEditUser = new FormAddEditUser(selectedUser)) {
                formAddEditUser.ShowDialog(this);

                if (formAddEditUser.DialogResult == DialogResult.OK) {
                    ReloadUsers();
                    // restore selection
                    listBoxUserProfiles.SelectedIndex = selectedIndex;
                }
            }
        }