示例#1
0
        private void AddFollowerIntoPanel(List <Follower> list, StackPanel panel, Follower.Races race)
        {
            panel.Children.Clear();
            var data = from temp in list
                       where this.MatchRace(temp, race) &&
                       this.allFollowers.Exists(x => (x.Name == temp.NameCN) || (x.Name == temp.NameEN) || (x.Name == temp.NameTCN))
                       orderby temp.Quolaty descending
                       select temp;

            foreach (Follower follower in data)
            {
                panel.Children.Add(new followerFromDatabasexaml(follower, follower.Quolaty));
            }

            data = from temp in list
                   where this.MatchRace(temp, race) &&
                   !this.allFollowers.Exists(x => (x.Name == temp.NameCN) || (x.Name == temp.NameEN) || (x.Name == temp.NameTCN))
                   orderby temp.Quolaty descending
                   select temp;

            foreach (Follower follower in data)
            {
                panel.Children.Add(new followerFromDatabasexaml(follower, 0));
            }
        }
示例#2
0
        private void AddFollowersByRace(Follower.Races followerRace)
        {
            if (this.titleMy.FontSize == 22)
            {
                this.myPanel.Children.Clear();

                var data = from temp in this.allFollowers
                           where this.MatchRace(temp, followerRace)
                           orderby temp.Quolaty descending
                           select temp;

                foreach (Follower follower in data)
                {
                    this.myPanel.Children.Add(new FollowerRow(follower, this.favorites.Contains(follower)));
                }
            }
            else if (this.titleAli.FontSize == 22)
            {
                this.AddFollowerIntoPanel(this.aliFollowers, this.aliPanel, followerRace);
            }
            else if (this.titleHrd.FontSize == 22)
            {
                this.AddFollowerIntoPanel(this.hrdFollowers, this.hrdPanel, followerRace);
            }
        }
示例#3
0
 private bool MatchRace(Follower follower, Follower.Races race)
 {
     if (Convert.ToInt16(race) > 12)
     {
         if (follower.Race == Follower.Races.error)
         {
             return(false);
         }
         else
         {
             return(Convert.ToInt16(follower.Race) > 12);
         }
     }
     else
     {
         return(follower.Race == race);
     }
 }