| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- //
- // System.ComponentModel.EventHandlerList.cs
- //
- // Author:
- // Miguel de Icaza ([email protected])
- //
- // (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 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;
- }
- }
-
- }
|