Пример #1
0
        private void removeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (WebTabTabsListView.SelectedItems != null)
            {
                MOG_PropertiesIni project = MOG_ControllerProject.GetProject().GetConfigFile();
                if (project != null)
                {
                    foreach (ListViewItem item in WebTabTabsListView.SelectedItems)
                    {
                        project.RemoveString("WebTabs", item.Text);
                        project.RemoveString("WebTab_" + item.Text, "Title");
                        project.RemoveString("WebTab_" + item.Text, "URL");
                        project.RemoveString("WebTab_" + item.Text, "Position");

                        // Only remove the section if it is now empty
                        if (project.CountKeys("WebTab_" + item.Text) == 0)
                        {
                            project.RemoveSection("WebTab_" + item.Text);
                        }

                        item.Remove();
                    }

                    SavePositionSettings(project);
                }
            }
        }