コード例 #1
0
        public void WriteDataTotable(string str)
        {
            LWData.Items.Clear();
            if (FootData.Count < 1 || ComboBoxBookies.SelectedIndex < 0)
            {
                return;
            }

            int i = Bookmakers.FindIndex(item => ComboBoxBookies.Items[ComboBoxBookies.SelectedIndex].ToString().ToUpper().Contains(item.Name.ToUpper()));

            string[]      d;
            StringBuilder bufstr = new StringBuilder();

            for (int id = FootData.Count - 1; id >= 0; id--)
            {
                bufstr.Clear();
                FData item = FootData[id];
                if (str != "All" && item.League != str)
                {
                    continue;
                }
                bool         active = FootData[id].XKoef.ContainsKey(i);
                ListViewData lw     = new ListViewData();
                lw.Team1 = item.Team1;
                lw.Team2 = item.Team2;

                if (active)
                {
                    lw.X1         = String.Format("{0} / {1}", item.XKoef[i].Koef[1], item.Lay[1]);
                    lw.X0         = String.Format("{0} / {1}", item.XKoef[i].Koef[0], item.Lay[0]);
                    lw.X2         = String.Format("{0} / {1}", item.XKoef[i].Koef[2], item.Lay[2]);
                    lw.LastUpdate = item.XKoef[i].LastUpdate;
                }
                else
                {
                    lw.X1 = String.Format("{0}", item.Lay[1]);
                    lw.X0 = String.Format("{0}", item.Lay[0]);
                    lw.X2 = String.Format("{0}", item.Lay[2]);
                }
                lw.FullLeague = item.League;
                d             = item.League.Split(' ');
                foreach (string st in d)
                {
                    bufstr.Append(st.Substring(0, 1));
                }
                lw.League = bufstr.ToString();


                lw.Time = ChangeTimeToString(item.time);
                // lw.LastUpdate = item.LastUpdate[i];

                lw.Match = item.Match;

                LWData.Items.Add(lw);
            }
        }
コード例 #2
0
        public void Update()
        {
            IEnumerable <BookmakerDisplayModel> bookmakers = facade.GetAll();

            Bookmakers.Clear();
            foreach (BookmakerDisplayModel bookmaker in bookmakers)
            {
                Bookmakers.Add(bookmaker);
            }

            RaisePropertyChangedEvent("SelectedBookmaker");
        }