blob: dba45525db582c40e0e82ee2fdc8e99718706982 (
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
|
//
// System.ComponentModel.EventHandlerList.cs
//
// Author:
// Miguel de Icaza (miguel@ximian.com)
//
// (C) Ximian, Inc. http://www.ximian.com
//
using System;
using System.Collections;
namespace System.ComponentModel {
// <summary>
// List of Event delegates.
// </summary>
//
// <remarks>
// Longer description
// </remarks>
public sealed class EventHandlerList : IDisposable {
Hashtable table;
public EventHandlerList ()
{
}
public Delegate this [object key] {
get {
if (table == null)
return null;
return (Delegate) table [key];
}
set {
if (table == null)
table = new Hashtable ();
table.Add (key, value);
}
}
public void AddHandler (object key, Delegate value)
{
if (table == null)
table = new Hashtable ();
table.Add (key, value);
}
public void RemoveHandler (object key, Delegate value)
{
table.Remove (key);
}
public void Dispose ()
{
table = null;
}
}
}
|