using System.ComponentModel;
using System.Reflection;
using System.Security.Permissions;
+using System.Threading;
using System.Web.Compilation;
using System.Web.Util;
using System.Xml;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
+using System.Collections.Generic;
+using System.Collections.Concurrent;
namespace System.Web.UI
{
public bool noParams;
}
- static Hashtable auto_event_info;
- static object auto_event_info_monitor = new Object ();
+ static SplitOrderedList<Type, ArrayList> auto_event_info = new SplitOrderedList<Type, ArrayList> (EqualityComparer<Type>.Default);
internal void WireupAutomaticEvents ()
{
if (!SupportAutoEvents || !AutoEventWireup)
return;
- ArrayList events = null;
-
/* Avoid expensive reflection operations by computing the event info only once */
- lock (auto_event_info_monitor) {
- if (auto_event_info == null)
- auto_event_info = new Hashtable ();
- events = (ArrayList)auto_event_info [GetType ()];
- if (events == null) {
- events = CollectAutomaticEventInfo ();
- auto_event_info [GetType ()] = events;
- }
- }
+ Type type = GetType ();
+ ArrayList events = auto_event_info.InsertOrGet ((uint)type.GetHashCode (), type, null, CollectAutomaticEventInfo);
for (int i = 0; i < events.Count; ++i) {
EvtInfo evinfo = (EvtInfo)events [i];