Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
QuestionRestore main window from other process Pin
Daniel Leykauf11-Nov-09 6:14
Daniel Leykauf11-Nov-09 6:14 
AnswerRe: Restore main window from other process Pin
Paulo Zemek11-Nov-09 6:59
mvaPaulo Zemek11-Nov-09 6:59 
GeneralRe: Restore main window from other process Pin
Daniel Leykauf11-Nov-09 7:10
Daniel Leykauf11-Nov-09 7:10 
Question[Message Deleted] Pin
Crapaw4511-Nov-09 5:49
Crapaw4511-Nov-09 5:49 
QuestionActive UICulture in setup rpoject Pin
waelmail10511-Nov-09 5:19
waelmail10511-Nov-09 5:19 
Questioncan't get depth chart to display Pin
rooster215411-Nov-09 4:47
rooster215411-Nov-09 4:47 
AnswerRe: can't get depth chart to display Pin
Keith Barrow11-Nov-09 6:24
professionalKeith Barrow11-Nov-09 6:24 
GeneralRe: can't get depth chart to display Pin
rooster215411-Nov-09 9:37
rooster215411-Nov-09 9:37 
Thank you for your response. I've considered your ideas and it occurred to me that maybe all of this isn't necessary afterall; perhaps, for each team, I could simply list each position with each player at that position in descending order by OVR with simple loops.
This is in my Main() method
            foreach (Team t in league.Teams)
            {
                Console.WriteLine("");
                Console.WriteLine(t.Name + " " + t.Nickname);
                foreach (PlayerPosition pos in Enum.GetValues(typeof(PlayerPosition)))
                {
                    Console.WriteLine(pos);
                    league.AllPlayers.Where(pl => pl.position == pos).OrderByDescending(pl => pl.OVR).ToList().ForEach(pl => pl.Print());
}
}


The only problem with this code is that for each team displayed, it's putting ALL of the players in the league, regardless of what team they're on, in each team's roster that is displayed.
I believe has to do with the AllPlayers designation. This is located in my League class:
public List<Player> AllPlayers
{
    get
    {
        var list = from t in Teams
                   from p in t.Players
                   select p;
        return list.ToList();
    }
}


How would you suggest I fix this?
GeneralRe: can't get depth chart to display Pin
Keith Barrow11-Nov-09 13:28
professionalKeith Barrow11-Nov-09 13:28 
QuestionHow to resize two texbox proportionally? Pin
Zeokat11-Nov-09 1:21
Zeokat11-Nov-09 1:21 
AnswerRe: How to resize two texbox proportionally? Pin
Lyon Sun11-Nov-09 2:12
Lyon Sun11-Nov-09 2:12 
GeneralRe: How to resize two texbox proportionally? Pin
Zeokat11-Nov-09 10:04
Zeokat11-Nov-09 10:04 
GeneralRe: How to resize two texbox proportionally? Pin
Zeokat12-Nov-09 0:10
Zeokat12-Nov-09 0:10 
Questionhow to perform image erosion in c#? Pin
Rubasini11-Nov-09 1:04
Rubasini11-Nov-09 1:04 
Questionhow to build remote system call application ? Pin
sudhir behera11-Nov-09 0:24
sudhir behera11-Nov-09 0:24 
AnswerRe: how to build remote system call application ? Pin
Abhishek Sur11-Nov-09 0:45
professionalAbhishek Sur11-Nov-09 0:45 
QuestionCreate radio buttons using data from XML Pin
Zar Ni10-Nov-09 22:59
Zar Ni10-Nov-09 22:59 
AnswerRe: Create radio buttons using data from XML Pin
Calla10-Nov-09 23:31
Calla10-Nov-09 23:31 
QuestionTableLayoutPanel Problem Pin
Tim Daughton10-Nov-09 22:32
Tim Daughton10-Nov-09 22:32 
AnswerMessage Closed Pin
10-Nov-09 22:38
stancrm10-Nov-09 22:38 
GeneralRe: TableLayoutPanel Problem Pin
Tim Daughton10-Nov-09 22:59
Tim Daughton10-Nov-09 22:59 
Questionupdating multiple rows of a single column with different values at runtime from C# Pin
Member 236780010-Nov-09 22:18
Member 236780010-Nov-09 22:18 
AnswerRe: updating multiple rows of a single column with different values at runtime from C# Pin
MumbleB11-Nov-09 0:24
MumbleB11-Nov-09 0:24 
GeneralRe: updating multiple rows of a single column with different values at runtime from C# Pin
Member 236780011-Nov-09 8:15
Member 236780011-Nov-09 8:15 
QuestionHTML to plain text Pin
Hum Dum10-Nov-09 22:16
Hum Dum10-Nov-09 22:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.