document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. \' Gambas class file
  2.  
  3. Inherits ISalonDeChat
  4.  
  5. Private Usuarios As New Collection
  6.  
  7. Public ZonaEscribe As TextLabel
  8.  
  9. Public Sub _new(z As TextLabel)
  10.  
  11.   ZonaEscribe = z
  12.   ZonaEscribe.text = "<br>Inicio la conversación...<br><br>"
  13.  
  14. End
  15.  
  16. Public Sub registra(user As Usuario)
  17.  
  18.   usuarios.Add(user, User.getNombre())
  19.  
  20. End
  21.  
  22. Public Sub envia(de As String, a As String, msg As String)
  23.  
  24.   Dim u As Usuario  
  25.  
  26.   If usuarios.Exist(de) = False Then
  27.     ZonaEscribe.Text &= "Salon Chat:  No existe el Usuario " & de & ", para enviarle el mensaje < br > "
  28.   Endif
  29.  
  30.   If usuarios.Exist(a) = False Then
  31.     ZonaEscribe.Text &= "Salon Chat:  No existe el Usuario " & a & ", para enviarle el mensaje: <b>" & msg & "</b><br>"
  32.   Endif
  33.  
  34.   If usuarios.Exist(de) And usuarios.Exist(a) Then
  35.    
  36.     u = usuarios[a]
  37.     u.recibe(de, msg)
  38.    
  39.   Endif
  40.  
  41. End
  42.  
  43. Public Sub cierra()
  44.   \'esto se hace para cuando se deje de usar el objeto, no queden referencias circulares
  45.  
  46.   usuarios = Null
  47.  
  48. End
');