Пример #1
0
        private void profileGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 0 || e.ColumnIndex == 1)
            {
                var currentProfiles = _profileManager.Fetch();

                var scProfile = currentProfiles.SitecoreProfiles[e.RowIndex];

                //Edit
                if (e.ColumnIndex == 0)
                {
                    var profileWindow = new SitecoreCreateProfile(_profileManager);

                    profileWindow.SetProfile(scProfile);

                    profileWindow.ShowDialog();

                    RefreshList();
                }

                //Delete
                if (e.ColumnIndex == 1)
                {
                    if (MessageBox.Show($"Are you sure you wish to remove the profile '{scProfile.Name}'?", "Confirm",
                                        MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                    {
                        currentProfiles.SitecoreProfiles.Remove(scProfile);

                        _profileManager.Update(currentProfiles);

                        RefreshList();
                    }
                }
            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            SitecoreCreateProfile profile = new SitecoreCreateProfile(_profileManager);

            profile.ShowDialog();

            RefreshList();
        }