Exemplo n.º 1
0
        private void parseOneDays(XDocument xdoc)
        {
            IEnumerator<XElement> iEnum = xdoc.Descendants("item").GetEnumerator();
            int numofTiles = 0,i=0;
            urls.Clear();
            dict.Clear();
            while (iEnum.MoveNext())
            {
                XElement elem = iEnum.Current;
                string url = elem.Descendants("url").First().Value;
                string priority = elem.Descendants("priority").First().Value;
                urls.Add(url);
            }

            dict.Add(0, urls);
            DispatchInvoke(() =>
            {
                ReplayTile playAllReplayTile = new ReplayTile("", "Play All");
                playAllReplayTile.SetValue(Canvas.NameProperty, "playAllReplayTile0");
                Brush brush = new SolidColorBrush(Colors.Red);
                brush.Opacity = (double)0.6;
                playAllReplayTile.LayoutRoot.Background = brush;
                playAllReplayTile.MatchId = matchId;
                replayList.Children.Add(playAllReplayTile);

                for (i = 0; i < urls.Count; i++)
                {
                    ReplayTile replayTile = new ReplayTile(urls[i], "Replay " + (i + 1) + " of " + urls.Count);
                    replayTile.SetValue(Canvas.NameProperty, "replayTile" + numofTiles++);
                    replayTile.MatchId = matchId;
                    replayList.Children.Add(replayTile);
                }
                ReplayList.progressIndicator.Visibility = System.Windows.Visibility.Collapsed;
            }
            );
        }
Exemplo n.º 2
0
        private void parseTestMatch(XDocument xdoc)
        {
            IEnumerator<XElement> iEnum = xdoc.Descendants("videoGroup").GetEnumerator();
            int numofTiles=0;
            dict.Clear();
            while (iEnum.MoveNext())
            {
                XElement elem = iEnum.Current;
                string day = getDayofTestMatch(elem.FirstAttribute.ToString());
                IEnumerator<XElement> iEnumGroup = elem.Descendants("item").GetEnumerator();

                //replays for a particular day
                int i = 0;
                urls.Clear();
                while (iEnumGroup.MoveNext())
                {
                    string url = iEnumGroup.Current.Descendants("url").First().Value;
                    string priority = iEnumGroup.Current.Descendants("priority").First().Value;
                    urls.Add(url);
                }
                dict.Add(Convert.ToInt32(day), urls);

                DispatchInvoke(() =>
                {
                    ReplayTile dayNumberReplayTile = new ReplayTile("", "Day " + day);
                    dayNumberReplayTile.SetValue(Canvas.NameProperty, "dayNumberReplayTile" + numofTiles++);
                    dayNumberReplayTile.replayTitle.FontSize = (double)50.0;
                    Brush brush = new SolidColorBrush(Colors.Red);
                    brush.Opacity = (double)0.6;
                    dayNumberReplayTile.LayoutRoot.Background = brush;
                    if (dayNumberReplayTile.replayTilePanel.Children.Count >= 2)
                    {
                        dayNumberReplayTile.replayTilePanel.Children[1].Visibility = System.Windows.Visibility.Collapsed;
                        (dayNumberReplayTile.replayTilePanel.Children[0] as TextBlock).TextAlignment = TextAlignment.Center;
                    }
                    replayList.Children.Add(dayNumberReplayTile);

                    ReplayTile playAllReplayTile = new ReplayTile("","Play All");
                    playAllReplayTile.SetValue(Canvas.NameProperty, "playAllReplayTile" + day);
                    brush = new SolidColorBrush(Colors.Green); brush.Opacity = (double)0.6;
                    playAllReplayTile.LayoutRoot.Background = brush;
                    playAllReplayTile.MatchId = matchId;
                    replayList.Children.Add(playAllReplayTile);

                    for(i=0;i<urls.Count;i++)
                    {
                        ReplayTile replayTile = new ReplayTile(urls[i], "Replay " + (i+1) + " of " + urls.Count);
                        replayTile.SetValue(Canvas.NameProperty, "replayTile" + numofTiles++);
                        replayTile.MatchId = matchId;
                        replayList.Children.Add(replayTile);
                    }
                    ReplayList.progressIndicator.Visibility = System.Windows.Visibility.Collapsed;

                    //Add a dummy Tile
                    /*
                    ReplayTile dummyTile = new ReplayTile("", "");
                    dummyTile.SetValue(Canvas.NameProperty, "dummyTile" + numofTiles++);
                    dummyTile.LayoutRoot.Height = (double)50.0;
                    dummyTile.LayoutRoot.Background = new SolidColorBrush(Colors.White);
                    replayList.Children.Add(dummyTile);
                     */
                }
                );
            }
        }