Ejemplo n.º 1
0
        private void Load()
        {
            string filePath = PeristFilePath;

            if (File.Exists(filePath))
            {
                XElement acctsElem      = XElement.Load(filePath);
                var      attr           = acctsElem.Attribute("marketData");
                string   marketDataName = attr != null ? attr.Value : "";
                ServerAddrRepoVM.SelectMarket(marketDataName);
                attr = acctsElem.Attribute("trading");
                string tradingName = attr != null ? attr.Value : "";
                ServerAddrRepoVM.SelectTrading(tradingName);
                attr = acctsElem.Attribute("tradeStation");
                string tradeStationName = attr != null ? attr.Value : "";
                ServerAddrRepoVM.SelectTradeStation(tradeStationName);

                foreach (var acctElem in acctsElem.Elements("account"))
                {
                    AccountVM acctVm = AccountVM.Load(acctElem);
                    _accounts.Add(acctVm);
                }
            }
        }