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]
using System; namespace Dizzy { public class FileType { int type; const int UNKNOWN = 0; const int VIDEO = 1; const int AUDIO = 2; const int BOOK = 3; public FileType(string filename) { if(filename.EndsWith(".avi")) type = VIDEO; else if(filename.EndsWith(".pdf")) type = BOOK; else if(filename.EndsWith(".mp3")) type = AUDIO; else type = UNKNOWN; } public string Name() { if(type == VIDEO) return "Video"; else if(type == BOOK) return "Book"; else if(type == AUDIO) return "Audio"; else return "Sconosciuto"; } } public class File { public ulong size; public string user; public string name; public string path; public FileType type; public File (string path, ulong size, string user) { // Determino il tipo di file this.size = size; this.user = user; string[] pieces = path.Split ('/'); name = pieces[pieces.Length - 1]; } public string SizeToString() { ulong t_size = size; if(t_size < 1024) return t_size.ToString () + " B"; t_size /= 1024; if(t_size < 1024) return t_size.ToString () + " KB"; t_size /= 1024; if(t_size < 1024) return t_size.ToString () + "MB"; t_size /= 1024; if(t_size < 1024) return t_size.ToString () + "GB"; return "Unknown"; } } }