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. public abstract class FileTransfer
  8. {
  9.  
  10. // Questo รจ il riferimento all'elemento della taskview che
  11. // creeremo per monitorare il progress.
  12. protected Gtk.TreeIter iter;
  13.  
  14. // La connessione vera e propria al server
  15. protected SFTPConnection sftp;
  16.  
  17. // L'etichetta da mettere sul trasferimento
  18. protected string label;
  19.  
  20. // Un Globally Unique identifier che identifichi il nostro
  21. // trasferimento
  22. protected string GUID;
  23.  
  24. public delegate void Handler(string src, string dest, int transferredBytes,
  25. int totalBytes, string message);
  26.  
  27. public FileTransfer (string user, string password, string label)
  28. {
  29. // Connessione al server
  30. this.sftp = new SFTPConnection (user, password);
  31. this.sftp.Connect ();
  32.  
  33. // Colleghiamo gli eventi a dei pratici handler
  34. sftp.TransferStarted += new SFTPConnection.SFTPEvent(OnTransferStarted);
  35. sftp.TransferProgress += new SFTPConnection.SFTPEvent(OnTransferProgress);
  36. sftp.TransferStopped += new SFTPConnection.SFTPEvent(OnTransferStopped);
  37.  
  38. this.label = label;
  39. }
  40.  
  41. public virtual void Start () {}
  42.  
  43. public void Stop ()
  44. {
  45. // Queste chiamate dovrebbero essere piuttosto standard in tutti
  46. // i trasferimenti di file che per il momento ci possiamo immaginare.
  47. this.sftp.Abort ();
  48. this.sftp.Disconnect ();
  49. }
  50.  
  51.  
  52. /*
  53. * HANDLER: Queste funzioni aggiornarenno i progress etichettandoli usando
  54. * l'etichetta this.label, che deve essere istanziata dal costruttore
  55. */
  56. public void OnTransferStarted (string src, string dest, int transferredBytes,
  57. int totalBytes, string message)
  58. {
  59. GUID = System.Guid.NewGuid().ToString();
  60. EventManager.TaskTreeViewAddTask (label, 0, GUID);
  61. this.iter = EventManager.GetIter (GUID);
  62. }
  63.  
  64. public void OnTransferProgress(string src, string dest, int transferredBytes,
  65. int totalBytes, string message)
  66. {
  67. int perc = transferredBytes / (totalBytes / 100);
  68. EventManager.TaskTreeViewSetProgress (this.iter, perc);
  69. }
  70.  
  71. public void OnTransferStopped (string src, string dest, int transferredBytes,
  72. int totalBytes, string message)
  73. {
  74. EventManager.TaskTreeViewRemove (iter);
  75. }
  76. }
  77. }