summaryrefslogtreecommitdiff
path: root/IvyPPC/IvyEventArgs.cs
blob: e3948021023aef85e6f0a4ed1d37f28e4cf79e30 (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
using System;
using System.Collections.Generic;
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 client;
        private int id;
        private string[] args;

        public IvyClient Client
        {
            get { return client; }
        }

        public int Id
        {
            get { return id; }
        }

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