Ejemplo n.º 1
0
        public static ObservableCollection <SessionTariff> LoadPriceFromXML(String fileName)
        {
            var collection = new ObservableCollection <SessionTariff>();

            if (File.Exists(fileName))
            {
                var pricesList = from price in XElement.Load(@fileName).Elements("price") select price;
                foreach (var pl in pricesList)
                {
                    SessionTariff price = new SessionTariff
                    {
                        Name                = pl.Attribute("name").Value,
                        LimitedTimeMode     = Boolean.Parse(pl.Attribute("mode").Value),
                        CostPerHourGame     = uint.Parse(pl.Attribute("costPerHourGame").Value),
                        CostPerHourInternet = uint.Parse(pl.Attribute("costPerHourInternet").Value)
                    };
                    collection.Add(price);
                }
            }
            return(collection);
        }
Ejemplo n.º 2
0
 public SessionMessage(Nullable <DateTime> sessionStart, Nullable <DateTime> sessionExpire, SessionTariff tariff, Boolean isInternetSession, Boolean isPaused, Double totalPayment)
 {
     this.SessionStart      = sessionStart;
     this.SessionExpire     = sessionExpire;
     this.Tariff            = tariff;
     this.IsInternetSession = isInternetSession;
     this.IsPaused          = isPaused;
     this.TotalPayment      = totalPayment;
 }