public static void SerializeTransaction(StockPlayer player, Offer offer) { XDocument document; try { document = XDocument.Load("transactions.txt"); } catch { document = new XDocument(new XElement("Transactions")); } document.Root.Add(new XElement("Transaction", new XElement("Player", player.Name), new XElement("DateOfTransaction", DateTime.UtcNow), new XElement("Date", offer.Date.ToString()), new XElement("Instrument", offer.Instrument), new XElement("Value", offer.Value.ToString()) )); document.Save("transactions.txt"); }
public void Subscribe(StockPlayer stockPlayer) { subscribers.Add(stockPlayer); }