summaryrefslogtreecommitdiff
path: root/CSharp/Ivy/IvyPPC/IvyEventArgs.cs
blob: fe0196df1403a7ea3bdac40f4136846e18584ddb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using System;
using System.Collections.Specialized;
using System.Text;

namespace IvyBus
{
    /// <summary> The EventArgs Classes
    /// </summary>
    /// 
    public class IvyEventArgs : EventArgs
    {
        private IvyClient client;
        private int id;
        private string arg;

        public IvyClient Client
        {
            get { return client; }
        }

        public int Id
        {
            get { return id; }
        }

        public string Argument
        {
            get { return arg; }
        }
        public IvyEventArgs(IvyClient app, int id, string arg)
        {
            this.client = app;
            this.id = id;
            this.arg = arg;
        }
    }
    public class IvyDieEventArgs : IvyEventArgs
    {
        /* return value for Die Event */
        private bool forceExit;

        public bool ForceExit
        {
            get { return forceExit; }
            set { forceExit = value; }
        }
        public IvyDieEventArgs(IvyClient app, int id, string arg)
            : base(app, id, arg)
        {
            forceExit = true;
        }
    }
    public class IvyMessageEventArgs : EventArgs
    {
        private IvyClient cleint;
        private int id;
        private StringCollection args;

        public IvyClient Client
        {
            get { return cleint; }
        }

        public int Id
        {
            get { return id; }
        }

        public StringCollection Arguments
        {
            get { return args; }
        }
        public string this[int i]
        {
            get { return args[i]; }
        }
        public IvyMessageEventArgs(IvyClient app, int id, string[] args)
        {
            this.cleint = app;
            this.id = id;
            this.args = new StringCollection();
            this.args.AddRange(args);
        }
    }
}