Пример #1
0
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            double dPrice = 0;

            if (values[0] != null &&
                values[1] != null)
            {
                ObservableCollection <ItemsToOrder> items =
                    (ObservableCollection <ItemsToOrder>)values[0];

                foreach (ItemsToOrder item in items)
                {
                    dPrice += (double)(item.Item.Price * item.Amount);
                }

                Dictionary <int, double> pricePerMin = SettingsXmlProvider.ReadPriceGame();

                pricePerMin.OrderBy(t => t.Key);
            }

            return(dPrice);
        }
Пример #2
0
        public MainWindow()
        {
            try
            {
                InitializeComponent();

                m_bMouseClickOnObject = false;

                InitializeLogo();

                // Load all items from the db
                ItemsCollectionProvider.GetInstance().LoadItemsFromDB();

                // Read and save the prices for the game time
                CommonConfig.GetInstance().SetPricePerMin(
                    SettingsXmlProvider.ReadPriceGame());
            }
            catch (Exception)
            {

            }
        }