Exemple #1
0
        public XmlDocument SaveInXml()
        {
            var doc  = new XmlDocument();
            var root = doc.AppendChild(doc.CreateElement("account"));

            DealInfo.AddAttribute(root, "Id", Id);
            DealInfo.AddAttribute(root, "Broker", Broker);
            DealInfo.AddAttribute(root, "Account", Account);
            DealInfo.AddAttribute(root, "Trader", Trader);
            DealInfo.AddAttribute(root, "Login", Login);
            DealInfo.AddAttribute(root, "InitBalance", InitBalance);

            var rootDeal = root.AppendChild(doc.CreateElement("deals"));

            foreach (var deal in deals)
            {
                deal.SaveInXml(rootDeal);
            }

            var rootBalance = root.AppendChild(doc.CreateElement("balances"));

            foreach (var balance in balances)
            {
                balance.SaveInXml(rootBalance);
            }

            return(doc);
        }
Exemple #2
0
        public void SaveInXml(XmlNode parent)
        {
            var nod = parent.AppendChild(parent.OwnerDocument.CreateElement("balance"));

            DealInfo.AddAttribute(nod, "Ticket", Ticket);
            DealInfo.AddAttribute(nod, "Amount", Amount);
            DealInfo.AddAttribute(nod, "Date", Date);
        }