Beispiel #1
0
        public AccListItem(Account acc)
        {
            Account  = acc;
            Nickname = acc.Nickname;
            Region   = acc.Region;
            RankText = acc.Rank;
            Rank     = LeagueRank.Unranked;

            if (RankText.Contains(" "))
            {
                string rank = RankText.Split(' ')[0];
                if (rank == "Iron")
                {
                    Rank = LeagueRank.Iron;
                }
                if (rank == "Bronze")
                {
                    Rank = LeagueRank.Bronze;
                }
                if (rank == "Silver")
                {
                    Rank = LeagueRank.Silver;
                }
                if (rank == "Gold")
                {
                    Rank = LeagueRank.Gold;
                }
                if (rank == "Platinum")
                {
                    Rank = LeagueRank.Platinum;
                }
                if (rank == "Diamond")
                {
                    Rank = LeagueRank.Diamond;
                }
            }
            else
            {
                if (RankText == "Master")
                {
                    Rank = LeagueRank.Master;
                }
                if (RankText == "Grandmaster")
                {
                    Rank = LeagueRank.Grandmaster;
                }
                if (RankText == "Challenger")
                {
                    Rank = LeagueRank.Challenger;
                }
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (ivMarker != null)
            {
                ivMarker.Dispose();
                ivMarker = null;
            }

            if (NameText != null)
            {
                NameText.Dispose();
                NameText = null;
            }

            if (ProfileImage != null)
            {
                ProfileImage.Dispose();
                ProfileImage = null;
            }

            if (ProgressBar != null)
            {
                ProgressBar.Dispose();
                ProgressBar = null;
            }

            if (ProgressBarWidthConstraint != null)
            {
                ProgressBarWidthConstraint.Dispose();
                ProgressBarWidthConstraint = null;
            }

            if (RankText != null)
            {
                RankText.Dispose();
                RankText = null;
            }

            if (TopSeparator != null)
            {
                TopSeparator.Dispose();
                TopSeparator = null;
            }

            if (vContentInset != null)
            {
                vContentInset.Dispose();
                vContentInset = null;
            }

            if (vInsetProportion != null)
            {
                vInsetProportion.Dispose();
                vInsetProportion = null;
            }

            if (vProfileImageInset != null)
            {
                vProfileImageInset.Dispose();
                vProfileImageInset = null;
            }

            if (vProgressNameInset != null)
            {
                vProgressNameInset.Dispose();
                vProgressNameInset = null;
            }

            if (vRankTextInset != null)
            {
                vRankTextInset.Dispose();
                vRankTextInset = null;
            }
        }