private void buttonEdit_Click(object sender, EventArgs e)
        {
            if (dataGridViewValues.SelectedRows.Count <= 0)
            {
                return;
            }
            int currentProfile = dataGridViewValues.SelectedRows[0].Index;
            var editor         = new ProfileEditor {
                Profile = Profiles.List[currentProfile]
            };

            if (editor.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            Profile profile = editor.Profile;

            if (profile == null)
            {
                return;
            }

            Profiles.List[currentProfile]    = profile;
            profilesBindingSource.DataSource = Profiles.List;
            profilesBindingSource.ResetBindings(false);
        }
        // todo: clean this up, change how it's done
        public void AddProfile(Profile profile)
        {
            var editor = new ProfileEditor {Profile = profile};
            if (editor.ShowDialog() != DialogResult.OK) return;
            Profile editorProfile = editor.Profile;
            if (editorProfile == null) return;

            Profiles.List.Add(editorProfile);
            profilesBindingSource.DataSource = Profiles.List;
            profilesBindingSource.ResetBindings(false);
        }
Example #3
0
        private void buttonEditProfile_Click(object sender, EventArgs e)
        {
            var editor = new ProfileEditor {
                Profile = (Profile)comboBoxProfiles.SelectedItem
            };

            if (editor.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            Profiles.List[comboBoxProfiles.SelectedIndex] = editor.Profile;

            profilesSource.DataSource = Profiles.List;
            profilesSource.ResetBindings(false);
            labelProfileInformation.Text = ((Profile)comboBoxProfiles.SelectedItem).ProfileInformation();
        }
        private void buttonNew_Click(object sender, EventArgs e)
        {
            var editor = new ProfileEditor();

            if (editor.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            Profile profile = editor.Profile;

            if (profile == null)
            {
                return;
            }
            Profiles.List.Add(profile);
            profilesBindingSource.DataSource = Profiles.List;
            profilesBindingSource.ResetBindings(false);
        }
        // todo: clean this up, change how it's done
        public void AddProfile(Profile profile)
        {
            var editor = new ProfileEditor {
                Profile = profile
            };

            if (editor.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            Profile editorProfile = editor.Profile;

            if (editorProfile == null)
            {
                return;
            }

            Profiles.List.Add(editorProfile);
            profilesBindingSource.DataSource = Profiles.List;
            profilesBindingSource.ResetBindings(false);
        }
Example #6
0
        private void buttonEditProfile_Click(object sender, EventArgs e)
        {
            var editor = new ProfileEditor {Profile = (Profile) comboBoxProfiles.SelectedItem};
            if (editor.ShowDialog() != DialogResult.OK) return;
            Profiles.List[comboBoxProfiles.SelectedIndex] = editor.Profile;

            profilesSource.DataSource = Profiles.List;
            profilesSource.ResetBindings(false);
            labelProfileInformation.Text = ((Profile) comboBoxProfiles.SelectedItem).ProfileInformation();
        }
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            if (dataGridViewValues.SelectedRows.Count <= 0) return;
            int currentProfile = dataGridViewValues.SelectedRows[0].Index;
            var editor = new ProfileEditor {Profile = Profiles.List[currentProfile]};
            if (editor.ShowDialog() != DialogResult.OK) return;

            Profile profile = editor.Profile;
            if (profile == null) return;

            Profiles.List[currentProfile] = profile;
            profilesBindingSource.DataSource = Profiles.List;
            profilesBindingSource.ResetBindings(false);
        }
 private void buttonNew_Click(object sender, EventArgs e)
 {
     var editor = new ProfileEditor();
     if (editor.ShowDialog() != DialogResult.OK) return;
     Profile profile = editor.Profile;
     if (profile == null) return;
     Profiles.List.Add(profile);
     profilesBindingSource.DataSource = Profiles.List;
     profilesBindingSource.ResetBindings(false);
 }