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 320 | Next

Rob Cameron and Dale Michalk

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

It takes an object reference and an EventArgs reference
but returns a bool. The bool return value indicates whether or not the control has processed the
bubble event. A value of false indicates that the bubble event should continue bubbling up the
control hierarchy; a value of true indicates a desire to stop the event in its tracks, because it has
been handled. If a control does not implement OnBubbleEvent, the default implementation
passes the event on up to parent controls.
The Pager control implements its OnBubbleEvent as shown in Listing 5-15.
Listing 5-15. The Pager Implementation of OnBubbleEvent
protected override bool OnBubbleEvent(object source, EventArgs e)
{
bool result = false;
CommandEventArgs ce = e as CommandEventArgs;
if (ce != null)
{
if (ce.CommandName.Equals("Page"))
{
PageDirection direction;
if (ce.CommandArgument.Equals("Right"))
direction = PageDirection.Right;
CHAPTER 5 ?–  SERVER CONTROL EVEN TS 229
else
direction = PageDirection.Left;
PageCommandEventArgs pce =
new PageCommandEventArgs(direction);
OnPageCommand(pce);
result = true;
}
}
return result;
}
The result variable holds the return value of OnBubbleEvent for the Pager control. It is set
to false, assuming failure until success.


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