Esempio n. 1
0
        private void btnRemoveProfile_Click(object sender, EventArgs e)
        {
            if (lvUserProfiles.SelectedItems.Count > 0)
            {
                UserProfileListViewItem itemBeingEdited = (UserProfileListViewItem)lvUserProfiles.SelectedItems[0];
                UserProfile             userBeingEdited = itemBeingEdited.UserProfile;

                if (MessageBox.Show(this, $"Delete user ({userBeingEdited.Name}), are you sure?", "Deletion Confirmation", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    try
                    {
                        ZAMsettings.BeginCachedConfiguration();

                        ZAMsettings.Settings.DeleteUserProfile(userBeingEdited);

                        ZAMsettings.CommitCachedConfiguration();

                        lvUserProfiles.BeginUpdate();
                        lvUserProfiles.Items.Remove(itemBeingEdited);

                        if (lvUserProfiles.Items.Count > 0)
                        {
                            lvUserProfiles.Items[0].Focused  = true;
                            lvUserProfiles.Items[0].Selected = true;
                        }
                        lvUserProfiles.EndUpdate();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("Exception occurred: " + ex.ToString(), "Error deleting User Profile", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
        }
Esempio n. 2
0
        private void btnAddProfile_Click(object sender, EventArgs e)
        {
            UserProfileListViewItem item = new UserProfileListViewItem();

            lvUserProfiles.Items.Add(item);
            item.Selected = true;
            item.Focused  = true;

            ZAMsettings.BeginCachedConfiguration();
            EditingUserProfiles = true;
        }
Esempio n. 3
0
        private void btnEditSettings_Click(object sender, EventArgs e)
        {
            if (ckbCustomized.Checked)
            {
                DialogResult result = MessageBox.Show(this.ParentForm, "Editing settings will overwrite all custom split goals when saved.  Continue?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                if (result == DialogResult.No)
                {
                    return;
                }
            }

            ZAMsettings.BeginCachedConfiguration();
            EditingSystemSettings = true;
        }
 private void btnEditSettings_Click(object sender, EventArgs e)
 {
     ZAMsettings.BeginCachedConfiguration();
     EditingSystemSettings = true;
 }
 private void btnStatsEdit_Click(object sender, EventArgs e)
 {
     ZAMsettings.BeginCachedConfiguration();
     EditingCollectors = true;
 }
Esempio n. 6
0
 private void btnEditProfile_Click(object sender, EventArgs e)
 {
     ZAMsettings.BeginCachedConfiguration();
     EditingUserProfiles = true;
 }