ChatFromViewerArgs.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. using System;
  2. using libsecondlife;
  3. namespace OpenSim.Framework
  4. {
  5. public interface IEventArgs
  6. {
  7. IScene Scene { get; set; }
  8. IClientAPI Sender { get; set; }
  9. }
  10. /// <summary>
  11. /// ChatFromViewer Arguments
  12. /// </summary>
  13. public class ChatFromViewerArgs : EventArgs, IEventArgs
  14. {
  15. protected int m_channel;
  16. protected string m_from;
  17. protected string m_message;
  18. protected LLVector3 m_position;
  19. protected IScene m_scene;
  20. protected IClientAPI m_sender;
  21. protected object m_senderObject;
  22. protected ChatTypeEnum m_type;
  23. protected LLUUID m_fromID;
  24. public ChatFromViewerArgs()
  25. {
  26. m_position = new LLVector3();
  27. }
  28. /// <summary>
  29. /// The message sent by the user
  30. /// </summary>
  31. public string Message
  32. {
  33. get { return m_message; }
  34. set { m_message = value; }
  35. }
  36. /// <summary>
  37. /// The type of message, eg say, shout, broadcast.
  38. /// </summary>
  39. public ChatTypeEnum Type
  40. {
  41. get { return m_type; }
  42. set { m_type = value; }
  43. }
  44. /// <summary>
  45. /// Which channel was this message sent on? Different channels may have different listeners. Public chat is on channel zero.
  46. /// </summary>
  47. public int Channel
  48. {
  49. get { return m_channel; }
  50. set { m_channel = value; }
  51. }
  52. /// <summary>
  53. /// The position of the sender at the time of the message broadcast.
  54. /// </summary>
  55. public LLVector3 Position
  56. {
  57. get { return m_position; }
  58. set { m_position = value; }
  59. }
  60. /// <summary>
  61. /// The name of the sender (needed for scripts)
  62. /// </summary>
  63. public string From
  64. {
  65. get { return m_from; }
  66. set { m_from = value; }
  67. }
  68. #region IEventArgs Members
  69. /// TODO: Sender and SenderObject should just be Sender and of
  70. /// type IChatSender
  71. /// <summary>
  72. /// The client responsible for sending the message, or null.
  73. /// </summary>
  74. public IClientAPI Sender
  75. {
  76. get { return m_sender; }
  77. set { m_sender = value; }
  78. }
  79. /// <summary>
  80. /// The object responsible for sending the message, or null.
  81. /// </summary>
  82. public object SenderObject
  83. {
  84. get { return m_senderObject; }
  85. set { m_senderObject = value; }
  86. }
  87. public LLUUID SenderUUID
  88. {
  89. get { return m_fromID; }
  90. set { m_fromID = value; }
  91. }
  92. /// <summary>
  93. ///
  94. /// </summary>
  95. public IScene Scene
  96. {
  97. get { return m_scene; }
  98. set { m_scene = value; }
  99. }
  100. #endregion
  101. }
  102. }