Exemplo n.º 1
0
        private static void SaveFile()
        {
            var rootA = new XElement("ActionsCaisse");
            var root  = new XElement("ActionHashBoxes");

            foreach (var actionCash in ActionCashBoxes)
            {
                rootA.Add(new XElement("item", XElement.Parse(actionCash.Xml)));
                root.Add(ActionCashBox.ToXElement(actionCash));
            }

            File.WriteAllText(PathA, new XDocument(rootA).ToString());
            File.WriteAllText(Path, new XDocument(root).ToString());
        }
Exemplo n.º 2
0
        private static void LoadFile()
        {
            if (File.Exists(PathA))
            {
                _documentA = XDocument.Load(PathA);
            }

            if (File.Exists(Path))
            {
                var document = XDocument.Load(Path);

                ActionCashBoxes.Clear();
                foreach (var element in document.GetXElementsIfExistElement("ActionHashBoxes", "rec"))
                {
                    ActionCashBoxes.Add(ActionCashBox.FromXElement(element));
                }
            }
        }