protected virtual void OnNewAverage(AverageTimeEventArgs e) { EventHandler <AverageTimeEventArgs> handler = NewAverage; if (handler != null) { handler(this, e); } }
//public override void Init() //{ // IHttpModule mod = Modules["AverageTime"]; // if (mod is AverageTimeModule) // { // ((AverageTimeModule)mod).NewAverage += (src, args) => { // Response.Write(string.Format("<h3>Ave time: {0:F2}ms</h3>", // args.AverageTime)); // }; // } //} public void AverageTime_NewAverage(object src, AverageTimeEventArgs args) { Response.Write(string.Format("<h3>Ave time: {0:F2}ms</h3>", args.AverageTime)); }