public void remove(string flower) { XElement flowerElement = (from f in Ds_XML.Flowers.Elements() where f.Element("name").Value == flower select f).FirstOrDefault(); if (flowerElement != null) { flowerElement.Remove(); Ds_XML.SaveFlowers(); } }
public void add(Flower flower) { var temp = (from f in Ds_XML.Flowers.Elements() where f.Element("name").Value == flower.name select f).FirstOrDefault(); if (temp == null) { Ds_XML.Flowers.Add(flower.toXML()); Ds_XML.SaveFlowers(); } }