Exemplo n.º 1
0
        private void Update()
        {
            if (LiveMonitorsCollectionList.Count == 0 || !StationRepository.IsLiveMatchEnabled)
            {
                return;
            }
            Repository.FindMatches(Matches, "", SelectedLanguage, MatchFilter, Comparison);

            SplitCollection();


            foreach (var match in Matches.OfType <MatchVw>())
            {
                switch (match.SportDescriptor)
                {
                case SportSr.SPORT_DESCRIPTOR_SOCCER:
                    match.SportIcon       = ResolveImagePath.ResolvePath("LiveView/socker-ball.png").ToString();
                    match.BackgroundImage = ResolveImagePath.ResolvePath("LiveView/socker-fon.png").ToString();
                    break;

                case SportSr.SPORT_DESCRIPTOR_TENNIS:
                    match.SportIcon       = ResolveImagePath.ResolvePath("LiveView/tennis-ball.png").ToString();
                    match.BackgroundImage = ResolveImagePath.ResolvePath("LiveView/tennis-fon.png").ToString();
                    break;

                case SportSr.SPORT_DESCRIPTOR_BASKETBALL:
                    match.SportIcon       = ResolveImagePath.ResolvePath("LiveView/Basket-ball.png").ToString();
                    match.BackgroundImage = ResolveImagePath.ResolvePath("LiveView/Basketball-fon.png").ToString();
                    break;

                case SportSr.SPORT_DESCRIPTOR_ICE_HOCKEY:
                    match.SportIcon       = ResolveImagePath.ResolvePath("LiveView/hockey-ball.png").ToString();
                    match.BackgroundImage = ResolveImagePath.ResolvePath("LiveView/Hokkey-fon.png").ToString();
                    break;

                case SportSr.SPORT_DESCRIPTOR_RUGBY:
                    match.SportIcon       = ResolveImagePath.ResolvePath("LiveView/rugby-ball.png").ToString();
                    match.BackgroundImage = ResolveImagePath.ResolvePath("LiveView/rugby-fon.png").ToString();
                    break;

                case SportSr.SPORT_DESCRIPTOR_HANDBALL:
                    match.SportIcon       = ResolveImagePath.ResolvePath("LiveView/hand-ball.png").ToString();
                    match.BackgroundImage = ResolveImagePath.ResolvePath("LiveView/handball-fon.png").ToString();
                    break;

                case SportSr.SPORT_DESCRIPTOR_VOLLEYBALL:
                    match.SportIcon       = ResolveImagePath.ResolvePath("LiveView/volley-ball.png").ToString();
                    match.BackgroundImage = ResolveImagePath.ResolvePath("LiveView/volleyball-fon.png").ToString();
                    break;
                }
            }
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            object image = null;

            if (parameter != null)
            {
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_ICE_HOCKEY)
                {
                    image = ResolveImagePath.ResolvePath("IceHockey2.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_SOCCER)
                {
                    image = ResolveImagePath.ResolvePath("Soccer.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_BASKETBALL)
                {
                    image = ResolveImagePath.ResolvePath("Basketball.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_BASEBALL)
                {
                    image = ResolveImagePath.ResolvePath("Baseball.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_MIXED)
                {
                    image = ResolveImagePath.ResolvePath("MixedSports.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_TENNIS)
                {
                    image = ResolveImagePath.ResolvePath("Tennis.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_RUGBY)
                {
                    image = ResolveImagePath.ResolvePath("Rugby_new.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_HANDBALL)
                {
                    image = ResolveImagePath.ResolvePath("Handball.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_VOLLEYBALL)
                {
                    image = ResolveImagePath.ResolvePath("Volleyball.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_FOOTBALL)
                {
                    image = ResolveImagePath.ResolvePath("AmericanFootball.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_MOTOSPORT)
                {
                    image = ResolveImagePath.ResolvePath("MotoSport.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_WINTERSPORTS)
                {
                    image = ResolveImagePath.ResolvePath("winter_sports_icon.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_DARTS)
                {
                    image = ResolveImagePath.ResolvePath("Darts.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_OLYMPICS)
                {
                    image = ResolveImagePath.ResolvePath("olympics-icon.png");
                }
                if (parameter.ToString() == SportSr.SPORT_DESCRIPTOR_SNOOKER)
                {
                    image = ResolveImagePath.ResolvePath("Snooker.png");
                }
            }
            else
            {
                if (value != null)
                {
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_ICE_HOCKEY)
                    {
                        image = ResolveImagePath.ResolvePath("IceHockey2.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_SOCCER)
                    {
                        image = ResolveImagePath.ResolvePath("Soccer.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_BASKETBALL)
                    {
                        image = ResolveImagePath.ResolvePath("Basketball.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_BASEBALL)
                    {
                        image = ResolveImagePath.ResolvePath("Baseball.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_MIXED)
                    {
                        image = ResolveImagePath.ResolvePath("MixedSports.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_TENNIS)
                    {
                        image = ResolveImagePath.ResolvePath("Tennis.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_RUGBY)
                    {
                        image = ResolveImagePath.ResolvePath("Rugby_new.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_HANDBALL)
                    {
                        image = ResolveImagePath.ResolvePath("Handball.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_VOLLEYBALL)
                    {
                        image = ResolveImagePath.ResolvePath("Volleyball.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_FOOTBALL)
                    {
                        image = ResolveImagePath.ResolvePath("AmericanFootball.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_MOTOSPORT)
                    {
                        image = ResolveImagePath.ResolvePath("MotoSport.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_WINTERSPORTS)
                    {
                        image = ResolveImagePath.ResolvePath("winter_sports_icon.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_DARTS)
                    {
                        image = ResolveImagePath.ResolvePath("Darts.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_OLYMPICS)
                    {
                        image = ResolveImagePath.ResolvePath("olympics-icon.png");
                    }
                    if (value.ToString() == SportSr.SPORT_DESCRIPTOR_SNOOKER)
                    {
                        image = ResolveImagePath.ResolvePath("Snooker.png");
                    }
                }
            }
            return(image);
        }