OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
OSChatMessage.cs
Go to the documentation of this file.
1 /*
2  * Copyright (c) Contributors, http://opensimulator.org/
3  * See CONTRIBUTORS.TXT for a full list of copyright holders.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of the OpenSimulator Project nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 using System;
29 using OpenMetaverse;
30 
31 namespace OpenSim.Framework
32 {
33  public interface IEventArgs
34  {
35  IScene Scene { get; set; }
36  IClientAPI Sender { get; set; }
37  }
38 
42  public class OSChatMessage : EventArgs, IEventArgs
43  {
44  protected int m_channel;
45  protected string m_from;
46  protected string m_message;
47  protected Vector3 m_position;
48 
49  protected IScene m_scene;
50  protected IClientAPI m_sender;
51  protected object m_senderObject;
52  protected ChatTypeEnum m_type;
53  protected UUID m_fromID;
54  protected UUID m_destination = UUID.Zero;
55 
56  public OSChatMessage()
57  {
58  m_position = new Vector3();
59  }
60 
64  public string Message
65  {
66  get { return m_message; }
67  set { m_message = value; }
68  }
69 
73  public ChatTypeEnum Type
74  {
75  get { return m_type; }
76  set { m_type = value; }
77  }
78 
82  public int Channel
83  {
84  get { return m_channel; }
85  set { m_channel = value; }
86  }
87 
91  public Vector3 Position
92  {
93  get { return m_position; }
94  set { m_position = value; }
95  }
96 
100  public string From
101  {
102  get { return m_from; }
103  set { m_from = value; }
104  }
105 
106  #region IEventArgs Members
107 
110 
114  public IClientAPI Sender
115  {
116  get { return m_sender; }
117  set { m_sender = value; }
118  }
119 
123  public object SenderObject
124  {
125  get { return m_senderObject; }
126  set { m_senderObject = value; }
127  }
128 
129  public UUID SenderUUID
130  {
131  get { return m_fromID; }
132  set { m_fromID = value; }
133  }
134 
135  public UUID Destination
136  {
137  get { return m_destination; }
138  set { m_destination = value; }
139  }
140 
144  public IScene Scene
145  {
146  get { return m_scene; }
147  set { m_scene = value; }
148  }
149 
150  public override string ToString()
151  {
152  return m_message;
153  }
154 
155  #endregion
156  }
157 }
ChatFromViewer Arguments