viewgit/index.php:465 Only variables should be passed by reference [2048]

viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]

  1.  
  2. using System;
  3.  
  4. namespace Dizzy
  5. {
  6.  
  7.  
  8. public class FileType {
  9.  
  10. int type;
  11. const int UNKNOWN = 0;
  12. const int VIDEO = 1;
  13. const int AUDIO = 2;
  14. const int BOOK = 3;
  15.  
  16. public FileType(string filename) {
  17.  
  18. if(filename.EndsWith(".avi"))
  19. type = VIDEO;
  20. else if(filename.EndsWith(".pdf"))
  21. type = BOOK;
  22. else if(filename.EndsWith(".mp3"))
  23. type = AUDIO;
  24. else
  25. type = UNKNOWN;
  26.  
  27. }
  28.  
  29. public string Name()
  30. {
  31. if(type == VIDEO)
  32. return "Video";
  33. else if(type == BOOK)
  34. return "Book";
  35. else if(type == AUDIO)
  36. return "Audio";
  37. else
  38. return "Sconosciuto";
  39. }
  40. }
  41.  
  42. public class File
  43. {
  44.  
  45.  
  46. public string user;
  47. public string name;
  48. public string path;
  49. public FileType type;
  50.  
  51. public File (string path, string user)
  52. {
  53. // Determino il tipo di file
  54. type = new FileType (path);
  55.  
  56. this.user = user;
  57. this.path = path;
  58. Console.WriteLine("Path set to: {0}", this.path);
  59. string[] pieces = path.Split ('/');
  60.  
  61. name = pieces[pieces.Length - 1];
  62.  
  63. }
  64.  
  65.  
  66. }
  67. }