-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGEEventArgs.cs
102 lines (92 loc) · 3.29 KB
/
GEEventArgs.cs
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// <copyright file="GEEventArgs.cs" company="FC">
// Copyright (c) 2008 Fraser Chapman
// </copyright>
// <author>Fraser Chapman</author>
// <email>fraser.chapman@gmail.com</email>
// <date>2008-12-22</date>
// <summary>This file is part of FC.GEPluginCtrls
// FC.GEPluginCtrls is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
// </summary>
namespace FC.GEPluginCtrls
{
using System;
/// <summary>
/// Custom event arguments
/// </summary>
public sealed class GEEventArgs : EventArgs
{
/// <summary>
/// Initializes a new instance of the GEEventArgs class
/// </summary>
public GEEventArgs()
{
}
/// <summary>
/// Initializes a new instance of the GEEventArgs class
/// </summary>
/// <param name="feature">Plug-in API object to initialise with.</param>
public GEEventArgs(object feature)
{
this.ApiObject = feature;
}
/// <summary>
/// Initializes a new instance of the GEEventArgs class
/// </summary>
/// <param name="message">Event message</param>
public GEEventArgs(string message)
{
this.Message = message;
}
/// <summary>
/// Initializes a new instance of the GEEventArgs class
/// </summary>
/// <param name="message">Event message</param>
/// <param name="data">Event data</param>
public GEEventArgs(string message, string data)
: this(message)
{
EventId id;
if (Enum.TryParse(data, true, out id))
{
this.EventId = id;
}
this.Data = data;
}
/// <summary>
/// Initializes a new instance of the GEEventArgs class
/// </summary>
/// <param name="message">Event message</param>
/// <param name="data">Event data</param>
/// <param name="feature">Event data object</param>
public GEEventArgs(string message, string data, dynamic feature)
: this(message, data)
{
this.ApiObject = feature;
}
/// <summary>
/// Gets the event message
/// </summary>
public string Message { get; internal set; }
/// <summary>
/// Gets the data string
/// </summary>
public string Data { get; internal set; }
/// <summary>
/// Gets the event id
/// </summary>
public EventId EventId { get; internal set; }
/// <summary>
/// Gets the Api Object
/// </summary>
public dynamic ApiObject { get; internal set; }
}
}