コード例 #1
0
        public MatchPage(SingleClub club, Match match, allmatches matchFromAll)
        {
            InitializeComponent();

            string umbracoUrl = "http://motmv2.azurewebsites.net/";

            if (club == null)
            {
                SingleClub newClub = new SingleClub();
                newClub.stadiumPic = matchFromAll.stadiumPic;
                newClub.clubPic    = matchFromAll.clublogo;
                newClub.clubName   = matchFromAll.clubname;
                newClub.HomeCity   = matchFromAll.HomeCity;


                theClub           = newClub;
                thisMatchId       = matchFromAll.matchId;
                OpponentName.Text = matchFromAll.opponent;

                foreach (var item in matchFromAll.info)
                {
                    foreach (Player player in item.players)
                    {
                        if (players.All(m => m.playerId != player.playerId))
                        {
                            players.Add(player);
                        }
                    }
                }

                clubLogo.Source    = (theClub.clubPic != "") ?  theClub.clubPic : "blogo.png";
                clubStadium.Source = (theClub.stadiumPic != "") ? theClub.stadiumPic : "stadium.png";
            }
            else
            {
                theClub           = club;
                thisMatchId       = match.matchId;
                OpponentName.Text = match.opponent;
                GetMatchPlayers(match);

                clubLogo.Source    = (theClub.clubPic != "") ? umbracoUrl + theClub.clubPic : "blogo.png";
                clubStadium.Source = (theClub.stadiumPic != "") ? umbracoUrl + theClub.stadiumPic : "stadium.png";
            }



            Club.BindingContext = theClub;



            PlayerList.ItemsSource = players;
        }
コード例 #2
0
ファイル: ClubPage.xaml.cs プロジェクト: doriholm/motmXamarin
        //public ClubPage()
        //{
        //    InitializeComponent();
        //}

        public ClubPage(SingleClub clubObject)
        {
            InitializeComponent();

            newClub           = clubObject as SingleClub;
            Teams.ItemsSource = teams;
            //singleClubId = clubId;
            Club.BindingContext = newClub;

            string umbracoUrl = "http://motmv2.azurewebsites.net/";

            clubLogo.Source    = (clubObject.clubPic != "") ? umbracoUrl + clubObject.clubPic : "blogo.png";
            clubStadium.Source = (clubObject.stadiumPic != "") ? umbracoUrl + clubObject.stadiumPic : "stadium.png";
        }
コード例 #3
0
        public TeamPage(SingleClub clubObject, int teamId)
        {
            InitializeComponent();

            //use teamId to find the right team and get team matches
            Team findTeam = new Team();

            if (teamId == 0)
            {
                findTeam = clubObject.teams[0];
            }
            else
            {
                findTeam = clubObject.teams.Find(t => t.teamId == teamId);
            }
            GetTeamMatches(findTeam);

            var theTeamId = teamId;

            newClub             = clubObject as SingleClub;
            Club.BindingContext = newClub;

            string umbracoUrl = "http://motmv2.azurewebsites.net/";

            clubLogo.Source    = (clubObject.clubPic != "") ? umbracoUrl + clubObject.clubPic : "blogo.png";
            clubStadium.Source = (clubObject.stadiumPic != "") ? umbracoUrl + clubObject.stadiumPic : "stadium.png";

            foreach (Match match in matches)
            {
                match.matchName    = clubObject.clubName;
                match.opponentLogo = (match.opponentLogo != "") ? umbracoUrl + match.opponentLogo : "blogo.png";
            }

            foreach (var team in clubObject.teams)
            {
                motmPlayer = team.highestT;
            }


            MotmPlayer.BindingContext = motmPlayer;
            NextMatches.ItemsSource   = matches;
            TeamNameListView.Text     = clubObject.clubName;
        }