SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 319 | Next

Rob Cameron and Dale Michalk

"Pro ASP.NET 3.5 Server Controls and AJAX Components"

AddHandler(PageCommandKey, value);
}
remove
{
Events.RemoveHandler(PageCommandKey, value);
}
}
228 CHAPTER 5 ?–  SE RVER CONTROL EVENTS
We also add an OnPageCommand method to raise the event. This method uses the custom
PageCommandEventArgs class we defined earlier to invoke the PageCommandEventHandler delegate:
protected virtual void OnPageCommand(PageCommandEventArgs pce)
{
PageCommandEventHandler pageCommandEventDelegate =
(PageCommandEventHandler) Events[PageCommandEvent];
if (pageCommandEventDelegate != null)
{
pageCommandEventDelegate(this, pce);
}
}
OnPageCommand is the last bit of code required to raise events associated with the PageCommand
event type. The next task is to capture the bubbled Command events and turn them into
PageCommand events.
Capturing the Bubbles via OnBubbleEvent
The OnBubbleEvent method inherited from System.Web.UI.Control is the counterpart to the
RaiseBubbleEvent method used inside the SuperButton control. It allows a control to hook into
the stream of bubbled events from child controls and process them accordingly:
protected override bool OnBubbleEvent(object source, EventArgs e);
The method definition for OnBubbleEvent specifies the ubiquitous System.EventHandler
method signature, with one difference.


Pages:
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6