summaryrefslogtreecommitdiff
path: root/Ivy/IvyEventArgs.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ivy/IvyEventArgs.cs')
-rw-r--r--Ivy/IvyEventArgs.cs61
1 files changed, 42 insertions, 19 deletions
diff --git a/Ivy/IvyEventArgs.cs b/Ivy/IvyEventArgs.cs
index a08f314..279f7c4 100644
--- a/Ivy/IvyEventArgs.cs
+++ b/Ivy/IvyEventArgs.cs
@@ -15,20 +15,32 @@ namespace IvyBus
private int id;
private string arg;
+ /// <summary>
+ /// the client who raise the event
+ /// </summary>
public IvyClient Client
{
get { return client; }
}
+ /// <summary>
+ /// the id argument of the message
+ /// </summary>
public int Id
{
get { return id; }
}
+ /// <summary>
+ /// the general purpose argument of the event
+ /// </summary>
public string Argument
{
get { return arg; }
}
+ /// <summary>
+ /// Args of Ivy generated events
+ /// </summary>
public IvyEventArgs(IvyClient app, int id, string arg)
{
this.client = app;
@@ -41,46 +53,57 @@ namespace IvyBus
/* return value for Die Event */
private bool forceExit;
+ /// <summary>
+ /// should we exit
+ /// </summary>
+ /// <remarks>
+ /// by default the Ivy bus will make a call to Exit
+ /// set this flags to false if you wan't your application to survive
+ /// </remarks>
+ /// <value>true</value>
public bool ForceExit
{
get { return forceExit; }
set { forceExit = value; }
}
+ /// <summary>
+ /// Arg of the Die Event
+ /// </summary>
public IvyDieEventArgs(IvyClient app, int id, string arg)
: base(app, id, arg)
{
forceExit = true;
}
}
- public class IvyMessageEventArgs : EventArgs
+ public class IvyMessageEventArgs : IvyEventArgs
{
- private IvyClient client;
- private int id;
- private string[] args;
-
- public IvyClient Client
- {
- get { return client; }
- }
-
- public int Id
- {
- get { return id; }
- }
+ private string[] arg_list;
+ /// <summary>
+ /// retreive all the arguments
+ /// </summary>
+ /// <returns></returns>
public string[] GetArguments()
{
- return (string[])args.Clone();
+ return (string[])arg_list.Clone();
}
+
+ /// <summary>
+ /// retreive the argument at specified index
+ /// </summary>
+ /// <param name="index"></param>
+ /// <returns></returns>
public string this[int index]
{
- get { return args[index]; }
+ get { return arg_list[index]; }
}
+ /// <summary>
+ /// Arg for the Normal Ivy Message received
+ /// </summary>
public IvyMessageEventArgs(IvyClient app, int id, string[] args)
+ : base( app, id, null)
{
- this.client = app;
- this.id = id;
- this.args = args;
+ this.arg_list = args;
}
}
}