Пример #1
0
        private void deleteButton_Click(object sender, EventArgs e, String con, String text)
        {
            XDocument xmlDoc           = XDocument.Load("SavedComputers.xml");
            var       elementsToDelete = from ele in xmlDoc.Elements("Computers").Elements("Name")
                                         where ele != null && ele.Value.Equals(text)
                                         select ele;

            foreach (var ee in elementsToDelete)
            {
                ee.Remove();
            }

            xmlDoc.Save("SavedComputers.xml");

            XDocument xmlDoc2           = XDocument.Load("SavedComputers.xml");
            var       elementsToDeletee = from ele in xmlDoc2.Elements("Computers").Elements("ConnectionString")
                                          where ele != null && ele.Value.Equals(con)
                                          select ele;

            foreach (var ee in elementsToDeletee)
            {
                ee.Remove();
            }
            xmlDoc2.Save("SavedComputers.xml");
            ListForm l = new ListForm(homeForm);

            l.Show();
            this.Close();
        }
Пример #2
0
        private void listButton_Click(object sender, EventArgs e)
        {
            ListForm listForm = new ListForm(this);

            listForm.Show();
            this.Hide();
        }