예제 #1
0
        private void ProfileEdit_Click(object sender, EventArgs e)
        {
            var item   = (ToolStripMenuItem)sender;
            var parent = item.OwnerItem as ToolStripMenuItem;

            var profile = _settings.Profiles.Where(p => p.Name == parent.Text).First();

            var profileEditor = new Views.ProfileEditor(profile);
            var result        = profileEditor.ShowDialog();

            if (result == true)
            {
                _settings.Profiles.Remove(profile);
                _settings.Profiles.Add(profileEditor.Profile);
                _settings.Save();

                if (IsEnabled && parent.Checked)
                {
                    _enabledProfiles.RemoveAll(p => p.ProfileId == (Guid)parent.Tag);
                    _enabledProfiles.Add(profileEditor.Profile);

                    LoadProfileItems(profileEditor.Profile.Name);
                }
                else
                {
                    LoadProfileItems();
                }
            }
        }
예제 #2
0
        private void AddNew_Click(object sender, EventArgs e)
        {
            var profileEditor = new Views.ProfileEditor();
            var result        = profileEditor.ShowDialog();

            if (result == true)
            {
                _settings.Profiles.Add(profileEditor.Profile);
                _settings.Save();

                LoadProfileItems();
            }
        }
예제 #3
0
        private void ProfileEdit_Click(object sender, EventArgs e)
        {
            var item = (ToolStripMenuItem)sender;
            var parent = item.OwnerItem as ToolStripMenuItem;

            var profile = _settings.Profiles.Where(p => p.Name == parent.Text).First();

            var profileEditor = new Views.ProfileEditor(profile);
            var result = profileEditor.ShowDialog();

            if (result == true)
            {
                _settings.Profiles.Remove(profile);
                _settings.Profiles.Add(profileEditor.Profile);
                _settings.Save();

                if (IsEnabled && parent.Checked)
                {
                    _enabledProfiles.RemoveAll(p => p.ProfileId == (Guid)parent.Tag);
                    _enabledProfiles.Add(profileEditor.Profile);

                    LoadProfileItems(profileEditor.Profile.Name);
                }
                else
                {
                    LoadProfileItems();
                }
            }
        }
예제 #4
0
        private void AddNew_Click(object sender, EventArgs e)
        {
            var profileEditor = new Views.ProfileEditor();
            var result = profileEditor.ShowDialog();

            if (result == true)
            {
                _settings.Profiles.Add(profileEditor.Profile);
                _settings.Save();

                LoadProfileItems();
            }
        }