Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. public class Gamedat
  2. {
  3. public string[] Games
  4. {
  5. get;
  6. set;
  7. }
  8.  
  9. public string[] Gtypes
  10. {
  11. get;
  12. set;
  13. }
  14.  
  15. public Dictionary<string, int[]> Playdata
  16. {
  17. get;
  18. set;
  19. }
  20.  
  21. }
  22.  
  23. class Program
  24.  
  25. {
  26.  
  27.  
  28. static void Main(string[] args)
  29. {
  30.  
  31.  
  32. Gamedat dataframe = new Gamedat();
  33. dataframe.Games = new string[] { "Game 1", "Game 2", "Game 3", "Game 4", "Game 5" };
  34. dataframe.Gtypes = new string[] { "A", "B", "C", "B", "A" };
  35. dataframe.Playdata = new Dictionary<string, int[]>();
  36.  
  37. //Add dictionary items
  38. int[] a = { 1, 0, 3, 4, 0 };
  39. int[] b = { 3, 0, 9, 10, 0 };
  40. int[] c = { 2, 3, 3, 5, 0 };
  41.  
  42. dataframe.Playdata.Add("Jack", a);
  43. dataframe.Playdata.Add("Jane", b);
  44. dataframe.Playdata.Add("James", c);
  45.  
  46.  
  47. }
  48.  
  49. public class Gamedat
  50. {
  51. public string Games
  52. { get;set;
  53. }
  54.  
  55. public string Gtypes
  56. {get; set;
  57. }
  58. }
  59.  
  60. class Program
  61. {
  62.  
  63. static void Main(string[] args)
  64. {
  65. List<Gamedat> dataframe = new Gamedat();
  66. dataframe.Games = new List<string> { "Game 1", "Game 2", "Game 3", "Game 4", "Game 5" };
  67. dataframe.Gtypes = new List<string> { "A", "B", "C", "B", "A" };
  68.  
  69. var result = dataframe.OrderBy(x => x.Gtypes)
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement