public void AddResults(List <BaseScore> scores, int round, string icon, string fullname, int index) { // Round Results GenericScore sc = CreateNewScore(m_score.Id, "round", "Results", icon, "0", index); sc.Url = String.Format("{0}spielplan/{1}-spieltag/{2}/ergebnisse/", WF_URL, fullname, VariableUrl.PARAM); sc.Range = new VariableUrl(round, 1, m_score.Rounds, LocalizationManager.GetString(Labels.RoundLabel)); sc.SetCanLive(true); sc.SetLive(m_score.IsLive()); sc.Sizes = ScoreCenter.GetParameter(m_parameters, "WF.LeagueRoundResults", SIZES_LEAGUE_ROUND_RESULTS); sc.Dictionary = "WF.last"; sc.AddRule(1, Operation.IsNotNull, "", RuleAction.FormatCell, "Header"); sc.AddHighlightRule(m_score.Highlights, 0, RuleAction.FormatCell); scores.Add(sc); }
/// <summary> /// Defines a Qualification Tournament. /// </summary> /// <param name="wfscore">The Worldfootball definition.</param> /// <param name="parameters"></param> /// <returns></returns> private static List <BaseScore> DefineQualification(WorldFootballScore wfscore, ScoreParameter[] parameters) { int index = 0; List <BaseScore> scores = new List <BaseScore>(); GenericScore sc = null; string fullname = wfscore.FullLeagueName; if (String.IsNullOrEmpty(wfscore.Season) == false) { fullname += "-" + wfscore.Season; } // add results scores sc = CreateNewScore(wfscore.Id, "results", "Results", IMG_RESULTS, "2", index++); string competition = ScoreCenter.GetParameter(parameters, "WF.Competition", KEY_COMPETITION); sc.Url = String.Format("{0}{2}/{1}/", WF_URL, wfscore.FullLeagueName, competition); sc.Sizes = ScoreCenter.GetParameter(parameters, "WF.Results", SIZES_RESULTS); sc.AddRule(3, Operation.IsNull, "", RuleAction.MergeCells, "Header"); sc.LiveConfig = LiveConfig.Copy(wfscore.LiveConfig, ScoreCenter.GetParameter(parameters, "WF.LiveFormat", "{2} {5} {4}")); sc.SetCanLive(true); sc.Element = "0"; scores.Add(sc); // retrieve details: first element is the list of groups List <string> items = wfscore.Details.Split(',').ToList(); char[] groups = items[0].ToCharArray(); foreach (char g in groups) { // add group results sc = CreateNewScore(wfscore.Id, "gr" + g, String.Format("Group {0}", Char.ToUpper(g)), "", "0", index++); sc.Url = String.Format("{0}spielplan/{1}-gruppe-{2}/0/", WF_URL, fullname, g); sc.Sizes = ScoreCenter.GetParameter(parameters, "WF.GroupResults", SIZES_GROUP_RESULTS); sc.Image = String.Format(@"Groups\Group{0}", Char.ToUpper(g)); sc.AddRule(3, Operation.IsNull, "", RuleAction.MergeCells, "Header"); sc.AddHighlightRule(wfscore.Highlights, 0, RuleAction.FormatCell); scores.Add(sc); // add group standings sc = CreateNewScore(wfscore.Id, "resgr" + g, "Standings", "", "1", index++); sc.Url = String.Format("{0}spielplan/{1}-gruppe-{2}/0/", WF_URL, fullname, g); sc.Skip = 1; sc.Headers = ScoreCenter.GetParameter(parameters, "WF.HeaderStandings", HEADERS_STANDINGS); sc.Sizes = ScoreCenter.GetParameter(parameters, "WF.GroupStandings", SIZES_GROUP_STANDINGS); sc.Image = String.Format(@"Groups\Table{0}", Char.ToUpper(g)); sc.AddHighlightRule(wfscore.Highlights, 3, RuleAction.FormatLine); scores.Add(sc); } // add rounds foreach (string round in items) { if (round == items[0]) { continue; } if (round == "stadium" || round == "referee") { continue; } sc = CreateNewScore(wfscore.Id, round, round, IMG_RESULTS, "0", index++); sc.Url = String.Format("{0}spielplan/{1}-{2}/0/", WF_URL, fullname, round); sc.Sizes = wfscore.TwoLegs && round != "finale" ? ScoreCenter.GetParameter(parameters, "WF.QualificationLevel2", SIZES_QUALIFICATION_LEVEL2) : ScoreCenter.GetParameter(parameters, "WF.QualificationLevel1", SIZES_QUALIFICATION_LEVEL1); sc.AddRule(3, Operation.IsNull, "", RuleAction.MergeCells, "Header"); sc.AddRule(0, Operation.Contains, "{Rückspiel},", RuleAction.ReplaceText, ""); scores.Add(sc); } // add details ScoreDetails details = GetScoreDetails(wfscore, parameters); details.AddTopScorerScore(scores, fullname, index++); details.AddAssistsScore(scores, fullname, index++); details.AddStadiumScore(scores, fullname, index++); details.AddRefereeScore(scores, fullname, index++); details.AddHistoryScore(scores, index++); details.AddTopScorerHistScore(scores, index++); return(scores); }