public double GetPositionPrice(string positionName) { if (!PositionPriceList.ContainsKey(positionName)) { return(100); } return(PositionPriceList[positionName]); }
private void ReadAllPositionPrices(XmlDocument xDoc, XmlNode xAppSettings, StorageFile file) { XmlNode xPriceList = GetPriceListNode(xDoc, xAppSettings, file); if (xPriceList.ChildNodes == null) { return; } foreach (XmlNode pos_i in xPriceList.ChildNodes) { string positionName = pos_i.Attributes["PositionName"].Value; double price = Convert.ToDouble(pos_i.InnerText); PositionPriceList.Add(positionName, price); } }