This repository was archived by the owner on Apr 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathContextEvents.cs
More file actions
105 lines (78 loc) · 2.49 KB
/
ContextEvents.cs
File metadata and controls
105 lines (78 loc) · 2.49 KB
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
103
104
105
//------------------------------------------------------------------------------
// <license file="ContextEvents.cs">
//
// The use and distribution terms for this software are contained in the file
// named 'LICENSE', which can be found in the resources directory of this
// distribution.
//
// By using this software in any fashion, you are agreeing to be bound by the
// terms of this license.
//
// </license>
//------------------------------------------------------------------------------
using System;
namespace EcmaScript.NET
{
public class ContextEventArgs : EventArgs
{
private Context m_Context = null;
/// <summary>
/// The underlying context
/// </summary>
public Context Context
{
get { return m_Context; }
}
/// <summary>
/// Creates a new ContextEventArgs object
/// </summary>
/// <param name="cx"></param>
public ContextEventArgs (Context cx)
{
m_Context = cx;
}
}
public class ContextScriptableEventArgs : ContextEventArgs
{
private IScriptable m_Scope = null;
public ContextScriptableEventArgs (Context cx, IScriptable scope)
: base (cx)
{
m_Scope = scope;
}
public IScriptable Scope
{
get { return m_Scope; }
}
}
/// <summary>
///
/// </summary>
public class ContextWrapEventArgs : ContextScriptableEventArgs
{
private object m_Source = null;
public object Source
{
get { return m_Source; }
}
private object m_Target = null;
public object Target
{
get { return m_Target; }
set { m_Target = null; }
}
private Type m_StaticType = null;
public Type staticType
{
get { return m_StaticType; }
}
public ContextWrapEventArgs (Context cx, IScriptable scope, object obj, Type staticType)
: base (cx, scope)
{
m_Source = obj;
m_StaticType = staticType;
}
}
public delegate void ContextEventHandler (object sender, ContextEventArgs e);
public delegate void ContextWrapHandler (object sender, ContextWrapEventArgs e);
}